Coder Social home page Coder Social logo

tuftsbcb / regdiffusion Goto Github PK

View Code? Open in Web Editor NEW
8.0 19.0 2.0 12.38 MB

Diffusion model for gene regulatory network inference.

Home Page: https://tuftsbcb.github.io/RegDiffusion/

License: Apache License 2.0

Python 76.28% Jupyter Notebook 23.72%
diffusion-models gene-regulatory-network grn single-cell

regdiffusion's Introduction

RegDiffusion logo

Downloads Downloads PyPI - Version

RegDiffusion is a very fast regulatory network inference algorithm based on probabilistic diffusion model. It works well on genes and is capable to rapidly (<5min) predict biologically verifiable links from large single cell RNA-seq data with 14,000+ genes.

From Noise to Knowledge: Probabilistic Diffusion-Based Neural Inference of Gene Regulatory Networks
Hao Zhu, Donna K. Slonim
bioRxiv 2023.11.05.565675; doi: https://doi.org/10.1101/2023.11.05.565675

Installation

RegDiffusion is on pypi.

pip install regdiffusion

Check out the this tutorial for a quick tour of how to use RegDiffusion for your research!

Quick Tour

This package regdiffusion provides the official implementation of the RegDiffusion algorithm and a set of easy-to-use companion tools to evaluate, analyze, and visualize the inferred network. We also provide access tools to GRN benchmarks and preprocessed single cell datasets for evaluation.

We tried to keep the top level interface straightforward. Right now, it only consists of 4 components: the RegDiffusionTrainer class, the GRN class, the GRNEvaluator class, and the data module.

  • RegDiffusionTrainer: You can use it to train a RegDiffusion model by providing log transformed expression data in a numpy array. The training process could be either started or continued using the .train() method. You can export the inferred GRN using the .get_grn() method.
  • GRN: The GRN class provides a container to save the inferred adjacency matrix and the corresponding gene names. You can save the GRN object to a local HDF5 file using the .to_hdf5() method and reload the saved file using the read_hdf5() function. It also comes with functionalities to export or visualize local regions. For example, you can use the .visualize_local_neighborhood() to generate a similar plot as used in the RegDiffusion paper. You can also extract the underlying adjacency list using the .extract_local_neighborhood() method.
  • GRNEvaluator: The ground truth of regulatory relationship often exist as list of edges but the values to be evaluated are often in adjacency matrix. The GRNEvaluator class is designed to fill the gap. Right now it supports common metrics such as AUROC, AUPR, AUPR Ratio, EP, and EPR.
  • data module: Right now, the data module includes quick access to BEELINE benchmarks and our preprocessed single cell datasets on mouse microglia.

Understanding the Inferred Networks

After the RegDiffusion model converges, what you get is simply an adjacency matrix. When you have thousands or tens of thousands of genes, it's getting difficult to analyze matrix at that scale. In our paper, we propose a way to analyze the local network by focusing on the genes you care the most. Check out the tutorials on the left side for how to perform a similar network analysis like the one we did in the paper. We are also working on an interactive tool to analyze saved GRN object.

Inference Speed

Inference on networks with 15,000 genes takes under 5 minutes on an A100 GPU. In contrast, previous VAE based models would take more than 4 hours on the same device. Even if you don't have access to those fancy GPU cards, RegDiffusion still works. Inference on the same large network takes roughly 3 hours on a mid-range 12-core CPU.

regdiffusion's People

Contributors

haozhu233 avatar joncrisx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

joncrisx

regdiffusion's Issues

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.