Skip to content

bobchen1701/pCreode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p-Creode

Build Status codecov PyPI version Downloads

Please let us know if you run into any issues or have any questions, through the issues page above or by email: [email protected].

The term creode was coined by C.H. Waddington, combining the Greek words for “necessary” and “path” to describe the cell state transitional trajectories that define cell fate specification. Our algorithm aims to identify consensus routes from relatively noisy single-cell data and thus we named this algorithm p- (putative) Creode. Conceptually, p-Creode determines the geometric shape of a collection of dense data points (i.e., a data cloud) in order to reveal the underlying structure of transitional routes. p-Creode is compatible with Python 2 (2.7) and Python 3 (3.7).

Tutorial files: Jupyter notebook

Example: Data file

Algorithm Overview

The p-Creode algorithm is composed of six distinct steps, as outlined in Figure 1 and the Method Details section of Unsupervised trajectory analysis of single-cell RNA-seq and imaging data reveals alternate tuft cell origins in the gut. p-Creode algorithm steps These six steps are as follows:

  1. Down-sampling (density-dependent down-sampling for rare and overrepresented cell state normalization)
  2. Graph construction (density based k-nearest neighbor)
  3. End-state identification (closeness centrality, derived from the k-nearest neighbor graph)
  4. Topology reconstruction using hierarchical placements (places data points on branches to allow the depiction of ancestral relationships)
  5. Consensus alignment (reassigns locations of path nodes in the topology to more accurately reflect paths observed in the data)
  6. Scoring (compares the constructed topologies based on dissimilarity to produce a p-Creode score)

Current p-Creode methodology entails running steps one through five 100 times and then running step 6 one time. Each of the six steps can be found within the functions.py file.

Installation for Linux (recommended)

  1. Install Anaconda

  2. Run the following in Terminal:

git clone git://github.com/KenLauLab/pCreode
cd pCreode
conda create -n pcreode python=3.7 numpy pandas matplotlib python-igraph jupyter cython -c conda-forge
conda activate pcreode
pip install .
pip install scanpy
  1. Verify everything works as expected by running the 'pCreode_tutorial.ipynb' file. The file should run without errors.

Installation for Mac

There are three ways to install p-Creode with Mac operating systems.

  1. Install from github
git clone git://github.com/KenLauLab/pCreode
cd pCreode
sudo pip install .

With this install, the jupyter notebook tutorial and the example scRNA-seq myeloid data set can be accessed in the notebook and data directories on your machine.

  1. Install from pip
sudo pip install pcreode

Then manually download the juypter notebook and example data file from the folders above. Simply right click on the download button and select "Save link as...".

Homebrew and anaconda install courtesy of Dan Skelly.

  1. Install through brew and github, and generate a contained conda environment for pcreode
brew install igraph
git clone git://github.com/KenLauLab/pCreode
cd pCreode
conda create -n pcreode python=3.7 numpy pandas matplotlib python-igraph jupyter cython
source activate pcreode
pip install .

Mac note:

For Mac users, Cairo may or may not be installed. If you have problems plotting, you need to install Cairo. Please follow the instructions in this link.

In addition, some Mac users have experienced issues installing igraph, here is a link to instructions for a direct install on a Mac

Installation for Windows

p-Creode is not supported on Windows.

Tutorial

Please note that our tutorial for pCreode requires Scanpy for its plotting and preprocessing steps. Scanpy, described by Wolf et al., 2018, is a python package for the organization and analysis of large scale scRNA-seq data. Scanpy documentation is available here. Install scanpy with the following command:

pip install scanpy

Once p-Creode is installed you can access the tutorial by command line (conda environment if using PC) with:

jupyter notebook

The downloaded p-Creode tutorial can be opened by using the jupyter interface to find the directory where it was saved. A brief introduction to jupyter notebook can be found here.

Python 2 support and tutorial

pCreode can be run in python 2 as well, please see the python 2 version of the tutorial and its example data file

About

An algorithm for mapping cell state transitions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 99.3%
  • Python 0.7%