calmateByTotalAndFracB.array | R Documentation |
Normalize allele-specific copy numbers (total,fracB), where total is the total (non-polymorphic) signal and
fracB is the allele B fraction.
It is only loci with a non-missing (NA
) fracB value that are
considered to be SNPs and normalized by CalMaTe. The other loci
are left untouched.
## S3 method for class 'array' calmateByTotalAndFracB(data, references=NULL, ..., refAvgFcn=NULL, verbose=FALSE)
data |
An Jx2xI |
references |
A |
... |
Additional arguments passed to |
refAvgFcn |
(optional) A |
verbose |
See |
Returns an Jx2xI numeric
array
with the same dimension names as argument data
.
[1] M. Ortiz-Estevez, A. Aramburu, H. Bengtsson, P. Neuvial and A. Rubio, CalMaTe: A method and software to improve allele-specific copy number of SNP arrays for downstream segmentation, Bioinformatics, 2012 [PMC3381965].
To calibrate (thetaA,thetaB) or (CA,CB) signals,
see *calmateByThetaAB()
.
# Load example (thetaA,thetaB) signals path <- system.file("exData", package="calmate"); theta <- loadObject("thetaAB,100x2x40.Rbin", path=path); # Transform to (total,fracB) signals data <- thetaAB2TotalAndFracB(theta); # Calibrate (total,fracB) by CalMaTe dataC <- calmateByTotalAndFracB(data); # Calculate copy-number ratios theta <- data[,"total",]; thetaR <- matrixStats::rowMedians(theta, na.rm=TRUE); data[,"total",] <- 2*theta/thetaR; # Plot two "random" arrays Clim <- c(0,4); Blim <- c(0,1); subplots(4, ncol=2, byrow=FALSE); for (ii in c(1,5)) { sampleName <- dimnames(data)[[3]][ii]; sampleLabel <- sprintf("Sample #%d ('%s')", ii, sampleName); plot(data[,,ii], xlim=Clim, ylim=Blim); title(main=sampleLabel); plot(dataC[,,ii], xlim=Clim, ylim=Blim); title(main=sprintf("%s\ncalibrated", sampleLabel)); } # Assert that it also works with a single unit dummy <- calmateByTotalAndFracB(data[1,,,drop=FALSE]); stopifnot(length(dim(dummy)) == 3);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.