Learn R Programming

aroma.core (version 1.1.2)

segmentByCBS.RawGenomicSignals: 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.

Value

  • Returns the fit object.

Details

Internally *DNAcopy::segment() is used to segment the signals. This segmentation method support weighted segmentation.

See Also

Internally the segmentation function *DNAcopy::segment() is used. For more information see RawGenomicSignals.

Examples

Run this code
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fit <- segmentByCBS(cn)
cnr <- extractCopyNumberRegions(fit)
print(cnr)
drawLevels(cnr, col="red")

fit <- segmentByGLAD(cn)
cnr <- extractCopyNumberRegions(fit)
print(cnr)
drawLevels(cnr, col="blue")

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

Run the code above in your browser using DataLab