scanpy-GPU#

These functions offer accelerated near drop-in replacements for common tools provided by scanpy [WAT18].

Preprocessing pp#

Filtering of highly-variable genes, batch-effect correction, per-cell normalization.

Any transformation of the data matrix that is not a tool. Other than tools, preprocessing steps usually don’t return an easily interpretable annotation, but perform a basic transformation on the data matrix.

Basic Preprocessing#

pp.calculate_qc_metrics(adata, *[, ...])

Calculate basic quality-control metrics [MCLW17].

pp.filter_cells(data, *[, min_counts, ...])

Filter cell outliers based on counts and numbers of genes expressed.

pp.filter_genes(data, *[, min_counts, ...])

Filter genes based on number of cells or counts.

pp.normalize_total(adata, *[, target_sum, ...])

Normalizes rows in matrix so they sum to target_sum.

pp.normalize_shifted_clr(adata, *[, alpha, ...])

Normalize counts with the shifted centered log-ratio (PFlog) transform [BHGMP26].

pp.log1p(data, *[, base, use, out, layer, ...])

Logarithmize the data matrix.

pp.sqrt(data, *[, use, out, layer, obsm, ...])

Take the square root of the data matrix.

pp.highly_variable_genes(adata, *[, use, ...])

Annotate highly variable genes [AH19, LBK21, SFG+15, SBH+19, ZTB+17].

pp.regress_out(adata[, covariates, use, ...])

Use linear regression to adjust for the effects of unwanted noise and variation.

pp.scale(data, *[, zero_center, max_value, ...])

Scales matrix to unit variance and clips values

pp.pca(data[, n_comps, use, zero_center, ...])

Principal component analysis using GPU acceleration [HMT09, TQOA24].

pp.normalize_pearson_residuals(adata, *[, ...])

Applies analytic Pearson residual normalization [LBK21].

Batch effect correction#

pp.harmony_integrate(adata[, batch, use, ...])

Integrate different experiments using the Harmony algorithm [KMF+19, PYM+26].

Protein (ADT) normalization#

pp.dsb(adata[, adata_empty, ...])

Normalize and denoise protein (ADT) counts with dsb [MuleMT22].

Doublet detection#

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

Predict doublets using Scrublet [WLK19].

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

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

Neighbors#

pp.neighbors(adata[, n_neighbors, n_pcs, ...])

Compute a neighborhood graph of observations [ONN+24].

pp.bbknn(adata[, neighbors_within_batch, ...])

Batch balanced KNN [PYM+19].

pp.wnn(adata, use_rep[, n_pcs, n_neighbors, ...])

Weighted nearest neighbor (WNN) graph across modalities [HHAN+21].

Output types#

Functions with several outputs return a …Result if passed out=True, and take a …Out mapping as out to write each output to a place of choice.

pp.NeighborsResult

Outputs of neighbors() and bbknn().

pp.NeighborsOut

Where a mapping out of neighbors() writes each output.

pp.NormalizeTotalResult

Outputs of normalize_total().

pp.NormalizeTotalOut

Where a mapping out of normalize_total() writes each output.

pp.PcaResult

Outputs of pca().

pp.PcaOut

Where a mapping out of pca() writes each output.

pp.QcMetricsResult

Outputs of calculate_qc_metrics().

pp.QcMetricsOut

Where a mapping out of calculate_qc_metrics() writes each output.

pp.ScaleResult

Outputs of scale().

pp.ScaleOut

Where a mapping out of scale() writes each output.

pp.ScrubletResult

Outputs of scrublet().

pp.ScrubletOut

Where a mapping out of scrublet() writes each output.

pp.WnnResult

Outputs of wnn().

Tools: tl#

tools offers tools for the accelerated processing of AnnData. For visualization use scanpy.pl.

Embedding#

tl.umap(adata, *[, min_dist, spread, ...])

Embed the neighborhood graph using UMAP [MHM18] [NLR+21].

tl.tsne(adata[, n_pcs, use, perplexity, ...])

t-SNE [vdMH08] [CRHC18].

tl.diffmap(adata[, n_comps, sort, ...])

Diffusion Maps [CLL+05, HBT15].

tl.draw_graph(adata, *[, init_pos, ...])

Force-directed graph drawing [FR91, JVHB14].

tl.embedding_density(adata[, use, groupby, ...])

Calculate the density of cells in an embedding (per condition).

Data integration#

tl.ingest(adata, adata_ref, *[, obs, ...])

Map labels and embeddings from reference data to new data.

Clustering#

tl.leiden(adata[, resolution, rng, theta, ...])

Cluster cells into subgroups using the Leiden algorithm [TWvE19].

Gene scores, Cell cycle#

tl.score_genes(adata, gene_list, *[, ...])

Score a set of genes [SFG+15, TIP+16].

tl.score_genes_cell_cycle(adata, *, s_genes, ...)

Score cell cycle genes [SNS+15].

Marker genes#

tl.rank_genes_groups(adata, groupby, *[, ...])

Rank genes for characterizing groups using GPU acceleration.

Output types#

tl.CellCycleResult

Outputs of score_genes_cell_cycle().

tl.CellCycleOut

Where a mapping out of score_genes_cell_cycle() writes each output.

Plotting#

For plotting please use scanpy’s plotting API scanpy.pl.