doSVA | R Documentation |
Perform surrogate variable analysis (SVA) to an EdgeObject object
doSVA(edgeObj, transform = c("voom", "cpm"))
edgeObj |
An |
transform |
Function name to perform transformation, currently supported values include voom and cpm The count data associated with the EdgeObject object is first transformed, and surrogate variables are estimated from the transformed data. Correspondingly the design matrix and contrast matrix associated with the object are updated, too. |
set.seed(1887)
exMat <- matrix(rpois(12000, 10), nrow=2000, ncol=6)
exMat[1:100,2:3] <- exMat[1:100, 2:3]+20
exGroups <- gl(2,3, labels=c("Group1", "Group2"))
exDesign <- model.matrix(~exGroups)
exContrast <- matrix(c(-1,1), ncol=1,
dimnames=list(c("Group1", "Group2"), c("Group2.vs.Group1")))
exDescon <- DesignContrast(exDesign, exContrast, groups=exGroups)
exFdata <- data.frame(GeneSymbol=sprintf("Gene%d", 1:nrow(exMat)))
exPdata <- data.frame(Name=sprintf("Sample%d", 1:ncol(exMat)),
Group=exGroups)
exObj <- EdgeObject(exMat, exDescon,
fData=exFdata, pData=exPdata)
exSVAobj <- doSVA(exObj, transform="voom")
designMatrix(exSVAobj)
contrastMatrix(exSVAobj)
## Note that the SVA is sensitive against parameterisation, see
## the example below. Also notice that in the zero-intercept parameterisation,
## the SVA does not give meaningful results.
designMatrix(exObj) <- model.matrix(~0+exGroups)
designMatrix(doSVA(exObj, transform="voom"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.