Skip to main content

nvpersist: Cross-Compartment Neurovascular & Post-Washout Injury Modeling

Official Python package, command-line toolkit, empirical Bayes summary outputs, leave-one-cohort-out cross-validation (LOCO-CV) tables, 2x2 JNK epistasis results, EPA ToxCast invitrodb v4.3 coverage audits, and publication figures for:

Cross-compartment transcriptomic modeling links post-washout neuronal injury to human microvascular and blood-brain barrier dysfunction (Microvascular Research, Elsevier)

Author: Muhammad Khubaib Ahmad
Affiliations: Emerson University Multan, Pakistan; INFERENCE Lab, Multan
Correspondence: khubaib.ahmad@inference-lab.org
Repository: https://github.com/Inference-LAB/nvpersist


Key Features & Package Capabilities

nvpersist (v1.0.0) provides both a reusable Python API + CLI (nvpersist) and the complete study reproduction pipeline:

  1. Statistical Core (nvpersist.stats & nvpersist.id_map):
    • voom_limma_contrast, eb_moderated_from_log_matrix, fit_f_dist_smyth, deseq_size_factors: Within-study differential expression with LOWESS mean-variance precision weights and Smyth empirical Bayes variance moderation mapped to signed normal z_score deviates.
    • preranked_gsea: Vectorized $O(k \log k)$ sparse-hit weighted preranked GSEA computing ES, NES, empirical pvalue, padj, and Stouffer stouffer_z.
    • HGNCMapper: Canonical HGNC gene symbol normalization across Ensembl IDs, Entrez IDs, aliases, and legacy symbols.
  2. Longitudinal Trajectory Decomposition (nvpersist.kinetics):
    • compute_spi_and_escalation: Susceptibility Persistence Index ($\mathrm{SPI}_g$) and washout escalation ($E_g$).
    • classify_kinetic_regimes: Mutually exclusive 5-regime decomposition (Persistent_Conserved, Delayed_Washout_Escalating, Transient_Reversible, Intermediate_Partial, Rebound_Recovery, plus Unchanged).
    • enrich_kinetic_regimes: Fisher exact over-representation tests with Benjamini-Hochberg FDR across regimes.
  3. Cross-Compartment Neurovascular Modeling (nvpersist.neurovascular & nvpersist.nv_modules):
    • NVU_MODULES: 12 curated Neurovascular Unit gene modules (BBB tight/adherens junctions, efflux/influx transporters, glycocalyx/ECM, microvascular adhesion, senescence/SASP, angiogenesis, JNK/AP-1, ISR/UPR, neuronal injury, axonal transport, sterol/lipid, and OXPHOS/Complex I).
    • load_consensus_signature: Bundled 668-gene consensus Neurovascular Persistence (NVP) signature (328 Up, 340 Down).
    • compute_nvp_score: Out-of-cohort directional scoring with 95% bootstrap CI and expression-decile-matched random-gene empirical null tests.
    • directional_nv_concordance, compute_cross_compartment_coupling, compute_jnk_epistasis, audit_toxcast_coverage.
  4. Command-Line Interface (nvpersist):
    • nvpersist info, nvpersist list-modules, nvpersist score, and nvpersist decompose work directly out of the box after pip install.

Installation

Install from PyPI

pip install nvpersist

Install latest development version from GitHub

pip install git+https://github.com/Inference-LAB/nvpersist.git

Local editable installation (from cloned repository)

git clone https://github.com/Inference-LAB/nvpersist.git
cd nvpersist
pip install -r requirements.txt
pip install -e ".[dev]"

Quickstart (CLI & Python API)

Command-Line Interface

# Inspect packaged signature & metadata
nvpersist info

# Inspect curated Neurovascular Unit barrier/stress modules
nvpersist list-modules
nvpersist list-modules --module NVU_BBB_Tight_Adherens_Junctions

# Score any differential expression CSV (requiring 'gene' and 'z_score' columns)
nvpersist score --de-csv path/to/endothelial_contrast.csv --out nvp_scored.csv

# Run 5-regime exposure + washout trajectory decomposition on longitudinal z-scores
nvpersist decompose --z-csv path/to/z_matrix.csv --padj-csv path/to/padj_matrix.csv --out regimes.csv

Python API

import pandas as pd
from nvpersist import (
    NVU_MODULES,
    classify_kinetic_regimes,
    compute_nvp_score,
    directional_nv_concordance,
    load_consensus_signature,
)

up_genes, dn_genes, sig_df = load_consensus_signature()
print(f"Consensus NVP genes: {len(up_genes)} Up, {len(dn_genes)} Down")

# Score a differential expression table indexed by HGNC symbol with a 'z_score' column
# result = compute_nvp_score(de_df, n_boot=1000)

# Directional Neurovascular Concordance (DNC) and Divergence (Delta_NV)
dnc, div = directional_nv_concordance(z_neuronal=15.87, z_vascular=5.13)

