Go directly here →
for a short tutorial (~1 min).
This repository contains code for Archetypal Analysis of single-cell RNA-seq data as described in Xie et al. 2024, an application and extension of Pareto multi-tasking theory as described in Adler et al. 2019.
The code base is a wrapper and extension of the ulfaslak/py_pcha package that implements the PCHA algorithm.
Figure: Archetypal analysis of the transcriptomic continuum of L2/3 excitatory neurons (Xie et al. 2024).
SingleCellArchetype/
├── README.md
├── data/
│ └── data_snrna_v1.h5ad # sample data
└── sca/
├── utils.py # utility functions
├── sca.py # the SingleCellArchetype class
├── tutorial_complete.ipynb # a short tutorial (~1 min)
└── tutorial_minimum.ipynb # a long tutorial (~10 min)
Go directly here or
for a short tutorial. You can run through this example application of Archetypal Analysis in your web browser in ~1 minute. No need to set up anything else.
Alternatively, you can also check out this complete tutorial.
Step 1. Download the sample data here or with the following command.
wget 'https://raw.githubusercontent.com/FangmingXie/SingleCellArchetype/main/data/data_snrna_v1.h5ad'
Step 2. Install the packages
pip install anndata # prerequisite
pip install py_pcha # prerequisite
git clone git@github.com:FangmingXie/SingleCellArchetype.git # this repo
Step 3. follow through the following tutorials in your own jupyter notebook or jupyter lab.
sca/tutorial_minimum.ipynbsca/tutorial_complete.ipynb
- Fangming Xie, Saumya Jain, Runzhe Xu et al. 2024 bioRxiv "Spatial profiling of the interplay between cell type- and vision-dependent transcriptomic programs in the visual cortex" (link)
- Miri Adler et al 2019 Cell Reports "Emergence of division of labor in tissues through cell interactions and spatial cues" (link)
- The
py_pchapackage: https://github.com/ulfaslak/py_pcha