Analysis#

SingleCell.qc_metrics

Adds quality-control metrics to obs for each cell: the sum of counts across all genes (num_counts), the number of genes with non-zero expression (num_genes), and the fraction of counts that are mitochondrial (mito_fraction).

SingleCell.qc

Adds a Boolean column to obs indicating which cells passed quality control (QC), or subsets to these cells if subset=True.

SingleCell.find_doublets

Find doublets using cxds (co-expression-based doublet scoring).

SingleCell.get_sample_covariates

Get a DataFrame of sample-level covariates, i.e. the columns of obs that are the same for all cells within each sample.

SingleCell.pseudobulk

Pseudobulk a SingleCell dataset with sample ID and cell type columns.

SingleCell.hvg

Select highly variable genes using the same approach as Seurat.

SingleCell.normalize

Normalize this SingleCell dataset's counts.

SingleCell.pca

Compute principal components (PCs) across cells.

SingleCell.neighbors

Calculate the num_neighbors nearest neighbors of each cell.

SingleCell.shared_neighbors

Calculate the shared nearest neighbor graph of this dataset's cells.

SingleCell.harmonize

Harmonize this SingleCell dataset with other datasets, or harmonize multiple batches of the same dataset, with Harmony2.

SingleCell.cluster

Cluster cells into cell types using Leiden clustering.

SingleCell.label_transfer_from

Transfer cell-type labels from another dataset to this one, using the two datasets' Harmony embeddings from harmonize().

SingleCell.umap

Calculate a two-dimensional embedding of this SingleCell dataset with UMAP (Uniform Manifold Approximation and Projection), suitable for plotting with plot_embedding().

SingleCell.pacmap

Calculate a two-dimensional embedding of this SingleCell dataset suitable for plotting with plot_embedding().

SingleCell.localmap

Calculate a two-dimensional embedding of this SingleCell dataset suitable for plotting with plot_embedding().

SingleCell.find_markers

Find "marker genes" that distinguish each cell type from all other cell types.

SingleCell.plot_heatmap

Plot a heatmap of the count of each combination of two categorical columns, x and y.

SingleCell.plot_markers

Make a dot plot of a set of marker genes of interest across cell types.

SingleCell.plot_umap

Plot a UMAP embedding created with umap().

SingleCell.plot_pacmap

Plot a PaCMAP embedding created with pacmap().

SingleCell.plot_localmap

Plot a LocalMAP embedding created with localmap().

SingleCell.plot_embedding

Plot the specified 2D embedding.