Git Product home page Git Product logo

branchedgp's Introduction

BranchedGP

BranchedGP is a package for building Branching Gaussian process models in python, using TensorFlow and GPFlow. The model is described in the paper

"BGP: Branched Gaussian processes for identifying gene-specific branching dynamics in single cell data", Alexis Boukouvalas, James Hensman, Magnus Rattray, bioRxiv, 2017..

This is now published in Genome Biology. Build Status codecov

Example

An example of what the model can provide is shown below.

  1. The posterior cell assignment is shown in top subpanel: each cell is assigned a probability of belonging to a branch.
  2. In the bottom subpanel the posterior branching time is shown: the probability of branching at a particular pseudotime.

Install

If you have any problems with installation see the script at the bottom of the page for a detailed setup guide from a new python environment.

  • Install tensorflow
pip install tensorflow
  • Install GPflow
git clone https://github.com/GPflow/GPflow.git
cd GPflow    
pip install .
cd

See GPFlow page for more detailed instructions.

  • Install Branched GP package
git clone https://github.com/ManchesterBioinference/BranchedGP
cd BranchedGP
python setup.py install
cd

Quick start

For a quick introduction see the notebooks/Hematopoiesis.ipynb notebook. Therein we demonstrate how to fit the model and compute the log Bayes factor for two genes.

The Bayes factor in particular is calculated by calling CalculateBranchingEvidence after fitting the model using FitModel.

This notebook should take a total of 6 minutes to run.

Tests

To run the tests should takes < 3min.

pip install nose
pip install nose-timer
cd BranchedGP/testing
nosetests --pdb-failures --pdb --with-timer

List of notebooks

To run the notebooks

cd BranchedGP/notebooks
jupyter notebook
File
name
Description
Hematopoiesis Application of BGP to hematopoiesis data.
SyntheticData Application of BGP to synthetic data.
SamplingFromTheModel Sampling from the BGP model.

Comparison to monocle-BEAM

In the paper we compare the BGP model to the BEAM method proposed in monocle 2. In monocle/runMonocle.R the R script for performing Monocle and BEAM on the hematopoiesis data is included.

List of python library files

File
name
Description
FitBranchingModel.py Main file for user to call BGP fit, see function FitModel
pZ_construction_singleBP.py Construct prior on assignments; use by variational code.
assigngp_dense.py Variational inference code to infer function labels.
assigngp_denseSparse.py Sparse inducing point variational inference code to infer function labels.
branch_kernParamGPflow.py Branching kernels. Includes independent kernel as used in the overlapping mixture of GPs and a hardcoded branch kernel for testing.
BranchingTree.py Code to generate branching tree.
VBHelperFunctions.py Plotting code.

Running in a cluster

When running BranchingGP in a cluster it may be useful to constrain the number of cores used. To do this insert this code at the beginning of your script.

from gpflow import settings
settings.session.intra_op_parallelism_threads = NUMCORES
settings.session.inter_op_parallelism_threads = NUMCORES

branchedgp's People

Contributors

alexisboukouvalas avatar jameshensman avatar

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.