Coder Social home page Coder Social logo

velocytoanalysis's Introduction

RNA_ODE

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.

Installation

Option 1: Install through PyPI.

pip install VelocytoAnalysis

Option 2: Install through Github.

sudo pip install git+git://github.com/RuishanLiu/VelocytoAnalysis.git#egg=VelocytoAnalysis

Option 3: Download repository and then install manually.

cd VelocytoAnalysis/
python setup.py install --user

Import

from VelocytoAnalysis import RNA_ODE

Basic Usage

Given 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)

Optional Parameters

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)

velocytoanalysis's People

Contributors

ruishanliu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jingli1902

velocytoanalysis's Issues

Availability synthetic data

You write in the paper "The synthetic data are available at the code GitHub directory." Where can I find it here?

"ModuleNotFoundError" when importing package

I unfortunately get an ModuleNotFoundError when importing VelocytoAnalysis with from VelocytoAnalysis import RNA_ODE. (Reproducible on MacOS and Ubuntu.)

The full output is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "___.local/lib/python3.8/site-packages/VelocytoAnalysis/__init__.py", line 1, in <module>
    from .GRN import *
  File "___/.local/lib/python3.8/site-packages/VelocytoAnalysis/GRN.py", line 8, in <module>
    from sklearn.tree.tree import BaseDecisionTree
ModuleNotFoundError: No module named 'sklearn.tree.tree'

Did you intend to import sklearn.tree instead of sklearn.tree.tree?

Thanks for providing the source code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.