getIncidenceMatrix: Making an incidence matrix for a gene set

getIncidenceMatrixR Documentation

Making an incidence matrix for a gene set

Description

An incidence matrix summarizes membership of gene identifiers in gene sets.

Usage

  
  getIncidenceMatrix(x, features)
  

Arguments

x

An object of class GeneSetCollection, DeconGeneSetCollection, or list, for which an incidence matrix will be produced.

features

A optional character vector providing set of features for which the incidence matrix will be produced. By default, the matrix will include one column for every gene in the collection.

Value

A matrix with as many rows as gene sets in the GeneSetCollection, and columns for genes. Each value will be 1 where a gene is in set, otherwise 0. By default, there will be as many columns as there are unique genes across all sets in the collection. The user may specify a set of features for which an incidence matrix will be made. In that case, there will be as many columns as there are provided features.

Author(s)

Jason A. Hackney

See Also

incidence

Examples

    gsc <- DeconGeneSetCollection()
    
    ### Make an incidence matrix for the gene sets
    incMat <- getIncidenceMatrix(gsc)
    
    ### Make an incidence matrix for the gene sets,
    ### explicitly calling out which features to use.
    ### This is identical to the previous incidence matrix.
    allGenes <- unlist(unique(geneIds(gsc)))
    incMat <- getIncidenceMatrix(gsc, features = allGenes)

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