Skip to main content

COPASI PEtab Importer

Project description

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_dir is a directory to a pe tab dir, like ./hackathon_contributions_new_data_format/Becker_Science2010.
  • model_name is one of the model names in the directory like Becker_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_dir is the directory into which the output will be written. For example '/out'. In this case at the end of the run the files Becker_Science2010__BaF3_Exp.cps and Becker_Science2010__BaF3_Exp.txt would be generated.

Also added a bulk converter:

python convert_all_petab.py <base_dir> <output_dir>

where:

  • base_dir is the pe tab root dir, as in ./hackathon_contributions_new_data_format/
  • output_dir the 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

copasi_petab_importer-1.0.9.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

copasi_petab_importer-1.0.9-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file copasi_petab_importer-1.0.9.tar.gz.

File metadata

  • Download URL: copasi_petab_importer-1.0.9.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for copasi_petab_importer-1.0.9.tar.gz
Algorithm Hash digest
SHA256 bd3ed4d789db7c612a0b29d5ab1f975d82602562b72f3874695fba0c396543a1
MD5 d3a6bfd1761fbdc22d06bdd67de96b27
BLAKE2b-256 d2abcc34c4ffd7ba242246cb5622d4d95250feb5dead361003c5d85f30e22133

See more details on using hashes here.

File details

Details for the file copasi_petab_importer-1.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for copasi_petab_importer-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 629795e25a6b0bb8fb464f6906b30a24cedab4cbec5530c98dad43499e564fb1
MD5 a5c17b5f23a48312ef9b4886294445e5
BLAKE2b-256 8aabbbfd0387d00aa9a821860728e4b8f28ad6b938c815a43bdbae11261863ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page