PEtab Importer
This project holds the code to import the parameter estimation benchmark problems into COPASI. The test cases it ought to be able to deal with are from this project:
These models are encoded in the PEtab format with this documentation. The format specifies:
- an SBML file with the model definition
- a measurement file with the experimental data
- a condition file that specifies different initial conditions
So this converter 1. reads the SBML file and converts it to the COPASI format, then converts the experimental data so we can use it in COPASI, and provides the mapping to the observables. Once the converter is done, and you run the parameter estimation you will get the current solution displayed.
The benchmarks are also added as submodule to this repo. So if you do want to use those, be sure to check it out as well, running:
git submodule init
git submodule update
Run PEtab the easy way
This project is used direclty from basico, where we directly implement a PetabSimulator. So if you are interested in just running PEtab problems with COPASI, I recommend to
pip install copasi-basico[petab]
and then follow the basico petab example. Otherwise, this project can of course be used on its own as described below.
Setup
Create a new virtual environment, and then run pip install -r requirements.txt. This will install all the dependencies, these are:
- numpy
- pandas
- python-copasi
- python-libsbml
- PyQt5
- pyyaml
You can also directly install the importer in one line directly from git (including the dependencies) using:
pip install git+https://github.com/copasi/python-petab-importer.git
and you can run directly:
copasi_petab_import [<petab_dir>] <model_name> <output_dir>
Usage
Once installed, you can use the graphical user interface, specify the benchmark directory, select the test and the model, and you ought to be able to open the generated COPASI file directly. You do this by running:
python PEtab.py
Alternatively you cold convert the benchmark models directly by invoking the converter:
python convert_petab.py <benchmark_dir> <model_name> <output_dir>
where:
benchmark_diris a directory to a pe tab dir, like./hackathon_contributions_new_data_format/Becker_Science2010.model_nameis one of the model names in the directory likeBecker_Science2010__BaF3_Exp. The program assumes, that the measurement data and condition data files are in the directory containing the model name (otherwise any measurement / condition file will be greedily taken)output_diris the directory into which the output will be written. For example '/out'. In this case at the end of the run the filesBecker_Science2010__BaF3_Exp.cpsandBecker_Science2010__BaF3_Exp.txtwould be generated.
Also added a bulk converter:
python convert_all_petab.py <base_dir> <output_dir>
where:
base_diris the pe tab root dir, as in./hackathon_contributions_new_data_format/output_dirthe directory in which the files will be saved in
License
Just as COPASI, the packages available on this page are provided under the Artistic License 2.0, which is an OSI approved license. This license allows non-commercial and commercial use free of charge.
Metadata
Release files for copasi-petab-importer 1.0.9
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 |
|---|---|---|---|---|
| copasi_petab_importer-1.0.9.tar.gz | 41.3 kB | Without provenance | Details for copasi_petab_importer-1.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| copasi_petab_importer-1.0.9-py3-none-any.whl | Python 3 | none | any | Details for copasi_petab_importer-1.0.9-py3-none-any.whl |
Total release size: 61.1 kB
Release files / copasi_petab_importer-1.0.9.tar.gz
| Download URL | copasi_petab_importer-1.0.9.tar.gz |
|---|---|
| Size | 41.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd3ed4d789db7c612a0b29d5ab1f975d82602562b72f3874695fba0c396543a1
|
|
BLAKE2b-256 checksum How to use checksums |
d2abcc34c4ffd7ba242246cb5622d4d95250feb5dead361003c5d85f30e22133
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / copasi_petab_importer-1.0.9-py3-none-any.whl
| Download URL | copasi_petab_importer-1.0.9-py3-none-any.whl |
|---|---|
| Size | 19.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
629795e25a6b0bb8fb464f6906b30a24cedab4cbec5530c98dad43499e564fb1
|
|
BLAKE2b-256 checksum How to use checksums |
8aabbbfd0387d00aa9a821860728e4b8f28ad6b938c815a43bdbae11261863ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for copasi-petab-importer 1.0.9
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.