API#
Datasets#
Dataset from Weinreb et al. [PMID: 31974159] with in vitro hematopoiesis. |
|
Dataset from [PMID: 40502176] with clonal atlas of murine development. |
|
Dataset from Liu et al. [PMID: 35121991] with CD8 T cells from NSCLC. |
Preprocessing#
Creates a clone-level AnnData object from a cell-level AnnData object. |
|
Prepares a clone2vec-friendly AnnData object by handling multiple clonal labels per cell. |
|
Create a new annotated data matrix at the clone level with updated cell type proportions. |
|
Transfer clonal labels from a clones AnnData object to a adata AnnData object, or otherwise. |
|
Summarize gene expression at the clone level using a specified strategy (sum or average). |
Tools#
Computes and adds a clone-to-clone adjacency graph to a clones object. |
|
Performing ClonoCluster [PMID: 36819662] algorithm for lineage-informed gene expression clustering. |
|
Performing kNN smoothing on adata.X, adata.layers[layer], adata.obs[name], or adata.obsm[name] for n_steps iterations using adata.obsp[graph_key]. |
|
Computes connectivities (number of observed over the number of expected edges) of groups based on the graph. |
Embeddings#
Learn a clonal embedding using Skip-Gram and store the embeddings. |
|
Learn a clonal embedding using fastglmpca [PMID: 39110511] Python implementation and store the embeddings. |
|
Fitting of new clones to the reference clone2vec embeddings using kNN between query and reference datasets. |
|
Fitting of new clones to the reference clone2vec Poisson embeddings using kNN between query and reference datasets. |
|
Find anchors between batches in clones.obs[batch_key] using MNNs using clones.obsm[use_rep]. |
|
Align clones.obsm[use_rep] using MNNs found in clones.uns[uns_key] via procrustes alignment (PA). |
Associations#
Calculate correlation between features in adata and a response variable. |
|
Computes the supervised principal components analysis (sPCA) of the data [10.1016/j.patcog.2010.12.015]. |
|
Performs Johnstone’s Spiked Covariance Test to identify if the embedding is random. |
|
Performs CatBoost regression or classification on the data aiming to identify associations between the features and the response variable. |
Utils#
Function stacks layers of an AnnData object into a single layer in adata.X. |
|
Correct SHAP values by dividing by the maximum absolute value of SHAP values for each feature. |
|
Creates a graph of connected clones based on a grouping variable. |
|
Get group connectivity matrix from adata.uns[uns_key]. |
|
Performs expression regression on categorical variables in obs_key. |
|
Impute missing values in an observation column using k-nearest neighbors. |
|
Function to perform geometric sketching on an AnnData object. |
|
Compute Laplacian eigenmaps from a sparse graph stored in |
Plotting#
Plots the spatial distribution of a single clone on a 2D embedding. |
|
Plots kernel density estimates (KDE) of cells from one or multiple groups on a 2D embedding. |
|
Plot the mean loss per epoch and its change across epochs during clone2vec training. |
|
Plot basic statistics of clone size distribution. |
|
Plot ternary composition of clones labeled by two different injections. |
|
Draw a volcano using provided p-values and logFCs. |
|
Draws volcano-like plot showing the result of the associations analysis with CatBoost and SHAP. |
|
Draws barplot colored by the value in each bar. |
|
Draws pretty heatmap. |
|
Draws barplot of SHAP values for two groups. |
|
Compares predicted by CatBoost and observed values. |
|
Draws two interactive sctterplots with gene expression (left) and clonal (right) embeddings. |
|
Draws graph on top of the embedding. |
|
Plot group connectivity on top of the embedding. |
|
Plot PCA loadings for a given component. |
|
Function plots dotplot colored by scaled expression values. |
|
Plots embedding colored by two continious variables. |
|
Adds two perpendicular arrows (L-shape) to the bottom-left corner of the plot to mimic standard single-cell embedding visualizations (Seurat/Scanpy). |
|
Adds small colorbars to the right of the specified axes. |
|
Adds a legend to the plot with cluster labels aligned to the cluster centers. |
Seurat#
Reads .rds-file or .qsave-file with Seurat object and returns AnnData or MuData object. |
|
Performs single-cell data integration via Seurat's CCA or RPCA approach. |