Short one-line description of what PyAntiGen does
Project description
PyAntiGen
PyAntiGen is a declarative, object-oriented framework for generating compartmental biological models in Antimony format. It is designed to abstract away the repetitive boilerplate of defining reactions and compartments manually, allowing researchers to build complex, scalable models using clean Python syntax.
Features
- Object-Oriented Modules: Encapsulate tissues, flows, synthesis, and excretion into reusable Python classes.
- Dynamic Registration: Automatically binds reactions, compartments, and species to the global model state when a module is instantiated.
- Project Scaffolding: Includes a CLI command to instantly spin up new modeling projects with all necessary directories.
- Isotope Tracking: Natively supports tracking labeled isotopes and generating corresponding parallel reactions.
Installation
You can install PyAntiGen globally into your preferred Python environment by cloning this repository and running pip:
git clone https://github.com/elbert5770/PyAntiGen.git
cd PyAntiGen
pip install -e .
Quick Start: Creating a New Model
Because PyAntiGen is installed as a system-level Python package, you don't need a copy of the framework files in your working directory.
To start a brand new modeling workspace, just open a terminal and navigate to a folder where you want it to live (not PyAntiGen) and run:
pyantigen-create MyNewModel
This will automatically scaffold the following project directory:
MyNewModel/
├── .agents/
│ └── skills/ (agent skills, e.g. module generation, ODE conversion)
├── scripts/
│ ├── Example/ (full example: generate, run, optimize + Modules/)
│ │ ├── Example_generate.py
│ │ ├── Example_run.py
│ │ ├── Example_optimize.py
│ │ └── Modules/ (Data, AntimonyGen, Plots, Simulate, Optimize, Experiment, Events)
│ └── MyNewModel/ (same structure, Modules/ left empty for your code)
│ ├── MyNewModel_generate.py
│ ├── MyNewModel_run.py
│ ├── MyNewModel_optimize.py
│ └── Modules/ (Data, AntimonyGen, Plots, Simulate, Optimize, Experiment, Events)
├── modules/
│ └── __init__.py (plus Basic/ for the example)
├── data/ (Example experiment CSVs copied for the example)
├── antimony_models/
│ └── Example/ (Example_parameters.csv, Example_InitialConditions.csv, etc.)
├── generated/
│ └── Example/ (reaction dict, rules, etc. after generate)
├── results/
│ └── Example/ (plots from Example_run.py)
├── SBML_models/
└── pyantigen_settings.json (e.g. archive_with_timestamp: false)
All model-specific files are grouped under folders named by MODEL_NAME (e.g. Example or your project name). From MyNewModel/scripts/Example/ run:
python Example_generate.py
This generates the model and writes outputs to antimony_models/Example/ and generated/Example/. Edit parameters if desired in antimony_models/Example/Example_parameters.csv, then run:
python Example_run.py
For parameter fitting against data, run:
python Example_optimize.py
Your own model lives under scripts/MyNewModel/ with the same files as the Example. Modify the code for your model in scripts/MyNewModel/Modules/ and scripts/MyNewModel/MyNewModel_generate.py, scripts/MyNewModel/MyNewModel_run.py, and `scripts/MyNewModel/MyNewModel_optimize.py'. Your problem will also require new modules in folder 'modules'.
Keeping the generation and simulation steps separate gives you time to adjust parameters and inspect the generated files before running.
Running from an IDE (Cursor / VS Code)
The Play button uses whichever Python interpreter is currently selected. If your environment (conda/venv) isn’t loaded, the run may fail with import or path errors.
- Select the correct interpreter:
Ctrl+Shift+P(orCmd+Shift+Pon macOS) → Python: Select Interpreter → choose the environment where you ranpip install -e .(e.g. your conda or venv). - Run from project root: Open the project folder (e.g.
MyNewModel) as the workspace. Use Run and Debug (or Play onscripts/Example/Example_run.py); the project root is resolved from the script location soantimony_models/Example/,generated/Example/, andresults/Example/resolve correctly.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyantigen-1.0.tar.gz.
File metadata
- Download URL: pyantigen-1.0.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d068f2b477813756b3a70e61d507566c95dd65baf691aaf75b479eec0adc15f7
|
|
| MD5 |
5aa139f4e07f31943b3ba11e77cd952c
|
|
| BLAKE2b-256 |
338e7f0223f2a60f1f34898a1647f6679db8b3514488d62a9f74796a26c6fd4e
|
Provenance
The following attestation bundles were made for pyantigen-1.0.tar.gz:
Publisher:
publish.yml on elbert5770/PyAntiGen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyantigen-1.0.tar.gz -
Subject digest:
d068f2b477813756b3a70e61d507566c95dd65baf691aaf75b479eec0adc15f7 - Sigstore transparency entry: 1422491689
- Sigstore integration time:
-
Permalink:
elbert5770/PyAntiGen@1b6e0d84f55b9d4afcbb5c6b54781b1a8a95a313 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/elbert5770
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b6e0d84f55b9d4afcbb5c6b54781b1a8a95a313 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyantigen-1.0-py3-none-any.whl.
File metadata
- Download URL: pyantigen-1.0-py3-none-any.whl
- Upload date:
- Size: 38.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58138d3abb39280e853b463fb22612d57b25044b1a0571cc7b2f54b876b8c972
|
|
| MD5 |
9f50e4df21d5cd943d199b791b5d49fe
|
|
| BLAKE2b-256 |
59290a0f44819f97f4ec936f44f0dbfcc7720230aa3b69be74693085be27cf0b
|
Provenance
The following attestation bundles were made for pyantigen-1.0-py3-none-any.whl:
Publisher:
publish.yml on elbert5770/PyAntiGen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyantigen-1.0-py3-none-any.whl -
Subject digest:
58138d3abb39280e853b463fb22612d57b25044b1a0571cc7b2f54b876b8c972 - Sigstore transparency entry: 1422491798
- Sigstore integration time:
-
Permalink:
elbert5770/PyAntiGen@1b6e0d84f55b9d4afcbb5c6b54781b1a8a95a313 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/elbert5770
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b6e0d84f55b9d4afcbb5c6b54781b1a8a95a313 -
Trigger Event:
push
-
Statement type: