calmateByTotalAndFracB.array {calmate} | R Documentation |
Normalize allele-specific copy numbers (total,fracB)
Description
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.
Usage
## S3 method for class 'array'
calmateByTotalAndFracB(data, references=NULL, ..., refAvgFcn=NULL, verbose=FALSE)
Arguments
data |
An Jx2xI |
references |
A |
... |
Additional arguments passed to |
refAvgFcn |
(optional) A |
verbose |
See |
Value
Returns an Jx2xI numeric
array
with the same dimension names as argument data
.
References
[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].
See Also
To calibrate (thetaA,thetaB) or (CA,CB) signals,
see *calmateByThetaAB()
.
Examples
# 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);