Study Datasets & Directory Layout

NV-Persist integrates 279 unique human RNA-sequencing libraries across 11 public NCBI GEO cohorts (138 neuronal libraries; 141 microvascular, aortic/iPSC endothelial, and brain BBB libraries; 89 within-study empirical Bayes contrasts) plus EPA ToxCast invitrodb v4.3 (August 2025):

  • Neuronal GEO Cohorts: GSE312881 (n=71), GSE305998 (n=48), GSE173610 (n=5), GSE245060 (n=14 unique paired).
  • Peripheral Microvascular, Endothelial & Brain BBB GEO Cohorts: GSE261326 (n=25), GSE217550 (n=12), GSE275667 (n=6), GSE217898 (n=72), GSE305805 (n=8), GSE303528 (n=6), GSE211439 (n=12 analyzed).
nvpersist/
├── src/nvpersist/                   # Installable package (stats, kinetics, neurovascular, id_map, nv_modules, cli, bundled data)
├── tests/                           # Unit & CLI test suite (pytest)
├── scripts/                         # Full pipeline scripts (05-20, 18b)
├── data/metadata/                   # Sample manifests for all 11 GEO series
├── results/
│   ├── de_cohort_summary.csv        # Empirical Bayes summary across all 89 contrasts
│   ├── nv_persist/                  # Regime decomposition, Stouffer/NES/FDR matrices, donor & 72h stats, Reactome
│   ├── microvascular/               # Endothelial barrier atlas, BBB marker Z-matrix, 16 paracrine L-R axes
│   ├── validation/                  # LOCO-CV + matched-null stats, 2x2 JNK epistasis, ToxCast v4.3 audit, NVP genes
│   ├── gsea/                        # KEGG preranked GSEA outputs across 20 focal contrasts
│   └── figures/                     # 300-DPI PNG and vector PDF figures (Fig1-Fig5)
├── pyproject.toml                   # Package metadata, dependencies & console script entrypoint
├── requirements.txt
├── CITATION.cff
└── LICENSE                          # MIT License

Note on .gitignore exclusions: Large raw GEO archives (data/raw/, ~119 MB), Enrichr/HGNC lookup files (data/genesets/, ~20 MB), and the 89 individual gzip DE files (results/de/, ~88 MB) are excluded from git tracking and regenerated deterministically via scripts/05_download_geo.py, scripts/06_download_genesets_and_idmap.py, and scripts/13_run_within_study_de.py.


Reproducing Manuscript Results & Tests

# 1. Run full unit and CLI test suite
pytest -v

# 2. Regenerate all 5 publication figures directly from results CSVs
python -u scripts/18b_generate_publication_figures.py

# 3. (Optional) Reproduce from raw NCBI GEO + EPA ToxCast v4.3 Excel release
python -u scripts/05_download_geo.py
python -u scripts/06_download_genesets_and_idmap.py
# Place ToxCast v4.3 files (annotations, target mappings, cytotox) in data/raw/toxcast_v4_3/
python -u scripts/13_run_within_study_de.py
python -u scripts/14_qc_pca_diagnostics.py
python -u scripts/15_nv_persist_modeling.py
python -u scripts/16_validation_and_toxcast.py
python -u scripts/16b_fixed_validation_and_toxcast.py
python -u scripts/17_loco_cv_and_marker_audit.py
python -u scripts/19_critical_audit.py
python -u scripts/19b_inspect_toxcast_exact.py
python -u scripts/20_microvascular_barrier_and_paracrine.py
python -u scripts/18b_generate_publication_figures.py

Citation

If you use nvpersist in your research, please cite the software and accompanying manuscript using CITATION.cff.

License

MIT License - Copyright (c) 2026 Muhammad Khubaib Ahmad. See LICENSE.

Metadata

Release files for nvpersist 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nvpersist 1.0.0
File Size Uploaded Provenance Actions
nvpersist-1.0.0.tar.gz 30.8 kB Without provenance Details for nvpersist-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nvpersist 1.0.0
File Interpreter ABI Platform Actions
nvpersist-1.0.0-py3-none-any.whl Python 3 none any Details for nvpersist-1.0.0-py3-none-any.whl

Total release size: 56.6 kB

Release files / nvpersist-1.0.0.tar.gz

Download URL nvpersist-1.0.0.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
568b877ae9b0289325078f325012b3011e47832cf31716d2584462d701dd36d9
BLAKE2b-256 checksum
How to use checksums
d5856ea4bbbfd1c439a9b86ca17ecda458dd404deb70674e79c681398f97c04b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / nvpersist-1.0.0-py3-none-any.whl

Download URL nvpersist-1.0.0-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2553eaead1e07839838238e2c635f30b6e01cab895f9be3e561512673d616ec1
BLAKE2b-256 checksum
How to use checksums
75d2efb3b30d1130a6d22bc2b6fdfac73d46d8c10813a1ea133352c725aaf659
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Security for nvpersist 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page