This function creates a geneset by feature table with geneset membership information for the features specified by the user. Only the gene sets that have any of the features are included in the table returned.

geneSetSummaryByGenes(
  x,
  features,
  with.features = TRUE,
  feature.rename = NULL,
  ...,
  as.dt = FALSE
)

# S4 method for class 'GeneSetDb'
geneSetSummaryByGenes(
  x,
  features,
  with.features = TRUE,
  feature.rename = NULL,
  ...,
  as.dt = FALSE
)

# S4 method for class 'SparrowResult'
geneSetSummaryByGenes(
  x,
  features,
  with.features = TRUE,
  feature.rename = NULL,
  method = NULL,
  max.p = 0.3,
  p.col = c("padj", "padj.by.collection", "pval"),
  ...,
  as.dt = FALSE
)

Arguments

x

GeneSetDb or SparrowResult

features

a character vector of featureIds

with.features

Include columns for features? If x is is a GeneSetDb, these columns are TRUE/FALSE. If x is a SparrowResult object, the values are the logFC of the feature if present in the gene set, otherwise its NA.

feature.rename

if NULL, the feature columns are prefixed with featureId_, if FALSE, no renaming is done. If x is a SparrowResult, then this can be the column name found in logFC(x), in which case the value for the feature from the given column name would be used (setting this to "symbol") would be a common thing to do, for instance.

...

pass through arguments

as.dt

If FALSE (default), the data.frame like thing that this funciton returns will be set to a data.frame. Set this to TRUE to keep this object as a data.table

method

The GSEA method to pull statistics from

max.p

the maximum p-value from the analysis method to allow for the geneSets included in the returned table

p.col

which p-value column to select from: 'padj', 'padj.by.collection', or 'pval'

Value

a data.frame of geneset <-> feature incidence/feature matrix.

Methods (by class)

  • geneSetSummaryByGenes(SparrowResult): get geneset:feature incidence table from a SparrowResult, optionally filtered by statistical significance from a given gsea method

Examples

vm <- exampleExpressionSet(do.voom=TRUE)
gdb <- conform(exampleGeneSetDb(), vm)
mg <- seas(vm, gdb, design = vm$design, contrast = 'tumor')
features <- c("55839", "8522", "29087")
gsm.hit <- geneSetSummaryByGenes(gdb, features)
gsm.fid <- geneSetSummaryByGenes(mg, features, feature.rename=NULL)
gsm.sym <- geneSetSummaryByGenes(mg, features, feature.rename='symbol')