1 of 26

Metabolic modeling of single Th17 cells reveals regulators of autoimmunity

August 5, 2021

Authors

Allon Wagner, Chao Wang, Johannes Fessler, ..., Aviv Regev, Vijay K. Kuchroo, Nir Yosef

--Cell

Wagner, Allon, et al. "Metabolic modeling of single Th17 cells reveals regulators of autoimmunity." Cell 184.16 (2021): 4168-4185.

2 of 26

To understand metabolic regulation in autoimmune disease

Compass

A Python‑based algorithm designed to model cellular metabolic heterogeneity using single‑cell RNA‑Seq data combined with flux balance analysis (FBA).

Compass

Mouse Th17 cells

Human Th17 cells

Gene expression matrix

primary input

Rows

Genes = [G6PD, ENO....]

Columns

Cells [cell1, cell2, ....]

Values

Expression levels [ TPM, Normalized counts]

.tsv

​

.mtx

​

.h5ad

3 of 26

.tsv format file overview

In scRNA-seq analysis, .tsv (tab-separated values) files are commonly used to store data, particularly for gene expression matrices, cell barcodes, and gene information.

4 of 26

.tsv format file overview

After opening a command line in a directory with an input file expression.tsv, you can run Compass on the data with the following command, which will limit the number of processes used to 10:

compass --data expression.tsv --num-processes 10 --species homo_sapiens

5 of 26

6 of 26

.mtx format file overview

In scRNA-seq data, the .mtx file, often in Matrix Market format, represents the count data as a sparse matrix. This format is used because scRNA-seq data matrices are typically very large and mostly contain zero values (sparse).

7 of 26

.mtx format file overview

To run Compass on mtx formatted data, use the following command:

compass --data-mtx expression.mtx genes.tsv sample_names.tsv --num-processes 10 --species homo_sapiens

8 of 26

.h5ad format file overview

    • .h5ad = Hierarchical Data Format (HDF5) + AnnData
    • Standard file format for single-cell data in Python (Scanpy).

https://cellgeni.readthedocs.io/en/latest/visualisations.html

X (red block):

The cells × genes expression matrix (usually sparse), storing raw or normalized data.

​

obs (orange):

Per-cell metadata (e.g., sample ID, cluster, cell‑type labels).

​

var (green):

Per-gene metadata (e.g., gene names, IDs, biotype).

​

obsm (blue):

Multi-dimensional cell-associated data (e.g., PCA or UMAP coordinates).

​

layers, uns, varm/obsp (purple):

Extra data such as raw counts, embeddings, graph structures, or plotting settings

​

    • compass --data anndata_object.h5ad --num-processes 10 --species homo_sapiens

9 of 26

.h5ad format file overview

https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE289733

10 of 26

.h5ad format file overview

11 of 26

conda install -c conda-forge numpy

conda install -c conda-forge scanpy

conda install -c conda-forge cobra

conda install -c conda-forge plotly

conda install -c conda-forge Pybrain

conda install -c conda-forge jupyterlab

conda install -c conda-forge scipy

conda install -c conda-forge anndata

conda install -c conda-forge optlang

conda install -c conda-forge tensorflow

conda install -c conda-forge Pydot

conda install -c conda-forge notebook

conda install -c conda-forge pandas

conda install -c conda-forge h5py

conda install -c conda-forge swiglpk

conda install -c conda-forge bokeh

conda install -c conda-forge Polars

conda install -c conda-forge ipykernel

conda install -c conda-forge tensorboard

conda install -c conda-forge scikit-learn

conda install -c conda-forge gurobi

conda install -c conda-forge matplotlib

conda install -c conda-forge Caffe

conda install -c conda-forge keras

conda install -c conda-forge theano

conda install -c conda-forge statsmodels

conda install -c conda-forge glpk

conda install -c conda-forge seaborn

conda install -c conda-forge StatsModel

conda install -c conda-forge openCV

Pre-requisites for running Compass --- Libraries

12 of 26

compass run \

--model path/to/Recon2.v04.mat \

--expression path/to/expression.tsv \

--output path/to/output_folder \

--threads 4

​

compass -h

pip install requirements.txt

python -m pip install git+https://github.com//Compass.git --upgrade

compass --set-license <PATH_TO_LICENSE>

run setup.py

13 of 26

14 of 26

15 of 26

this is a .py file named as setup.py and must be placed in the same directory as the .tsv file

now go to anaconda prompt and type

cd <PATH_TO_LICENSE>

<PATH_TO_LICENSE>

is the same place where you have placed your gurobi license

16 of 26

WLSACCESSID=203dec48-e3f8-46ac-0184-92d7d6ded944

WLSSECRET=a080cce8-4e01-4e36-955e-61592c5630db

LICENSEID=12127

​

Windows:

C:\gurobi and your home directory (C:\Users\yourusername)

​

Linux:

/opt/gurobi and your home directory (/home/yourusername)

​

17 of 26

18 of 26

    • Single-cell Compass score matrix from mouse Th17 cells (no pooling).
    • Each cell has one Compass score per reaction.
    • Used to assess metabolic programs at single-cell resolution.
    • Group comparisons (Th17n vs Th17p)

​

th17 (raw single-cell)

5

19 of 26

PCA (Fig. 2B)

th17 (raw single-cell) : used for ---

5

Volcano plots (Fig. 2C)

20 of 26

    • To reduce noise, cells are pooled in small transcriptomic groups (“micropools”).
    • Compass is rerun on the average expression per micropool.

​

​

​

th17_micropooled

5

21 of 26

th17_micropooled : used for ---

5

Violin plots (Fig. 2E)

22 of 26

    • Contains Compass scores computed over the entire Recon2 model using a complete expression dataset (not necessarily Th17).
    • Sometimes used as a reference or when exploring all metabolic reactions.

​

recon2

5

Possibly used for:

    • Validation
    • Comparative analysis
    • Visualization of full model reaction activity

​

23 of 26

recon2

5

24 of 26

recon2

5

25 of 26

26 of 26

Guided by

Dr. Payel Roy

2025 June 23

Thank you

for listening

Harshini Suresha