Gene sets inside a GeneSetDb() are indexed by their collection,name compound key. There is no special class to represent an individual gene set. Instead, gene sets are returned as a data.frame, the rows of which enumerate the features that belong to them.

When x is a SparrowResult(), this function will append the differential expression statistics for the individual features generated across the contrast that defined x.

geneSet(x, i, j, ...)

# S4 method for class 'GeneSetDb'
geneSet(
  x,
  i,
  j,
  active.only = is.conformed(x),
  with.feature.map = FALSE,
  ...,
  collection = NULL,
  name = NULL,
  as.dt = FALSE
)

# S4 method for class 'SparrowResult'
geneSet(
  x,
  i,
  j,
  active.only = TRUE,
  with.feature.map = FALSE,
  ...,
  collection = NULL,
  name = NULL,
  as.dt = FALSE
)

Arguments

x

Object to retrieve the gene set from, either a GeneSetDb or a SparrowResult.

i, j

The collection,name compound key identifier of the gene set

...

passed down to inner functinos

active.only

only look for gene sets that are "active"? Defaults to TRUE if x is conformed to a target expression object, else FALSE. conform() for further details.

with.feature.map

If TRUE, then details of the feature mapping from the original feature_id space to the target feature space are included (default: FALSE).

collection

using i as the parameter for "collection" isn't intuitive so if speficially set this paramter, it will replace the value for i.

name

the same for the collection:i parameter relationship, but for j:name.

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

Value

a data.(frame|table) of gene set information. If x is a SparrowResult object, then differential expression statistics are added as columns to this result.

Examples

gdb <- exampleGeneSetDb()
geneSet(gdb, "c2", "KOMMAGANI_TP63_GAMMA_TARGETS")
#>   collection                         name active N  n feature_id
#> 1         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       1026
#> 2         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA      10971
#> 3         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       3486
#> 4         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       3714
#> 5         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       4193
#> 6         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       4854
#> 7         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       6604
#> 8         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       7421
#> 9         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       9540
geneSet(gdb, collection = "c2", name = "KOMMAGANI_TP63_GAMMA_TARGETS")
#>   collection                         name active N  n feature_id
#> 1         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       1026
#> 2         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA      10971
#> 3         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       3486
#> 4         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       3714
#> 5         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       4193
#> 6         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       4854
#> 7         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       6604
#> 8         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       7421
#> 9         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       9540
geneSet(gdb, name = "KOMMAGANI_TP63_GAMMA_TARGETS")
#>   collection                         name active N  n feature_id
#> 1         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       1026
#> 2         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA      10971
#> 3         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       3486
#> 4         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       3714
#> 5         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       4193
#> 6         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       4854
#> 7         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       6604
#> 8         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       7421
#> 9         c2 KOMMAGANI_TP63_GAMMA_TARGETS  FALSE 9 NA       9540