subsetByFeatures {sparrow} | R Documentation

## Subset a GeneSetDb to only include geneSets with specified features.

### Description

Subset a GeneSetDb to only include geneSets with specified features.

### Usage

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

    ## S4 method for signature '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)

- `GeneSetDb`: subset GeneSetDb by feature id's

### Examples

    gdb <- exampleGeneSetDb()
    features <- c("55839", "8522", "29087")
    (gdb.sub <- subsetByFeatures(gdb, features))

[Package sparrow version 1.0.3 Index]