Description Usage Arguments Value Author(s) See Also Examples
View source: R/mapCellsToSamples.R
This function extracts sampleID
from the cellID
column using grep
matching.
1 | mapCellsToSamples(cells, samples)
|
cells |
Cell identifiers. |
samples |
Sample identifiers. |
Named factor
containing cells as the names, and samples as the
factor levels.
Michael Steinbaugh
Other Data Functions: aggregateReplicates
,
cell2sample
, fetchGeneData
,
metricsPerSample
, sampleData
,
selectSamples
,
subsetPerSample
, topBarcodes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # bcbioSingleCell ====
object <- indrops_small
cells <- colnames(object)
glimpse(cells)
# Use the sample ID for the mappings, which must be present in the cell ID
sampleNames(object)
samples <- names(sampleNames(object))
# samples <- rownames(sampleData(object))
samples
# Sample ID must be the prefix of the cell IDs
stopifnot(all(grepl(paste0("^", samples[[1]]), cells)))
x <- mapCellsToSamples(cells = cells, samples = samples)
glimpse(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.