As awesome as a GeneSetDb is, you might find a time when you'll need your gene set information in an other format. To do that, we provide the following functions:

  • as.data.frame(gdb): Perhaps the most natural format to convert to in order to save locally and examine outside of Bioconductor's GSEA universe, but not many other tools accept gene set definitions in this format.

  • as.list(gdb): A named list of feature identifiers. This is the format that many of the limma gene set testing methods use

  • as(gdb, "GeneSetCollection"): Convert to a GSEABase::GeneSetCollection() object.

# S3 method for GeneSetDb
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  value = c("feature_id", "x.id", "x.idx"),
  active.only = is.conformed(x),
  ...
)

# S3 method for GeneSetDb
as.list(
  x,
  value = c("feature_id", "x.id", "x.idx"),
  active.only = is.conformed(x),
  nested = FALSE,
  ...
)

Arguments

x

A GeneSetDb object

value

The value type to export for the feature ids

active.only

If the GeneSetDb is conformed, do you want to only return the features and genests that match target and are "active"?

...

nothing

Value

a converted GeneSetDb

Details

The as.* functions accept a value parameter which indicates the type of IDs you want to export in the conversion:

  • "feature_id": The ID used as originally entered into the GeneSetDb.

  • "x.idx": Only valid if the GeneSetDb x has been conform-ed to an expession container. This option will export the features as the integer rows of the expression container.

  • "x.id": Only valid if the GeneSetDb x has been conform-ed. The target expression container might use feature identifiers that are different than what is in the GeneSetDb. If an active featureMap is set on the GeneSetDb, this will convert the original feature identifiers into a different target space (entrez to ensembl, for instance). Using this option, the features will be provided in the target space.

Examples

es <- exampleExpressionSet() gdb <- conform(exampleGeneSetDb(), es) gdf <- as.data.frame(gdb) gdb <- conform(gdb, es) gdfi <- as.data.frame(gdb, value = 'x.idx') gdl <- as.list(gdb)