API#

Metrics#

Import as:

import scib_rapids
scib_rapids.ilisi_knn(...)

isolated_labels(X, labels, batch[, rescale, ...])

Isolated label score.

nmi_ari_cluster_labels_kmeans(X, labels)

Compute NMI and ARI between k-means clusters and labels.

nmi_ari_cluster_labels_leiden(X, labels[, ...])

Compute NMI and ARI between leiden clusters and labels.

pcr_comparison(X_pre, X_post, covariate[, scale])

Principal component regression (PCR) comparison.

silhouette_label(X, labels[, rescale, ...])

Average silhouette width (ASW).

silhouette_batch(X, labels, batch[, ...])

Average silhouette width (ASW) with respect to batch ids within each label.

bras(X, labels, batch[, chunk_size, metric, ...])

Batch removal adapted silhouette (BRAS).

ilisi_knn(X, batches[, perplexity, scale])

Compute the integration LISI (iLISI).

clisi_knn(X, labels[, perplexity, scale])

Compute the cell-type LISI (cLISI).

kbet(X, batches[, alpha])

Compute kBET.

kbet_per_label(X, batches, labels[, alpha, ...])

Compute kBET score per cell type label.

graph_connectivity(X, labels)

Quantify the connectivity of the subgraph per cell type label.

Utils#

utils.cdist(x, y[, metric])

CuPy implementation of pairwise distance computation.

utils.pdist_squareform(X)

CuPy implementation of pairwise euclidean distance matrix.

utils.silhouette_samples(X, labels[, ...])

Compute the Silhouette Coefficient for each observation using CuPy.

utils.KMeans([n_clusters, init, n_init, ...])

CuPy/RAPIDS implementation of KMeans clustering.

utils.pca(X[, n_components, return_svd])

Principal component analysis (PCA) using CuPy.

utils.principal_component_regression(X, ...)

Principal component regression (PCR) using CuPy.

utils.one_hot(y[, n_classes])

One-hot encode an array.

utils.compute_simpson_index(knn_dists, ...)

Compute the Simpson index for each cell using a fused CUDA kernel.

utils.convert_knn_graph_to_idx(X)

Convert a kNN graph to indices and distances.

utils.check_square(X)

Check if a matrix is square.

utils.diffusion_nn(X, k[, n_comps])

Diffusion-based neighbors.

Nearest neighbors#

nearest_neighbors.pynndescent(X, n_neighbors)

Run pynndescent approximate nearest neighbor search.

nearest_neighbors.NeighborsResults(indices, ...)

Nearest neighbors results data store.