All Projects → calico → velodyn

calico / velodyn

Licence: Apache-2.0 License
Dynamical systems methods for RNA velocity analysis

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to velodyn

kana
Single cell analysis in the browser
Stars: ✭ 81 (+406.25%)
Mutual labels:  rna-seq, single-cell
alevin-fry
🐟 🔬🦀 alevin-fry is an efficient and flexible tool for processing single-cell sequencing data, currently focused on single-cell transcriptomics and feature barcoding.
Stars: ✭ 78 (+387.5%)
Mutual labels:  rna-seq, single-cell
NGS
Next-Gen Sequencing tools from the Horvath Lab
Stars: ✭ 30 (+87.5%)
Mutual labels:  rna-seq, single-cell
kallistobustools
kallisto | bustools workflow for pre-processing single-cell RNA-seq data
Stars: ✭ 79 (+393.75%)
Mutual labels:  rna-seq, single-cell
scCATCH
Automatic Annotation on Cell Types of Clusters from Single-Cell RNA Sequencing Data
Stars: ✭ 137 (+756.25%)
Mutual labels:  rna-seq, single-cell
iDEA
Differential expression (DE); gene set Enrichment Analysis (GSEA); single cell RNAseq studies (scRNAseq)
Stars: ✭ 23 (+43.75%)
Mutual labels:  rna-seq, single-cell
OrchestratingSingleCellAnalysis-release
An online companion to the OSCA manuscript demonstrating Bioconductor resources and workflows for single-cell RNA-seq analysis.
Stars: ✭ 35 (+118.75%)
Mutual labels:  rna-seq, single-cell
cellSNP
Pileup biallelic SNPs from single-cell and bulk RNA-seq data
Stars: ✭ 42 (+162.5%)
Mutual labels:  rna-seq, single-cell
EWCE
Expression Weighted Celltype Enrichment. See the package website for up-to-date instructions on usage.
Stars: ✭ 30 (+87.5%)
Mutual labels:  single-cell
sssMOR
sssMOR - Sparse State-Space and Model Order Reduction Toolbox
Stars: ✭ 20 (+25%)
Mutual labels:  dynamical-systems
MetaOmGraph
MetaOmGraph: a workbench for interactive exploratory data analysis of large expression datasets
Stars: ✭ 30 (+87.5%)
Mutual labels:  rna-seq
gene-oracle
Feature extraction algorithm for genomic data
Stars: ✭ 13 (-18.75%)
Mutual labels:  rna-seq
scarches
Reference mapping for single-cell genomics
Stars: ✭ 175 (+993.75%)
Mutual labels:  single-cell
tailseeker
Software for measuring poly(A) tail length and 3′-end modifications using a high-throughput sequencer
Stars: ✭ 17 (+6.25%)
Mutual labels:  rna-seq
netSmooth
netSmooth: A Network smoothing based method for Single Cell RNA-seq imputation
Stars: ✭ 23 (+43.75%)
Mutual labels:  single-cell
egtplot
egtplot: A python package for 3-Strategy Evolutionary Games
Stars: ✭ 33 (+106.25%)
Mutual labels:  dynamical-systems
switchde
Inference of switch-like differential expression along single-cell trajectories
Stars: ✭ 19 (+18.75%)
Mutual labels:  single-cell
mbsim
A multi-body simulation software
Stars: ✭ 22 (+37.5%)
Mutual labels:  dynamical-systems
dropClust
Version 2.1.0 released
Stars: ✭ 19 (+18.75%)
Mutual labels:  rna-seq
dbMAP
A fast, accurate, and modularized dimensionality reduction approach based on diffusion harmonics and graph layouts. Escalates to millions of samples on a personal laptop. Adds high-dimensional big data intrinsic structure to your clustering and data visualization workflow.
Stars: ✭ 39 (+143.75%)
Mutual labels:  single-cell

VeloDyn -- Quantitative analysis of RNA velocity

