subsample_by_ident-ClusterSet-method: Given ncell, a target number, select ncell from each class of...

subsample_by_ident,ClusterSet-methodR Documentation

Given ncell, a target number, select ncell from each class of cell/column.

Description

Given ncell, a target number, select ncell from each class of cell/column.

Usage

## S4 method for signature 'ClusterSet'
subsample_by_ident(object, ident = NULL, nbcell = TRUE, seed = 123)

Arguments

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.

Examples

# 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)

dputhier/scigenex documentation built on Feb. 18, 2025, 2:27 p.m.