extract | R Documentation |
Extract genes by row and cells by column.
## S4 method for signature 'CellRanger,ANY,ANY,ANY'
x[i, j, ..., drop = FALSE]
x |
Object. |
i |
Indices specifying elements to extract or replace. Indices are For more information: help(topic = "Extract", package = "base") |
j |
Indices specifying elements to extract or replace. Indices are For more information: help(topic = "Extract", package = "base") |
... |
Additional arguments. |
drop |
For matrices and arrays. If |
Refer to cellToSample()
and selectSamples()
if sample-level extraction is
desired. Note that sampleId
is slotted into colData()
and defines the
cell-to-sample mappings.
Unfiltered cellular barcode distributions for the entire dataset, including
cells not kept in the matrix will be dropped in favor of the nCount
column
of colData
.
CellRanger
.
Updated 2023-09-25.
Michael Steinbaugh
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
data(pbmc_v3)
## CellRanger ====
object <- pbmc_v3
cells <- head(colnames(object), 100L)
head(cells)
genes <- head(rownames(object), 100L)
head(genes)
## Subset by cell identifiers.
object[, cells]
## Subset by genes.
object[genes, ]
## Subset by both genes and cells.
object[genes, cells]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.