retrieveSCEIndex: Retrieve cell/feature index by giving identifiers saved in...

Description Usage Arguments Value Author(s) Examples

View source: R/miscFunctions.R

Description

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.

Usage

1
2
3
4
5
6
7
8
retrieveSCEIndex(
  inSCE,
  IDs,
  axis,
  by = NULL,
  exactMatch = TRUE,
  firstMatch = TRUE
)

Arguments

inSCE

Input SingleCellExperiment object. Required

IDs

Character vector of identifiers for features or cells to find in rowData or colData of inSCE

axis

A character scalar to specify whether to search for features or cells. Use "row", "feature" or "gene" for features; "col" or "cell" for cells.

by

Character. In which column to search for features/cells in rowData/colData. Default NULL for search the rownames/colnames

exactMatch

A logical scalar. Whether to only identify exact matches or to identify partial matches using grep. Default TRUE

firstMatch

A logical scalar. Whether to only identify the first matches or to return all plausible matches. Default TRUE

Value

A unique, non-NA numeric vector of indices for the matching features/cells in inSCE.

Author(s)

Yusuke Koga, Joshua Campbell

Examples

1
2
3
data(scExample, package = "singleCellTK")
retrieveSCEIndex(inSCE = sce, IDs = "ENSG00000205542",
 axis = "row")

singleCellTK documentation built on Nov. 8, 2020, 5:21 p.m.