This repository contains figure generation code for the manuscript "Simultaneous estimation of gene regulatory network structure and RNA kinetics from single cell gene expression".
Model code is in the supirfactor-dynamical package. Velocity and time inference code is in the inferelator-velocity package. Sequencing data is deposited in NCBI GEO under accession GSE242556.
This project is the analysis and plotting layer for the manuscript. It packages processed data, computes shared derived quantities such as projections and decay summaries, loads model outputs from external packages, and renders the main and supplemental figures.
The repository is organized around a small Python package, jtb_2023_code, plus checked-in figure assets and helper scripts.
/home/runner/work/jtb_2023_code/jtb_2023_code/jtb_2023_code: main Python packagegenerate_figures.py: top-level figure generation pipelinepreprocess.py: builds the processed shared dataset used by the figurespackage_data.py: exports a packagedAnnDataobject with counts, embeddings, velocities, and decay valuesfigure_1.pythroughfigure_6.py: main figure buildersfigure_*_supplemental.py: supplemental figure buildersfigure_constants.py: file paths, plotting constants, selected genes, and other central configurationutils/: shared data loading, plotting, projections, decay, pseudotime, and model helper codepseudotime/: wrappers for different pseudotime methodsold_data/: support for older published datasets used in later figures
/home/runner/work/jtb_2023_code/jtb_2023_code/Data: reference tables shipped with the repository/home/runner/work/jtb_2023_code/jtb_2023_code/Figures: rendered main and supplemental figure outputs/home/runner/work/jtb_2023_code/jtb_2023_code/Schematic: static schematic artwork used inside the figures/home/runner/work/jtb_2023_code/jtb_2023_code/scripts: standalone runners for pseudotime workflows
At a high level, the figure pipeline does the following:
- Loads single-cell expression data into a shared
FigureSingleCellDataobject. - Computes or loads PCA, UMAP, pseudotime, decay, and related derived data.
- Loads model outputs and predictions from external modeling packages.
- Builds the manuscript figures and writes them to the figure output directory.
The main orchestrator is jtb_2023_code/generate_figures.py, which preprocesses the dataset and then calls each figure module in sequence.
The package metadata is defined in /home/runner/work/jtb_2023_code/jtb_2023_code/setup.py.
Primary Python dependencies include:
numpyscipyscanpypandasjoblibanndatamatplotlibpydeseq2supirfactor-dynamicalinferelator-velocity
Install the repository in an environment that already has the scientific Python stack available:
pip install -e /home/runner/work/jtb_2023_code/jtb_2023_codeThe code expects several data, figure, scratch, schematic, and model paths. These defaults are defined in jtb_2023_code/figure_constants.py and jtb_2023_code/utils/figure_filenames.py.
Some defaults point to author-specific local or scratch locations, so running the pipeline in a new environment usually requires overriding paths on the command line. The path helper supports:
-dfor the data directory-ffor the figure directory-scratchfor scratch files-sfor the schematic directory-mfor the model directory
Examples of the main entry points:
python /home/runner/work/jtb_2023_code/jtb_2023_code/jtb_2023_code/preprocess.py \
-d /path/to/data \
-scratch /path/to/scratchpython /home/runner/work/jtb_2023_code/jtb_2023_code/jtb_2023_code/generate_figures.py \
-d /path/to/data \
-f /path/to/figures \
-scratch /path/to/scratch \
-s /path/to/schematics \
-m /path/to/modelspython /home/runner/work/jtb_2023_code/jtb_2023_code/jtb_2023_code/package_data.py \
-d /path/to/data \
-scratch /path/to/scratch \
--output_file /path/to/output/data.h5ad- This repository focuses on manuscript analysis and figure production rather than the core dynamical model implementation.
- The checked-in
Figures/directory provides examples of the expected outputs. - The
scripts/directory contains method-specific pseudotime runners and may require additional environment setup depending on the tool being used.
This repository is distributed under the MIT License. See /home/runner/work/jtb_2023_code/jtb_2023_code/LICENSE.
