R/miscFunctions.R
retrieveSCEIndex.Rd
Originally written in retrieveFeatureIndex
.
Modified for also retrieving cell indices and only working for
SingleCellExperiment object. This will return indices of
features among the rowData
/colData
. Partial matching (i.e.
grepping) can be used.
retrieveSCEIndex(
inSCE,
IDs,
axis,
by = NULL,
exactMatch = TRUE,
firstMatch = TRUE
)
Input SingleCellExperiment object. Required
Character vector of identifiers for features or cells to find in
rowData
or colData
of inSCE
A character scalar to specify whether to search for features or
cells. Use "row"
, "feature"
or "gene"
for features;
"col"
or "cell"
for cells.
Character. In which column to search for features/cells in
rowData
/colData
. Default NULL
for search the
rownames
/colnames
A logical scalar. Whether to only identify exact matches
or to identify partial matches using grep
. Default TRUE
A logical scalar. Whether to only identify the first
matches or to return all plausible matches. Default TRUE
A unique, non-NA numeric vector of indices for the matching
features/cells in inSCE
.
data(scExample, package = "singleCellTK")
retrieveSCEIndex(inSCE = sce, IDs = "ENSG00000205542",
axis = "row")
#> [1] 2