External API


More tools that integrate well with scanpy and anndata can be found on the ecosystem page.

Import Scanpy’s wrappers to external tools as:

import scanpy.external as sce

If you’d like to include a tool here, consider making a pull request (instructions). If the tool already uses scanpy or anndata, it may fit better in the ecosystem page.

Preprocessing: PP

Data integration

pp.bbknn(adata[, batch_key, use_rep, ...])

Batch balanced kNN [Polanski19].

pp.harmony_integrate(adata, key[, basis, ...])

Use harmonypy [Korunsky19] to integrate different experiments.

pp.mnn_correct(*datas[, var_index, ...])

Correct batch effects by matching mutual nearest neighbors [Haghverdi18] [Kang18].

pp.scanorama_integrate(adata, key[, basis, ...])

Use Scanorama [Hie19] to integrate different experiments.

Sample demultiplexing, Doublet detection

pp.scrublet(adata[, adata_sim, batch_key, ...])

Predict doublets using Scrublet [Wolock19].

pp.scrublet_simulate_doublets(adata[, ...])

Simulate doublets by adding the counts of random observed transcriptome pairs.

pl.scrublet_score_distribution(adata[, ...])

Plot histogram of doublet scores for observed transcriptomes and simulated doublets.

pp.hashsolo(adata, cell_hashing_columns[, ...])

Probabilistic demultiplexing of cell hashing data using HashSolo [Bernstein20].


Note that the fundamental limitations of imputation are still under debate.

pp.dca(adata[, mode, ae_type, ...])

Deep count autoencoder [Eraslan18].

pp.magic(adata[, name_list, knn, decay, ...])

Markov Affinity-based Graph Imputation of Cells (MAGIC) API [vanDijk18].

Tools: TL


tl.phate(adata[, n_components, k, a, ...])

PHATE [Moon17].

tl.palantir(adata[, n_components, knn, ...])

Run Diffusion maps using the adaptive anisotropic kernel [Setty18].

tl.trimap(adata[, n_components, n_inliers, ...])

TriMap: Large-scale Dimensionality Reduction Using Triplets [Amid19].

tl.sam(adata[, max_iter, num_norm_avg, k, ...])

Self-Assembling Manifolds single-cell RNA sequencing analysis tool [Tarashansky19].

Clustering and trajectory inference

tl.phenograph(adata[, clustering_algo, k, ...])

PhenoGraph clustering [Levine15].

tl.harmony_timeseries(adata, tp[, ...])

Harmony time series for data visualization with augmented affinity matrix at discrete time points [Nowotschin18i].

tl.wishbone(adata, start_cell[, branch, k, ...])

Wishbone identifies bifurcating developmental trajectories from single-cell data [Setty16].

tl.palantir(adata[, n_components, knn, ...])

Run Diffusion maps using the adaptive anisotropic kernel [Setty18].

tl.palantir_results(adata, early_cell[, ...])

Running Palantir

Gene scores, Cell cycle

tl.sandbag(adata[, annotation, fraction, ...])

Calculate marker pairs of genes.

tl.cyclone(adata[, marker_pairs, ...])

Assigns scores and predicted class to observations [Scialdone15] [Fechtner18].

Plotting: PL

pl.phate(adata, *[, color, gene_symbols, ...])

Scatter plot in PHATE basis.

pl.trimap(adata, *[, color, gene_symbols, ...])

Scatter plot in TriMap basis.

pl.sam(adata[, projection, c, cmap, ...])

Scatter plot using the SAM projection or another input projection.

pl.wishbone_marker_trajectory(adata, markers)

Plot marker trends along trajectory, and return trajectory branches for further analysis and visualization (heatmap, etc..)


exporting.spring_project(adata, project_dir, ...)

Exports to a SPRING project directory [Weinreb17].

exporting.cellbrowser(adata, data_dir, data_name)

Export adata to a UCSC Cell Browser project directory.