Nexus
Nexus is a JAX-accelerated multi-scale simulator for biological control and causal discovery, capable of generating biologically-realistic data.
Table of contents
Setup
Install uv package manager before running the setup
# Install using pip
pip install nexusim
# (OR)
# Clone repo and build the package in uv
## Clone repository and
git clone https://github.com/AmoghSingh25/nexus.git
## Create venv and download packages
uv sync
Code Structure
src/nexus/simulator/- Core simulation enginedynamics/- Mathematical models for simulator dynamicsnoise_models/- Noise processes, random seedsutils/- Utility functions for simulatorgrn/- Code and logs of the GRN simulatorspatial/- Code, model definitions and logs of the Spatial Simspatial_vec/- Code, model definitions and logs of the vectorized version of Spatial Simrun_sim.py- Run the GRN and Spatial Simrun_linked_sim.py- Run the GRN and Spatial Sim together, allowing diffusion between cells and fields and uses K-Means for the field calculation to allow discontinuous fields.
causal/- Causal discovery and inference modulesidentification/- Algorithms for structure/parameter learningevaluation/- Evaluation scripts
experiments/- Scripts for running experimentsdashboard/- Plotting, analysis, dashboardsweb/- Next.JS website for visualization of simulator outputsretrieve_logger_api.py- Flask API to serve data to the website
tests/- Unit & integration tests
configs/- Config files for runsnotebooks/- Exploratory analyses and demosdocs/- Documentationconfig_desc.md- Configuration parameters and their descriptionintervention_api.md- Working of intervention API and its configurationsimulator.md- Working of the GRN simulatorspatial_simulator.md- Working of the spatial simulator
examples/- Examples scriptsmarimo_example.py- Marimo notebook containing example scriptsipynb_example.py- IPYNB notebook containing example scripts
pyproject.toml- For package/dependency managementREADME.md
Usage
A short code snippet for using the simulator is given below.
from nexus.simulator.grn.grnSim import GRNSim
from nexus.simulator.spatial.spatialSim import SpatialSim
from hydra import initialize_config_dir, compose
def get_config(config_name="test_config"): # Get config from Hydra config file
conf_path = os.path.join(os.getcwd(), "configs")
with initialize_config_dir(version_base=None, config_dir=conf_path):
cfg = compose(config_name=config_name)
return cfg
cfg = get_config()
sim = GRNSim(cfg.grn)
sim.run_sim()
spatial_sim = SpatialSim(cfg.spatial)
spatial_sim.run_sim()
Examples for running the simulator are given in a Marimo notebook and a IPYNB notebook. The simulator uses Hydra configs for the simulation parameters and the description of the config files are given in Config Description.
The simulators can be run together by using the run_sim.py for without field-cell diffusion and run_linked_sim.py which performs field-cell diffusion.
Intervention API
The simulator also supports interventions on the parameters that allows for generating interventional data for causal discovery and analysis. Guidance on using interventions is given in the Intervention Doc.
Visualization
The visualization can be run by the running the two commands in seperate terminal windows.
## Runs the API for fetching the data from TileDB
uv run src/dashboard/retrieve_logger_api.py
## Runs the website to visualize the data
cd dashboard/web/
npm install # If the packages are not installed
npm run dev
After running these two commands, open the link http://localhost:3000 and select a log file from the dropdown. This log file should be present inside the relative directory logs/.
Further instructions on using the dashboard is given in README
Metadata
Release files for nexusim 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nexusim-0.2.1.tar.gz | 48.0 kB | With provenance | Details for nexusim-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nexusim-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for nexusim-0.2.1-py3-none-any.whl |
Total release size: 104.9 kB
Release files / nexusim-0.2.1.tar.gz
| Download URL | nexusim-0.2.1.tar.gz |
|---|---|
| Size | 48.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4f63402defa85dffd6a2ed544b64216c31b919c6f1472d2bbfcd6d782229771
|
|
BLAKE2b-256 checksum How to use checksums |
b052b0cc40d49bfa94aa1459e40dada3889446cc993b0ad8dcc95720017c731f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logRelease files / nexusim-0.2.1-py3-none-any.whl
| Download URL | nexusim-0.2.1-py3-none-any.whl |
|---|---|
| Size | 56.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adba2bf14cfbdc9ab8f0bf6010a6588f11f6a6d181940d57d8c7fc0ba5606325
|
|
BLAKE2b-256 checksum How to use checksums |
53a40f56029aea2d81cbd136725f275409db54a07e0aea1a9556221adaa0667e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logSecurity for nexusim 0.2.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nexusim-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logA 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.