runSVA | R Documentation |
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, n.sv, method = "leek")
dgeObj |
A DGEobj with normalized counts and a designMatrix. |
designMatrixName |
The itemName of the design matrix in DGEobj. |
n.sv |
Optional; Use to override the default n.sv returned by num.sv for the number of SV to analyze. |
method |
Method passed to num.sv. 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.