The model is described in the paper
This is now published in Genome Biology.
An example of what the model can provide is shown below.
- The posterior cell assignment is shown in top subpanel: each cell is assigned a probability of belonging to a branch.
- In the bottom subpanel the posterior branching time is shown: the probability of branching at a particular pseudotime.
For a quick introduction see the
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
after fitting the model using
This notebook should take a total of 6 minutes to run.
|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
|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.|
This project requires Python3.7 or earlier (TensorFlow 1 requirement).
Create a virtual environment, activate it and run
- Install dependencies (into an active virtual environment):
- Format code:
- Run a jupyter notebook server:
We welcome any and all contributions to the BranchedGP repo. Feel free to create issues or PRs into the repo and someone will take a look and review.
Note that Jupytext should be automatically installed in your virtual environment if you follow the instructions above.
Updating an existing notebook
We want our notebooks to always work. Therefore, before committing any changes to a notebook, we ask contributors to re-run the notebook from scratch.
The Jupytext extension should automatically sync the notebook
to the paired script.
If you're unsure, you can always check
and manually run
make sync_notebooks if needed.
Adding a new notebook
Follow your usual procedure, but run
make pair_notebooks afterwards.
This will produce the paired script
(or notebook if you're starting from a script).
Commit both the notebook as well as the paired notebook.
If Jupyter shows you a warning about the notebook being
out of sync with the master script, run
We automatically check that all contributions are formatted
according to the recommendations by
If your changes fail these checks, all you need to do is run
make format and commit the changes.