Working paper. More background and information will be provided when the paper is ready.
This repository contains examples to use the library. See the python notebooks in the experiments folder.
Option 1: Install through PyPI.
pip install VelocytoAnalysisOption 2: Install through Github.
sudo pip install git+git://github.com/RuishanLiu/VelocytoAnalysis.git#egg=VelocytoAnalysisOption 3: Download repository and then install manually.
cd VelocytoAnalysis/
python setup.py install --userfrom VelocytoAnalysis import RNA_ODEGiven the static gene expression counts and RNA velocity velocity, we carry out several downstream single-cell analysis based on the ODE prediction. We recommend to use well annotated cellular states celltype for better performance.
from VelocytoAnalysis import RNA_ODE
rna_ode = RNA_ODE(counts, velocity, celltype)
# Fit model
model = rna_ode.build_model()
# Predict Future Expressions
path= rna_ode.ode_simulation()
# Compute Lineages
lineages = rna_ode.compute_lineages()
# Compute GRN
grn_scores = rna_ode.compute_grn_scores()Evaluation: If true lineages lineages_true or true GRN grn_true is known, we provide metric functions to evaluate the results of RNA_ODE
# Correctness of lineage
correctness = rna_ode.evaluate_lineage_correctness(lineages_true, lineages)
# AUROC of GRN
auroc = rna_ode.evaluate_grn_auroc(grn_true, grn_scores)Model: To build the model with function build_model, people can choose from three different model types (parameter model_name): linear regression 'linear', lasso regression 'lasso' and random forest regression 'rf'. Other parameters of the model can be set as shown here:
from VelocytoAnalysis import RNA_ODE
rna_ode = RNA_ODE(counts, velocity, celltype)
# Linear Regression
model = rna_ode.build_model(model_name='linear')
# Lasso Regression with the weight for the L1 regulation term = 1
model = rna_ode.build_model(model_name='lasso', lasso_alpha=1)
# Random Forest with 10 trees and max depth of 10
model = rna_ode.build_model(model_name='rf', n_estimators=10, max_depth=10)