API¶
Pegasus can also be used as a python package. Import pegasus by:
import pegasus as pg
Analysis Tools¶
Read and Write¶
|
Load data into memory. |
|
Write data back to disk. |
|
Aggregate channel-specific count matrices into one big count matrix. |
Preprocess¶
|
Generate Quality Control (QC) metrics on the dataset. |
|
Calculate filtration stats on cell barcodes and genes, respectively. |
|
Filter data based on qc_metrics calculated in |
|
Normalization, and then apply natural logarithm to the data. |
|
Highly variable features (HVF) selection. |
|
Subset the features and store the resulting matrix in dense format in data.uns with ‘fmat_’ prefix. |
|
Perform Principle Component Analysis (PCA) to the data. |
Batch Correction¶
|
Set group attributes used in batch correction. |
|
Batch correction on data. |
|
Batch correction PCs using Harmony |
Nearest Neighbors¶
|
Compute k nearest neighbors and affinity matrix, which will be used for diffmap and graph-based community detection algorithms. |
|
Calculate the kBET metric of the data w.r.t. |
|
Calculate the kSIM metric of the data w.r.t. |
Diffusion Map¶
|
Calculate Diffusion Map. |
|
Reduce high-dimensional Diffusion Map matrix to 3-dimentional. |
|
Calculate Pseudotime based on Diffusion Map. |
|
Inference on path of a cluster. |
Cluster algorithms¶
|
Cluster the data using the chosen algorithm. |
|
Cluster the cells using Louvain algorithm. |
|
Cluster the data using Leiden algorithm. |
|
Cluster the data using Spectral Louvain algorithm. |
|
Cluster the data using Spectral Leiden algorithm. |
Visualization Algorithms¶
|
Calculate tSNE embedding using MulticoreTSNE_ package. |
|
Calculate FIt-SNE embedding using fitsne_ package. |
|
Calculate UMAP embedding using umap-learn_ package. |
|
Construct the Force-directed (FLE) graph using ForceAtlas2_ implementation, with Python wrapper as forceatlas2-python_. |
|
Calculate approximated tSNE embedding using Deep Learning model to improve the speed. |
|
Calculate approximated FI-tSNE embedding using Deep Learning model to improve the speed. |
|
Calculate approximated UMAP embedding using Deep Learning model to improve the speed. |
|
Construct the approximated Force-directed (FLE) graph using Deep Learning model to improve the speed. |
Differential Expression Analysis¶
|
Perform Differential Expression (DE) Analysis on data. |
|
|
|
Write results into Excel workbook. |
Marker Detection based on Gradient Boost Machine¶
|
Find markers using gradient boosting method. |
Annotate clusters:¶
|
Infer putative cell types for each cluster using legacy markers. |
|
Add annotation to AnnData obj. |
Plotting¶
Interactive Plots¶
|
Generate an embedding plot. |
|
Generate a composition plot, which shows the percentage of observations from every condition within each cluster (by). |
|
Generate a variable feature plot. |
|
Generate a heatmap. |
|
Generate a dot plot. |
Quality Control Plots¶
|
Generate a violin plot. |
|
Generate a scatter plot. |
|
Generate a scatter plot matrix. |
Demultiplexing¶
|
For cell-hashing data, estimate antibody background probability using EM algorithm. |
|
Demultiplexing cell-hashing data, using the estimated antibody background probability calculated in |
Miscellaneous¶
|
Calculate signature / gene module score. |
|
Extract and display gene expressions for each cluster from an anndata object. |
|
Extract and display differential expression analysis results of markers for each cluster. |