runSVA: Test for surrogate variables

View source: R/runSVA.R

runSVAR Documentation

Test for surrogate variables


Takes a DGEobj from runVoom and tests for surrogate variables. Adds a new design matrix to the DGEobj with the surrogate variable columns appended using cbind. runVoom should then be run again with the new design matrix to complete the analysis.


runSVA(dgeObj, designMatrixName,, method = "leek")



A DGEobj with normalized counts and a designMatrix.


The itemName of the design matrix in DGEobj.

Optional; Use to override the default returned by for the number of SV to analyze.


Method passed to Supports "leek" or "be". (Default = "leek")


dgeObj containing an updated design table, the svobj and a new design matrix.


## Not run: 
   # NOTE: Requires the sva package

    dgeObj <- readRDS(system.file("exampleObj.RDS", package = "DGEobj"))

    ###  Create a model based on surgery status, intentionally omitting the compound treatments
    dgeObj$design$SurgeryStatus <- "BDL"
    dgeObj$design$SurgeryStatus[dgeObj$design$ReplicateGroup == "Sham"] <- "Sham"
    formula <- '~ 0 + SurgeryStatus'
    designMatrix <- model.matrix (as.formula(formula), dgeObj$design)

    # Make sure the column names in the design matrix are legal
    colnames(designMatrix) <- make.names(colnames(designMatrix))

    #capture the formula as an attribute of the design matrix
    attr(designMatrix, "formula") <- formula

    #add the designMatrix to the DGEobj
    dgeObj <- DGEobj::addItem(dgeObj,
                              item      = designMatrix,
                              itemName  = "SurgeryStatusDesign",
                              itemType  = "designMatrix",
                              parent    = "design",
                              overwrite = TRUE)

    dgeObj <- runSVA(dgeObj, designMatrixName = "SurgeryStatusDesign")

## End(Not run)

DGEobj.utils documentation built on May 20, 2022, 1:08 a.m.