Last data update: 2014.03.03

R: Calls gains and losses
callGainsAndLosses.CBSR Documentation

Calls gains and losses

Description

Calls gains and losses.

Usage

## S3 method for class 'CBS'
callGainsAndLosses(fit, adjust=1, method=c("ucsf-mad", "ucsf-dmad"), ..., verbose=FALSE)

Arguments

adjust

A positive scale factor adjusting the sensitivity of the caller, where a value less (greater) than 1.0 makes the caller less (more) sensitive.

method

A character string specifying the calling algorithm to use.

...

Additional/optional arguments used to override the default parameters used by the caller.

Value

Returns a CBS object where logical columns 'lossCall' and 'gainCall' have been appended to the segmentation table.

The UCSF caller

If method == "ucsf-mad", then segments are called using [1], i.e. a segment is called gained or lost if its segment level is at least two standard deviations away from the median segment level on Chr1-22, where standard deviation is estimated using MAD. Then same is done for method == "ucsf-dmad" with the difference that the standard deviation is estimated using a robust first order variance estimator.

Author(s)

Henrik Bengtsson

References

[1] Fridlyand et al. Breast tumor copy number aberration phenotypes and genomic instability, BMC Cancer, 2006.

See Also

*callAmplifications(). *callOutliers(). For more information see CBS.

Examples

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

# Number of loci
J <- 1000

mu <- double(J)
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)


 
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# CALLS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Call gains and losses by segments
fitC <- callGainsAndLosses(fit)

# Call amplifications by segments
fitC <- callAmplifications(fitC)

# Call outliers by loci
fitC <- callOutliers(fitC)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PSCBS)
PSCBS v0.61.0 (2016-02-03) successfully loaded. See ?PSCBS for help.

Attaching package: 'PSCBS'

The following objects are masked from 'package:base':

    append, load

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PSCBS/callGainsAndLosses.CBS.Rd_%03d_medium.png", width=480, height=480)
> ### Name: callGainsAndLosses.CBS
> ### Title: Calls gains and losses
> ### Aliases: callGainsAndLosses.CBS CBS.callGainsAndLosses
> ###   callGainsAndLosses,CBS-method
> ### Keywords: internal methods
> 
> ### ** Examples
> 
>  
> # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> # Simulating copy-number data
> # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> set.seed(0xBEEF)
> 
> # Number of loci
> J <- 1000
> 
> mu <- double(J)
> 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)
  sampleName chromosome       start      end nbrOfLoci    mean
1       <NA>          0    55167.82 20774251       201  0.0164
2       <NA>          0 20774250.85 29320105        99  1.0474
3       <NA>          0 29320104.86 65874675       298 -0.0203
4       <NA>          0 65874675.06 81348129       151 -1.0813
5       <NA>          0 81348129.20 99910827       200 -0.0612
> plotTracks(fit)
> 
> 
>  
> # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> # CALLS
> # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> # Call gains and losses by segments
> fitC <- callGainsAndLosses(fit)
> 
> # Call amplifications by segments
> fitC <- callAmplifications(fitC)
> 
> # Call outliers by loci
> fitC <- callOutliers(fitC)
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>