Learn R Programming

PSCBS (version 0.67.0)

pruneBySdUndo.CBS: Prune the CBS profile by dropping change points that are too small

Description

Prune the CBS profile by dropping change points that are too small, where "too small" means that the amplitude of the change points is less than a multiple of the overall standard deviation of the copy-number signals.

Usage

# S3 method for CBS
pruneBySdUndo(fit, rho=3, sigma="DNAcopy", ..., verbose=FALSE)

Value

Returns a CBS object (of the same class as fit).

Arguments

fit

A CBS object.

rho

A positive double scalar specifying the number of standard deviations (rho*sigma) required in order to keep a change point. More change points are dropped the greater this value is.

sigma

The whole-genome standard deviation of the locus-level copy number signals. The default is to calculate it from the data and as done in the DNAcopy package.

...

(Optional) Additional arguments passed to the standard deviation estimator function.

verbose

See Verbose.

Author

Henrik Bengtsson, Pierre Neuvial

Details

This method corresponds to using the undo argument when calling segmentByCBS(), which in turn corresponds to using the undo.splits="sdundo" and undo.SD of the underlying segment method.

Examples

Run this code

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Simulating copy-number data
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
set.seed(0xBEEF)

# Number of loci
J <- 1000

mu <- double(J)
mu[1:100] <- mu[1:100] + 0.3
mu[200:300] <- mu[200:300] + 1
mu[350:400] <- NA # centromere
mu[650:800] <- mu[650:800] - 1
eps <- rnorm(J, sd=1/2)
y <- mu + eps
x <- sort(runif(length(y), max=length(y))) * 1e5
w <- runif(J)
w[650:800] <- 0.001


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Segmentation
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fit <- segmentByCBS(y, x=x)
print(fit)
plotTracks(fit)

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Post-segmentation pruning
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fitP <- pruneBySdUndo(fit, rho=1)
drawLevels(fitP, col="red")

Run the code above in your browser using DataLab