R/AllGenerics.R
, R/GeneSetDb-methods.R
, R/SparrowResult-methods.R
featureIds.Rd
Gene sets are defined by the unique compound key consisting of their
collection
and name
. To fetch the featureIds associated with
a specific geneset, you must provide values for i
and j
. If
these are missing, then a character vector of all the unique feature ids
within x
are returned.
If the GeneSetDb x
has been conformed to an expression object this
will default to return only the feature_id's that are matched to the target
expression object, and they will be returned using the same identifiers that
the target expression object uses. To change this behavior, tweak the values
for the active.only
and value
parameters, respectively.
x
can be either a GeneSetDb
or a SparrowResult
. If its the latter,
then this call simply delegates to the internal GeneSetDb
.
featureIds(
x,
i,
j,
value = c("feature_id", "x.id", "x.idx"),
active.only = is.conformed(x),
...
)
# S4 method for class 'GeneSetDb'
featureIds(
x,
i,
j,
value = c("feature_id", "x.id", "x.idx"),
active.only = is.conformed(x),
...
)
# S4 method for class 'SparrowResult'
featureIds(
x,
i,
j,
value = c("feature_id", "x.id", "x.idx"),
active.only = TRUE,
...
)
Object to retrieve the gene set from, either a GeneSetDb
or a
SparrowResult
.
The collection,name compound key identifier of the gene set
What form do you want the id's in?
"feature_id"
: the IDs used in the original geneset definitions
"x.id"
: the ids of the features as they are used in the expression
object.
"x.idx"
: The integer index into the expresion object x
that the
`GeneSetDb“ has been conformed to.
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.
pass through arguments
A vector of identifiers (or indexes into an expression object,
depending on the value
argument) for the features in the specified
geneset. NA
is returned if the geneset is not "active" (ie. listed in
geneSets()
)
gdb <- exampleGeneSetDb()
fids.gs <- featureIds(gdb, 'c2', 'BIOCARTA_AGPCR_PATHWAY')
fids.c2 <- featureIds(gdb, 'c2')
fids.all <- featureIds(gdb)
vm <- exampleExpressionSet(do.voom=TRUE)
gdb <- conform(gdb, vm)
## fewer than before
fids.gs2 <- featureIds(gdb, 'c2', 'BIOCARTA_AGPCR_PATHWAY')
## same as before
fids.gs3 <- featureIds(gdb, 'c2', 'BIOCARTA_AGPCR_PATHWAY', active.only=FALSE)
## returned as row indices into vm
fids.idxs <- featureIds(gdb, 'c2', value='x.idx')