PyAntiGen 1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- framework/AntimonyGen.py +48 -0
- framework/RxnDict_to_antimony.py +594 -0
- framework/TelluriumGen.py +14 -0
- framework/__init__.py +0 -0
- framework/antimony_utils.py +294 -0
- framework/cli.py +208 -0
- framework/data_interpolation.py +340 -0
- framework/isotopomer_tools.py +41 -0
- framework/model_generation.py +46 -0
- framework/models.py +189 -0
- framework/module_base.py +42 -0
- framework/pyantigen.py +51 -0
- framework/rate_laws.py +101 -0
- framework/reaction_creation.py +43 -0
- framework/template/Example/AntiGen_paths.py +23 -0
- framework/template/Example/Example_generate.py +30 -0
- framework/template/Example/Example_run.py +37 -0
- framework/template/Example/Modules/Data.py +36 -0
- framework/template/Example/Modules/Events.py +14 -0
- framework/template/Example/Modules/Experiment.py +160 -0
- framework/template/Example/Modules/Loss_config.py +12 -0
- framework/template/Example/Modules/Observed_species.py +3 -0
- framework/template/Example/Modules/Optimizer_settings.py +25 -0
- framework/template/Example/Modules/Plots.py +51 -0
- framework/template/Example/Modules/Solver_settings.py +15 -0
- framework/template/Example/Modules/Update_parameters.py +26 -0
- framework/template/data/ADneg.csv +27 -0
- framework/template/data/ADpos.csv +27 -0
- pyantigen-1.0.dist-info/METADATA +106 -0
- pyantigen-1.0.dist-info/RECORD +33 -0
- pyantigen-1.0.dist-info/WHEEL +5 -0
- pyantigen-1.0.dist-info/licenses/LICENSE +21 -0
- pyantigen-1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Treatment,time,B1,B2,B3
|
|
2
|
+
Early,0,0.19539234562313734,0.10477882730649994,0.2973846164284792
|
|
3
|
+
Early,4,0.2779771221561284,0.001055937,0.15111804708517929
|
|
4
|
+
Early,8,4.782679084451829,4.928558620981794,4.334643272
|
|
5
|
+
Early,12,7.695253302802565,7.486506183447338,7.670888582077174
|
|
6
|
+
Early,16,8.638920256993988,8.764901952880617,8.564767024924421
|
|
7
|
+
Early,20,10.068564764063265,9.200881089445513,9.537327159244036
|
|
8
|
+
Early,24,9.771893527990473,9.680509836078317,10.036671602844494
|
|
9
|
+
Early,28,9.766074610781745,9.724111693188496,9.633603887143744
|
|
10
|
+
Early,32,9.771636547315907,10.058348006501559,9.835037442469508
|
|
11
|
+
Early,36,9.741328028636595,9.841645089251156,10.324624435991593
|
|
12
|
+
Early,40,10.254511279938015,10.221952974860242,10.491660840441746
|
|
13
|
+
Early,44,9.786108617,9.761913566948376,10.119088405111514
|
|
14
|
+
Early,48,10.015206566912964,9.845875563835472,10.189985242581589
|
|
15
|
+
Late,0,0.059418625,0.43622598860070966,0.051827353
|
|
16
|
+
Late,4,0.032439186,0.29560196972284575,0.47402815513002483
|
|
17
|
+
Late,8,0.24482615492977228,0.33293636113115616,0.18588304790121768
|
|
18
|
+
Late,12,1.8331570082144877,1.5068034514622044,1.9884429742073217
|
|
19
|
+
Late,16,3.5858548374647796,3.7843160670685094,3.184916367764073
|
|
20
|
+
Late,20,4.454215165716751,3.9987812269179885,4.507405268303338
|
|
21
|
+
Late,24,5.213944309839263,4.7283469122991875,4.606607241602831
|
|
22
|
+
Late,28,4.607051917370045,4.827165416,4.678734126
|
|
23
|
+
Late,32,5.035079704004494,4.6585003935782145,4.863747375143898
|
|
24
|
+
Late,36,5.088830444826097,4.725803807279649,4.991999062797336
|
|
25
|
+
Late,40,4.657881902164966,4.586923631573959,4.980773876820317
|
|
26
|
+
Late,44,4.676904224019542,4.985150713710271,5.478033425560597
|
|
27
|
+
Late,48,5.070358496196444,5.466873701873418,5.129366196
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyAntiGen
|
|
3
|
+
Version: 1.0
|
|
4
|
+
Summary: Short one-line description of what PyAntiGen does
|
|
5
|
+
Author: Open Source Contributor
|
|
6
|
+
Author-email: Don <you@example.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/you/PyAntiGen
|
|
9
|
+
Keywords: alzheimer,immunology,simulation
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# PyAntiGen
|
|
20
|
+
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- **Object-Oriented Modules:** Encapsulate tissues, flows, synthesis, and excretion into reusable Python classes.
|
|
26
|
+
- **Dynamic Registration:** Automatically binds reactions, compartments, and species to the global model state when a module is instantiated.
|
|
27
|
+
- **Project Scaffolding:** Includes a CLI command to instantly spin up new modeling projects with all necessary directories.
|
|
28
|
+
- **Isotope Tracking:** Natively supports tracking labeled isotopes and generating corresponding parallel reactions.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
You can install PyAntiGen globally into your preferred Python environment by cloning this repository and running pip:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
git clone https://github.com/elbert5770/PyAntiGen.git
|
|
36
|
+
cd PyAntiGen
|
|
37
|
+
pip install -e .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start: Creating a New Model
|
|
41
|
+
|
|
42
|
+
Because PyAntiGen is installed as a system-level Python package, you don't need a copy of the framework files in your working directory.
|
|
43
|
+
|
|
44
|
+
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:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pyantigen-create MyNewModel
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This will automatically scaffold the following project directory:
|
|
51
|
+
```text
|
|
52
|
+
MyNewModel/
|
|
53
|
+
├── .agents/
|
|
54
|
+
│ └── skills/ (agent skills, e.g. module generation, ODE conversion)
|
|
55
|
+
├── scripts/
|
|
56
|
+
│ ├── Example/ (full example: generate, run, optimize + Modules/)
|
|
57
|
+
│ │ ├── Example_generate.py
|
|
58
|
+
│ │ ├── Example_run.py
|
|
59
|
+
│ │ ├── Example_optimize.py
|
|
60
|
+
│ │ └── Modules/ (Data, AntimonyGen, Plots, Simulate, Optimize, Experiment, Events)
|
|
61
|
+
│ └── MyNewModel/ (same structure, Modules/ left empty for your code)
|
|
62
|
+
│ ├── MyNewModel_generate.py
|
|
63
|
+
│ ├── MyNewModel_run.py
|
|
64
|
+
│ ├── MyNewModel_optimize.py
|
|
65
|
+
│ └── Modules/ (Data, AntimonyGen, Plots, Simulate, Optimize, Experiment, Events)
|
|
66
|
+
├── modules/
|
|
67
|
+
│ └── __init__.py (plus Basic/ for the example)
|
|
68
|
+
├── data/ (Example experiment CSVs copied for the example)
|
|
69
|
+
├── antimony_models/
|
|
70
|
+
│ └── Example/ (Example_parameters.csv, Example_InitialConditions.csv, etc.)
|
|
71
|
+
├── generated/
|
|
72
|
+
│ └── Example/ (reaction dict, rules, etc. after generate)
|
|
73
|
+
├── results/
|
|
74
|
+
│ └── Example/ (plots from Example_run.py)
|
|
75
|
+
├── SBML_models/
|
|
76
|
+
└── pyantigen_settings.json (e.g. archive_with_timestamp: false)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
All model-specific files are grouped under folders named by `MODEL_NAME` (e.g. `Example` or your project name). From `MyNewModel/scripts/Example/` run:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
python Example_generate.py
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
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:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python Example_run.py
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For parameter fitting against data, run:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
python Example_optimize.py
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
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'.
|
|
98
|
+
|
|
99
|
+
Keeping the generation and simulation steps separate gives you time to adjust parameters and inspect the generated files before running.
|
|
100
|
+
|
|
101
|
+
### Running from an IDE (Cursor / VS Code)
|
|
102
|
+
|
|
103
|
+
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.
|
|
104
|
+
|
|
105
|
+
1. **Select the correct interpreter**: `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS) → **Python: Select Interpreter** → choose the environment where you ran `pip install -e .` (e.g. your conda or venv).
|
|
106
|
+
2. **Run from project root**: Open the *project* folder (e.g. `MyNewModel`) as the workspace. Use **Run and Debug** (or Play on `scripts/Example/Example_run.py`); the project root is resolved from the script location so `antimony_models/Example/`, `generated/Example/`, and `results/Example/` resolve correctly.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
framework/AntimonyGen.py,sha256=jOh2A6LquAEjFeBa0DB7XBXQAh1n3nrHK4qeQSl3Nhg,1412
|
|
2
|
+
framework/RxnDict_to_antimony.py,sha256=zStKjg14UBBbi5D4xGjZEPkMXH2igomD1ViEhtW40uw,25208
|
|
3
|
+
framework/TelluriumGen.py,sha256=m-4Do8o0l-JePLXMo3gd70CrCr8vSBRGCUBTjUJjMNU,515
|
|
4
|
+
framework/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
framework/antimony_utils.py,sha256=WT67cxgKSFwxpfwB0bfqYtnsB_SG84ynu6HKIDa2c0k,12341
|
|
6
|
+
framework/cli.py,sha256=7llXBL4FZq6C_7CIdn39ybUOWmDVbMab1SJj8mibLLQ,10006
|
|
7
|
+
framework/data_interpolation.py,sha256=nWMYNlJJJgze5qGQj4y1eXelcujrZsy3Dc7_bwEx55A,11982
|
|
8
|
+
framework/isotopomer_tools.py,sha256=7LTiO3mg-Nt0m-pRXmprnoyTyANff_4QUOadbZxHWQ4,1233
|
|
9
|
+
framework/model_generation.py,sha256=34mReS6angE7zcOHA3flz2dXKmutE59C-ryv2hk6YVA,2248
|
|
10
|
+
framework/models.py,sha256=CAwEGZYVPzgR4BX1IjAqcNHDAT9n4_tqjQSJl9bEN-I,7075
|
|
11
|
+
framework/module_base.py,sha256=xlNzbSTMIrgOkNNhQyxyneOCDuia-_ezgPR7qHCKJbc,1260
|
|
12
|
+
framework/pyantigen.py,sha256=PBdOlPsHAHNhE69n6BeN3-nLovqs_Fs0Bw8ajEuKbos,1621
|
|
13
|
+
framework/rate_laws.py,sha256=VVw06MPBgA8H5EaY7xRlW3UntF_90its_U0u-HS5frk,3629
|
|
14
|
+
framework/reaction_creation.py,sha256=n8qb6Dzr2BfBxGmkaEkSkmBlQTHI-1Li-r2kqFBxqE8,1169
|
|
15
|
+
framework/template/Example/AntiGen_paths.py,sha256=BbB-B0Pn0iHjLT67iLWi9U4WEoSkmQpNdflNPzr2mvQ,734
|
|
16
|
+
framework/template/Example/Example_generate.py,sha256=mQiEHMDkoF7UFkNgeTsgCUa4u7M1Zxgn8W-AvUfbbD8,917
|
|
17
|
+
framework/template/Example/Example_run.py,sha256=48fSXi8cW2PWdlWG-qo_a0SMjMOKhEWa_JNv7ZKnGY0,1116
|
|
18
|
+
framework/template/Example/Modules/Data.py,sha256=Xn3F9ffad9nDN45J-5tNHja8k5cZgGS0QFU0H-Jv3ik,1092
|
|
19
|
+
framework/template/Example/Modules/Events.py,sha256=1ZDpVUToMn1LOH1MVDfY3QwGPKiGvKUJK7YbWjN0w9w,325
|
|
20
|
+
framework/template/Example/Modules/Experiment.py,sha256=zwUKeTyq4PEoncxPCO3g5z9O1sjHVxBY1v_SB7UM2QU,6584
|
|
21
|
+
framework/template/Example/Modules/Loss_config.py,sha256=XvFQvXv4sWjDU_OqglJPTFX-dxM0NWomCoX3vbSvras,311
|
|
22
|
+
framework/template/Example/Modules/Observed_species.py,sha256=J44Ts9SuCd7IGhC6n3pdumMgBTV6I9PTtQ6diGUxP7A,215
|
|
23
|
+
framework/template/Example/Modules/Optimizer_settings.py,sha256=j9Z8HIHdjwvLiOESlvLI-UQhCE10S6IGBrISo5OYHiw,815
|
|
24
|
+
framework/template/Example/Modules/Plots.py,sha256=qkGBRxLKQU9oiS3RJqGvyZ2fK2oQ7Rd5nwFSkxx_om4,1795
|
|
25
|
+
framework/template/Example/Modules/Solver_settings.py,sha256=kthj8Yfjc46O3OuPq-xII7NzIfm3pQDJzNrgS6Vrrxw,557
|
|
26
|
+
framework/template/Example/Modules/Update_parameters.py,sha256=9adt7UJ7zSx5ble64PzLYq0LSXy5meY8zdYbijeBcLg,873
|
|
27
|
+
framework/template/data/ADneg.csv,sha256=0AFLqSMQzdiP0CnKivcSLhAPGvSTBHHvURYNwjximIc,1649
|
|
28
|
+
framework/template/data/ADpos.csv,sha256=yomwM-351rqRGRG5HRWXVvH7YjCL02htibz1GhUr3F8,1627
|
|
29
|
+
pyantigen-1.0.dist-info/licenses/LICENSE,sha256=m8qNO2yS4hZm11HQeYNQ6AM05qIWl3D3cpofjwTPfzY,1070
|
|
30
|
+
pyantigen-1.0.dist-info/METADATA,sha256=iqKF0KDZf2uBwX4XKuZ2KEjaQT43lqe5dCxV6QA7xcY,5100
|
|
31
|
+
pyantigen-1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
32
|
+
pyantigen-1.0.dist-info/top_level.txt,sha256=hzpv2xEeSkKTVweFn8I8XnG5zJJOIOTB38-_zgJJSUw,10
|
|
33
|
+
pyantigen-1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UW Elbert Lab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
framework
|