| mergeBatches {casper} | R Documentation |
mergeBatches combines x and y into an
ExpressionSet,
performs quantile normalization and adjusts for batch effects by
subtracting the mean expression in each batch (and then adding the
grand mean so that the mean expression per gene is unaltered).
mergeBatches(x, y, mc.cores=1)
x |
|
y |
Either |
mc.cores |
Number of processors to be used (ignored when |
When y is an ExpressionSet, mergeBatches returns
an ExpressionSet with combined expressions.
Its featureData contains a variable "batch" indicating
the batch that each sample corresponded to.
When y is a simulatedSamples object, mergeBatches
is applied to combine x with each dataset in y and a
list of ExpressionSet objects is returned.
David Rossell
#Fake data from 2 batches
x <- matrix(rnorm(6),nrow=2)
colnames(x) <- paste('x',1:3,sep='')
y <- matrix(1+rnorm(6),nrow=2)
colnames(y) <- paste('y',1:3,sep='')
x <- new("ExpressionSet",exprs=x)
y <- new("ExpressionSet",exprs=y)
exprs(x)
exprs(y)
#Merge & adjust
z <- mergeBatches(x,y)
exprs(z)