RNA velocity infers a rate of change for each transcript in an RNA-sequencing experiment based on the ratio of intronic to exonic reads. This inferred velocity vectors serves as a prediction for the future transcriptional state of a cell, while the current read counts serve as a measurement of the instantaneous state. Qualitative analysis of RNA velocity has been used to establish the order of gene expression states in a sequence, but quantitative analysis has generally been lacking.

velodyn adopts formalisms from dynamical systems to provide a quantitative framework for RNA velocity analysis. The tools provided by velodyn along with their associated usage are described below. All velodyn tools are designed to integrate with the scanpy ecosystem and anndata structures.

We have released velodyn in association with a recent paper. Please cite our paper if you find velodyn useful for your work.

Differentiation reveals latent features of aging and an energy barrier in murine myogenesis
Jacob C Kimmel, Nelda Yi, Margaret Roy, David G Hendrickson, David R Kelley
Cell Reports 2021, 35 (4); doi: https://doi.org/10.1016/j.celrep.2021.109046

BibTeX

@article{kimmel_latent_2021,
	title = {Differentiation reveals latent features of aging and an energy barrier in murine myogenesis},
	volume = {35},
	issn = {2211-1247},
	url = {https://www.cell.com/cell-reports/abstract/S2211-1247(21)00362-4},
	doi = {10.1016/j.celrep.2021.109046},
	language = {English},
	number = {4},
	urldate = {2021-05-19},
	journal = {Cell Reports},
	author = {Kimmel, Jacob C. and Yi, Nelda and Roy, Margaret and Hendrickson, David G. and Kelley, David R.},
	month = apr,
	year = {2021},
	pmid = {33910007},
	note = {Publisher: Elsevier},
	keywords = {aging, dynamical systems, fibro/adipogenic progenitor, muscle stem cell, myogenesis, RNA-seq, single cell, stem cell}
}

If you have any questions or comments, please feel free to email me.

Jacob C. Kimmel, PhD
[email protected]
Calico Life Sciences, LLC

Installation

git clone https://github.com/calico/velodyn
cd velodyn
pip install .

or

pip install velodyn

Tutorial

We have provided a velodyn tutorial using the Colab computing environment from Google. This notebook allows for execution of a velodyn workflow, end-to-end, all within your web browser.

velodyn tutorial

Gene expression state stability measurements

velodyn can provide a quantitative measure of gene expression state stability based on the divergence of the RNA velocity field. The divergence reflects the net flow of cells to a particular region of state space and is frequently used to characterize vector fields in physical systems. Divergence measures can reveal stable attractor states and unstable repulsor states in gene expression space. For example, we computed the divergence of gene expression states during myogenic differentiation and identified two attractor states, separated by a repulsor state. This repulsor state is unstable, suggesting it represents a decision point where cells decide to adopt one of the attractor states.

Divergence maps of myogenic differentiation. Two attractor states along a one-dimensional manifold are separated by a repulsor state in the center.

Usage

from velodyn.velocity_divergence import compute_div, plot_div

D = compute_div(
    adata=adata,
    use_rep='pca',
    n_grid_points=30,
)
print(D.shape) # (30, 30,)

fig, ax = plot_div(D)

State transition rate comparisons with phase simulations

Across experimental conditions, the rates of change in gene expression space may change significantly. However, it is difficult to determine where RNA velocity fields differ across conditions, and what impact any differences may have on the transit time between states. In dynamical systems, phase point analysis is used to quantify the integrated behavior of a vector field. For a review of phase point simulation methods, we highly recommend Nonlinear Dynamics & Chaos by Steven Strogatz.

In brief, a phase point simulation instantiates a particle ("phase point") at some position in a vector field. The position of the particle is updated ("evolved") over a number of timesteps using numerical methods.

For velodyn, we implement our update step using a stochastic weighted nearest neighbors model. We have a collection of observed cells and their associated velocity vectors as the source of our vector field. For each point at each timestep, we estimate the parameters of a Gaussian distribution of possible update steps based on the mean and variance of observed velocity vectors in neighboring cells. We then draw a sample from this distribution to update the position of the phase point. The stochastic nature of this evolution mirrors the stochastic nature of gene expression.

By applying phase point simulations to RNA velocity fields, velodyn allows for comparisons of state transition rates across experimental conditions. For example, we used phase point simulations to analyze the rate of myogenic differentiation in young and aged muscle stem cells. These analyses revealed that aged cells progress more slowly toward the differentiated state than their young counterparts.

Phase point simulations show the direction and rate of motion in an RNA velocity field.

Usage

from velodyn.velocity_dynsys import PhaseSimulation

simulator = PhaseSimulation(
    adata=adata,
)
# set the velocity basis to use
simulator.set_velocity_field(basis='pca')
# set starting locations for phase points
# using a categorical variable in `adata.obs`
simulator.set_starting_point(
    method='metadata', 
    groupby='starting_points',
    group='forward',
)
# run simulations using the stochastic kNN velocity estimator
trajectories = simulator.simulate_phase_points(
    n_points=n_points_to_simulate,
    n_timesteps=n_timesteps_to_simulate,
    velocity_method='knn',
    velocity_method_attrs={'vknn_method': 'stochastic'},          
    step_scale=float(step_scale),
    multiprocess=True, # use multiple cores
)

print(trajectories.shape)
# [
#     n_points_to_simulate, 
#     n_timesteps, 
#     n_embedding_dims, 
#     (position, velocity_mean, velocity_std),
# ]

Change in pseudotime predictions

Dynamic cell state transitions are often parameterized by a pseudotime curve, as introduced by Cole Trapnell in monocle. Given RNA velocity vectors and pseudotime coordinates, velodyn can predict a "change in pseudotime" for each individual cell. The procedure for predicting a change in pseudotime is fairly simple. velodyn trains a machine learning model to predict pseudotime coordinates from gene expression embedding coordinates (e.g. coordinates in principal component space). The future position of each cell in this embedding is computed as the current position shifted by the RNA velocity vector and a new pseudotime coordinate is predicted using the trained model. The "change in pseudotime" is then returned as the difference between the pseudotime coordinate for the predicted future point and the pseudotime coordinate for the observed point.

Change in pseudotime is predicted using a machine learning model for each cell.

Usage

from velodyn.velocity_dpst import dPseudotime

DPST = dPseudotime(
    adata=adata,
    use_rep='pca',
    pseudotime_var='dpt_pseudotime',
)
change_in_pseudotime = DPST.predict_dpst()

Velocity confidence intervals

RNA velocity estimates for each cell are incredibly useful, but there is no notion of variance inherent to the inference procedure. If we wish to make comparisons between cells that moving in different directions in gene expression space, we require confidence intervals on each cell's RNA velocity vector. velodyn introduces a molecular parameteric bootstrapping procedure to compute these confidence intervals. Briefly, we parameterize a multinomial distribution across genes using the mRNA profile for each cell. We then parameterize a second multinomial distribution for each gene in each cell based on the observed counts of spliced, unspliced, and ambiguous reads. We sample reads to the observed depth across genes, using the gene-level multinomial to distribute these reads as spliced, unspliced, or ambiguous observations and repeat this prodcued many times for each cell. We then compute RNA velocity vectors for each bootstrap sample and use these vectors to compute RNA velocity confidence intervals.

RNA velocity confidence intervals for each cell.

Usage

from velodyn.velocity_ci import VelocityCI

# initialize velocity CI
vci = VelocityCI(
    adata=adata,
)
# sample velocity vectors
# returns [n_iter, Cells, Genes]
velocity_bootstraps = vci.bootstrap_velocity(
    n_iter=n_iter,
    save_counts=out_path,
    embed=adata_embed, # experiment with genes of interest and relevant embedding
)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].