deconComponents: Deriving an eigengene for a gene set given a gene expression...

deconComponentsR Documentation

Deriving an eigengene for a gene set given a gene expression matrix

Description

This is the main function used by the decon method to estimate relative cellularity. In general, this function is not meant to be called directly.

Usage

    deconComponents(object, geneSet, nComp = 1, 
        method = c("SVD", "NMF", "ICA", "MDS"))

Arguments

object

An object of class matrix, ExpressionSet, or EList, specifying the sample expression values. For matrix objects, each column should represent a sample, each row a feature.

geneSet

An object of class GeneSet, character, numeric. character values are assumed to be valid rownames of the expression matrix, as are geneIds of a GeneSet. Numeric values should be as long as the number of rows in the expression matrix, with a 1 where the gene is present in the gene set, otherwise 0. If it's NULL or missing, then all rows of the expression matrix will be used.

nComp

Numeric of length 1, specifying how many components to calculate for the matrix. See details for discussion of how components are calculated.

method

Method used to estimate eigengenes. At present only "SVD" is supported. Other methods should only be used for testing purposes.

Details

This function calculates the gene set-wise relative expression values for the expression data found in object. This is typically used as a helper function for the decon function, which calls this on a per-gene set basis.

Expression summaries are calculated as follows. First, genes are standardized to have zero mean and unit standard deviation, retaining the values used to center and scale the data. The singular value decomposition (svd) of the matrix is then calculated. For each component that is requested (1:nComp), all other eigenvalues in the d matrix of the svd is set to 0, and the svd matrices are multiplied to yield a normalized expression matrix. The values in the normalized expression matrix are then decentered and descaled using the values from the original expression matrix. The relative expression values for the component is the per-sample mean of this matrix.

Value

A matrix with as many rows as there are samples in object, and as many columns as specified by nComp. NOTE: Dimensions are not dropped, even when only a single component is returned.

Author(s)

J.A. Hackney

See Also

svd, decon

Examples

    ## Not run: 
        library(GEOquery)
        library(hgu133plus2.db)
        
        ### Get tissue/cell specific gene sets
        deconGSC <- DeconGeneSetCollection()
        
        ### Load a dataset of mixed immune cell lines
        GSE11058 <- getGEO("GSE11058")[[1]]
        exprs(GSE11058) <- log2(exprs(GSE11058))
        annotation(GSE11058) <- "hgu133plus2"
        
        ### Map identifiers
        deconU133GSC <- mapIdentifiers(deconGSC, AnnotationIdentifier(),
            revmap(hgu133plus2ENTREZID))
        
        ### Just get the estimates for a single gene set, with none of the 
        ### bells and whistles of the decon function.
        tcellEigengene <- deconComponents(GSE11058, deconU133GSC[["T"]])
    
## End(Not run)

JasonHackney/GSDecon documentation built on Aug. 6, 2022, 8:36 a.m.