Last data update: 2014.03.03

R: Allelic Copy Number correction for cellularity
correctCopyNumber R Documentation

Allelic Copy Number correction for cellularity

Description

This function segments copy number and corrects log-ratios (LRR) and beta allele frequencies (BAF) values for cellularity.

Usage

correctCopyNumber(arr="Sample1", chr=NULL, p=NULL, z=NULL, min.value=-5)

Arguments

arr

Name of the array.

chr

Chromosome to run. If NULL, all chromosomes are run.

p

Percentage of tumoural cells

.

z

Copy Number Data. Must be a dataframe with the following columns: Name (id of the probe), Chr (chromosome), Pos (position), LRR (log ratios) and BAF (beta allele frequencies).

min.value

Value assigned to the probes that have 0 copies after correction.

Details

The data.frame z must contain only SNP probes, that is probes with both LRR and BAF values. It is recommended that all replicated probes are merged so the positions are unique. This function calls DNAcopy to segment the LRR and then correct the segmented profiles for normal contamination according to the method described in the reference below (see for details).

Value

A list with 2 components:

y

a data.frame with as many rows as probes containing the following variables: Chrom (chromosome), Pos (position), Orig.LRR (LRR before correction) Orig.BAF (BAF before correction), Corr.LRR (LRR after cellularity correction) and Corr.BAF (BAF after correction)

seg

a data.frame with the segmented data. Contains the following columns: ID (name of the array), chrom (chromosome), loc.start (start of the region), loc.end (end of the region), num.mark (number of probes in the region), seg.mean (LRR of the region), BAF (BAF of the regions), num.BAF (number of SNP probes in the region), Sa (estimated absolute copy number for the first allele), Sb (estimated absolute copy number for the first allele), LRR.tum (corrected LRR for the region), BAF.tum (corrected BAF for the region).

Note

Includes an adaptation of aCGH mergeLevels function to fix a problem with ansari.test.

Author(s)

Oscar M. Rueda, rueda.om@gmail.com

References

Yuan, Y et al. Quantitative image analysis of cellular heterogeneity in primary breast tumors enriches genomic assays. In prep.

Examples

LRR <- c(rnorm(100, 0, 1), rnorm(10, -2, 1), rnorm(20, 3, 1),
       rnorm(100,0, 1)) 
BAF <- c(rnorm(100, 0.5, 0.1), rnorm(5, 0.2, 0.01), rnorm(5, 0.8, 0.01), rnorm(10, 0.25, 0.1), rnorm(10, 0.75, 0.1),
       rnorm(100,0.5, 0.1)) 

Pos <- sample(x=1:500, size=230, replace=TRUE)
Pos <- cumsum(Pos)
Chrom <- rep(1, length(LRR))
z <- data.frame(Name=1:length(LRR), Chrom=Chrom, Pos=Pos, LRR=LRR, BAF=BAF)
res <- correctCopyNumber(arr="Sample1", chr=1, p=0.75, z=z)


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(CRImage)
Loading required package: EBImage
Loading required package: DNAcopy
Loading required package: aCGH
Loading required package: cluster
Loading required package: survival
Loading required package: multtest
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

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

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

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

    IQR, mad, xtabs

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

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package: 'Biobase'

The following object is masked from 'package:EBImage':

    channel


Attaching package: 'aCGH'

The following object is masked from 'package:stats':

    heatmap

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/CRImage/correctCopyNumber.Rd_%03d_medium.png", width=480, height=480)
> ### Name: correctCopyNumber 
> ### Title: Allelic Copy Number correction for cellularity
> ### Aliases: correctCopyNumber
> ### Keywords: misc
> 
> ### ** Examples
> 
> LRR <- c(rnorm(100, 0, 1), rnorm(10, -2, 1), rnorm(20, 3, 1),
+        rnorm(100,0, 1)) 
> BAF <- c(rnorm(100, 0.5, 0.1), rnorm(5, 0.2, 0.01), rnorm(5, 0.8, 0.01), rnorm(10, 0.25, 0.1), rnorm(10, 0.75, 0.1),
+        rnorm(100,0.5, 0.1)) 
> 
> Pos <- sample(x=1:500, size=230, replace=TRUE)
> Pos <- cumsum(Pos)
> Chrom <- rep(1, length(LRR))
> z <- data.frame(Name=1:length(LRR), Chrom=Chrom, Pos=Pos, LRR=LRR, BAF=BAF)
> res <- correctCopyNumber(arr="Sample1", chr=1, p=0.75, z=z)

...Segmenting Sample...
Analyzing: Sample1 

...Estimating BAF...

...Correcting for cellularity...
> 
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>