segmentByCBS.RawGenomicSignals {aroma.core}R Documentation

Segment copy numbers using the CBS method

Description

Segment copy numbers using the CBS method of the DNAcopy package.

Usage

## S3 method for class 'RawGenomicSignals':
segmentByCBS(this, ..., cache=FALSE, force=FALSE, verbose=FALSE)

Arguments

... Additional arguments passed to the segmentation function.
verbose See Verbose.

Details

Internally segment is used to segment the signals. This segmentation method support weighted segmentation.

Value

Returns the fit object.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

For more information see RawGenomicSignals.

Examples

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Simulating copy-number data
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Number of loci
J <- 1000

mu <- double(J)
mu[200:300] <- mu[200:300] + 1
mu[650:800] <- mu[650:800] - 1
eps <- rnorm(J, sd=1/2)
y <- mu + eps
x <- sort(runif(length(y), max=length(y)))
w <- runif(J)
w[650:800] <- 0.001

cn <- RawCopyNumbers(y, x)
print(cn)

plot(cn, col="#aaaaaa")

cnS <- binnedSmoothing(cn, by=10)
print(cnS)
lines(cnS, col="black", lwd=3)

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Segment
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
legend <- c()

if (require("DNAcopy")) {
  fit <- segmentByCBS(cn)
  cnr <- extractCopyNumberRegions(fit)
  print(cnr)
  drawLevels(cnr, col="red", lwd=3)
  legend <- c(legend, red="CBS")
}

if (require("GLAD")) {
  fit <- segmentByGLAD(cn)
  cnr <- extractCopyNumberRegions(fit)
  print(cnr)
  drawLevels(cnr, col="blue", lwd=3)
  legend <- c(legend, blue="GLAD")
}

if (require("HaarSeg")) {
  fit <- segmentByHaarSeg(cn)
  cnr <- extractCopyNumberRegions(fit)
  print(cnr)
  drawLevels(cnr, col="orange", lwd=3)
  legend <- c(legend, orange="HaarSeg")
}

legend("topleft", pch=19, col=names(legend), legend, bty="n", horiz=TRUE)

[Package aroma.core version 1.4.0 Index]