scvelo - RNA velocity generalized through dynamical modeling.
API¶
Import scVelo as:
import scvelo as scv
After reading the data (scv.read
) or loading an in-built dataset (scv.datasets.*
),
the typical workflow consists of subsequent calls of
preprocessing (scv.pp.*
), analysis tools (scv.tl.*
) and plotting (scv.pl.*
).
Further, several utilities (scv.utils.*
) are provided to facilitate data analysis.
Read / Load¶
|
Read file and return |
|
Read .loom-formatted hdf5 file. |
Preprocessing (pp)¶
Basic preprocessing (gene selection and normalization)
|
Filter genes based on number of cells or counts. |
|
Extract highly variable genes. |
|
Normalize each cell by total counts over all genes. |
|
Logarithmize the data matrix. |
|
Filtering, normalization and log transform. |
Moments (across nearest neighbors in PCA space)
|
Principal component analysis [Pedregosa11]. |
|
Compute a neighborhood graph of observations. |
|
Computes moments for velocity estimation. |
Tools (tl)¶
Clustering and embedding (more at scanpy-docs)
|
Cluster cells into subgroups [Blondel08] [Levine15] [Traag17]. |
|
Embed the neighborhood graph using UMAP [McInnes18]. |
Velocity estimation
|
Estimates velocities in a gene-specific manner. |
|
Computes velocity graph based on cosine similarities. |
|
Projects the single cell velocities into any embedding. |
Dynamical modeling
|
Recovers the full splicing kinetics of specified genes. |
|
Test to detect cell types / lineages with different kinetics. |
Dynamical genes
|
Rank genes for velocity characterizing groups. |
|
Rank genes by likelihoods per cluster/regime. |
Pseudotime and trajectory inference
|
Computes terminal states (root and end points). |
|
Computes a pseudotime based on the velocity graph. |
|
Computes a gene-shared latent time. |
|
PAGA graph with velocity-directed edges. |
Further tools
|
Computes velocity clusters via louvain on velocities. |
|
Computes confidences of velocities. |
|
Score cell cycle genes. |
Plotting (pl)¶
Base scatter plot
|
Scatter plot along observations or variables axes. |
Velocity embeddings
|
Scatter plot of velocities on the embedding. |
|
Scatter plot of velocities on a grid. |
|
Stream plot of velocities on the embedding. |
Velocity graph
|
Phase and velocity plot for set of genes. |
|
Plot of the velocity graph. |
|
Plot PAGA graph with velocity-directed edges. |
Further plotting
|
Plot pie chart of spliced/unspliced proprtions. |
|
Plot time series for genes as heatmap. |
|
Plot a histogram. |
Datasets¶
|
Pancreatic endocrinogenesis. |
|
Dentate Gyrus neurogenesis. |
|
Developing human forebrain. |
|
Dentate Gyrus neurogenesis. |
|
Mouse gastrulation. |
|
Mouse gastrulation subset to E7.5. |
|
Mouse gastrulation subset to erythroid lineage. |
|
Human bone marrow. |
|
Peripheral blood mononuclear cells. |
|
Simulation of mRNA splicing kinetics. |
Utils¶
Get data by key
|
Get dataframe for a specified adata key. |
Get gene info
|
Retrieve gene information from biothings client. |
Data preparation
|
Delete not needed attributes. |
|
Clean up the obs_names. |
|
Merge two annotated data matrices. |
|
Proportions of abundances of modalities in layers. |
Getters
|
Computes moments for a specified layer. |
|
Computes cell-to-cell transition probabilities. |
|
Simulate cell transitions. |
|
Get extrapolated cell state. |
Converters
|
Retrieve ensembl IDs from a list of gene names. |
|
Retrieve gene names from ensembl IDs. |
Least squares and correlation
|
Solves least squares X*b=Y for b. |
|
Pearsons/Spearmans correlation coefficients. |
|
Test for bimodal distribution. |
Settings¶
|
Set resolution/size, styling and format of figures. |