subsample_by_ident,ClusterSet-method | R Documentation |
Given ncell, a target number, select ncell from each class of cell/column.
## S4 method for signature 'ClusterSet'
subsample_by_ident(object, ident = NULL, nbcell = TRUE, seed = 123)
object |
a ClusterSet object. |
ident |
A named vector. Names are cell/column names, values are classes/identity. Typically the result of the Seurat::Ident() function. |
nbcell |
The number of cell to select. |
seed |
A seed for subsampling. |
# Set verbosity to 1 to display info messages only.
set_verbosity(1)
# Load a dataset
load_example_dataset('7871581/files/pbmc3k_medium_clusters')
idents <- sample(1:10, size=ncol(pbmc3k_medium_clusters), rep=TRUE)
names(idents) <- col_names(pbmc3k_medium_clusters)
sub <- subsample_by_ident(pbmc3k_medium_clusters,
ident=idents,
nbcell=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.