Subset a GeneSetDb to only include geneSets with specified features.

subsetByFeatures(x, features, value = c("feature_id", "x.id", "x.idx"), ...)

# S4 method for GeneSetDb
subsetByFeatures(x, features, value = c("feature_id", "x.id", "x.idx"), ...)

Arguments

x

GeneSetDb

features

Character vector of featureIds

value

are you feature id's entered as themselves (feature_id), which is the default, or are you querying by their index into a target expression object? This is only relevant if you are working with a conform-ed GeneSetDb, and further you as a user won't likely invoke this argument, but is used internally.

...

pass through arguments

Value

A subset of x which contains only the geneSets that contain features found in featureIds

Methods (by class)

  • subsetByFeatures(GeneSetDb): subset GeneSetDb by feature id's

Examples

gdb <- exampleGeneSetDb()
features <- c("55839", "8522", "29087")
(gdb.sub <- subsetByFeatures(gdb, features))
#> ===============================================================================
#> GeneSetDb with 5 defined genesets across 3 collections (0 gene sets are active)
#>   Conformed: no
#> -------------------------------------------------------------------------------
#> Key: <collection, name>
#>    collection                                   name active     N     n
#>        <char>                                 <char> <lgcl> <int> <int>
#> 1:         c2    MOREAUX_MULTIPLE_MYELOMA_BY_TACI_DN  FALSE   172    NA
#> 2:         c2 SOTIRIOU_BREAST_CANCER_GRADE_1_VS_3_UP  FALSE   151    NA
#> 3:         c6                         MEL18_DN.V1_DN  FALSE   148    NA
#> 4:         c7       GSE14000_UNSTIM_VS_16H_LPS_DC_UP  FALSE   200    NA
#> 5:         c7                 GSE14308_TH2_VS_TH1_UP  FALSE   199    NA
#> -------------------------------------------------------------------------------
#> GeneSetDb with 5 defined genesets across 3 collections (0 gene sets are active)
#>   Conformed: no
#> ===============================================================================