Skip to content

Commit 78f9853

Browse files
Next steps (#219)
* Added next steps with minimal code examples. * small change to featrues * Adopted Changes Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com> * Added suggestions from review * Added basico as part of Copasi environment * removed installation hint and added basico to docu --------- Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
1 parent 1a306b7 commit 78f9853

File tree

2 files changed

+245
-0
lines changed

2 files changed

+245
-0
lines changed

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ To get started with PEtab GUI, check out the :doc:`installation instructions <re
4949

5050
readme
5151
tutorial
52+
next_steps
5253

5354
.. toctree::
5455
:maxdepth: 1

docs/source/next_steps.rst

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
==========
2+
Next Steps
3+
==========
4+
5+
Congratulations on completing your PEtab file! Now that you have a standardized parameter estimation problem, you can use various tools to perform parameter estimation, sensitivity analysis, and model simulation. This page provides minimal working examples for the most commonly used tools in the PEtab ecosystem.
6+
For a complete list of tools, see the `PEtab software support <https://petab.readthedocs.io/en/latest/v1/software_support.html>`_.
7+
8+
.. contents::
9+
:depth: 2
10+
:local:
11+
12+
Parameter Estimation with pyPESTO
13+
----------------------------------
14+
15+
`pyPESTO <https://pypesto.readthedocs.io/>`_ is a Python-based Parameter EStimation TOolbox that provides a unified interface for parameter estimation, uncertainty quantification, and model selection for systems biology models.
16+
17+
**Key features:**
18+
19+
* Multiple optimization algorithms (local and global)
20+
* Multi-start optimization for local optimizers
21+
* Profile likelihood and sampling for uncertainty analysis
22+
* Native PEtab support
23+
24+
**PEtab example notebooks in pyPESTO**
25+
26+
* `Model import using the PEtab format <https://pypesto.readthedocs.io/en/latest/example/petab_import.html>`_ for a basic optimization of a PEtab problem using pyPESTO.
27+
* `AMICI in pyPESTO <https://pypesto.readthedocs.io/en/latest/example/amici.html#Create-a-pyPESTO-problem-+-objective-from-Petab>`_ for a complete workflow of parameter estimation of a PEtab problem using AMICI as simulation engine within pyPESTO.
28+
29+
**Minimal working example:**
30+
31+
.. code-block:: python
32+
33+
import pypesto
34+
import pypesto.petab
35+
36+
# Load PEtab problem
37+
petab_problem = pypesto.petab.PetabImporter.from_yaml("path_to_your_model.yaml")
38+
problem = petab_problem.create_problem()
39+
40+
# Configure optimizer (100 multi-starts)
41+
optimizer = pypesto.optimize.ScipyOptimizer(method='L-BFGS-B')
42+
n_starts = 100
43+
44+
# Run optimization
45+
result = pypesto.optimize.minimize(
46+
problem=problem,
47+
optimizer=optimizer,
48+
n_starts=n_starts
49+
)
50+
51+
# Retrieve best parameters
52+
best_params = result.optimize_result.list[0]['x']
53+
print(f"Best parameters: {best_params}")
54+
print(f"Best objective value: {result.optimize_result.list[0]['fval']}")
55+
56+
**Next steps:**
57+
58+
* Perform profile likelihood: `pypesto.profile <https://pypesto.readthedocs.io/en/latest/api/pypesto.profile.html>`_
59+
* Run sampling for uncertainty: `pypesto.sample <https://pypesto.readthedocs.io/en/latest/api/pypesto.sample.html>`_
60+
* Explore different optimizers and settings in pyPESTO, with many more examples in the `pyPESTO documentation <https://pypesto.readthedocs.io/en/latest/example.html>`_.
61+
62+
**Documentation:** https://pypesto.readthedocs.io/
63+
64+
Model Simulation with AMICI
65+
----------------------------
66+
67+
`AMICI <https://amici.readthedocs.io/>`_ (Advanced Multilanguage Interface to CVODES and IDAS) provides efficient simulation and sensitivity analysis for ordinary differential equation models.
68+
69+
*Disclaimer*: AMICI is currently preparing a release v1.0.0, which will have significant changes to the API. The example below corresponds to the current stable release v0.34.2.
70+
71+
**Key features:**
72+
73+
* C++-based simulation with Python interface
74+
* Fast sensitivity computation via adjoint method
75+
* Symbolic preprocessing for optimized code generation
76+
* Native PEtab support
77+
78+
**Minimal working example:**
79+
80+
.. code-block:: python
81+
82+
83+
import petab
84+
85+
from amici import runAmiciSimulation
86+
from amici.petab.petab_import import import_petab_problem
87+
from amici.petab.petab_problem import PetabProblem
88+
from amici.petab.simulations import simulate_petab
89+
from amici.plotting import plot_state_trajectories
90+
91+
petab_problem = petab.Problem.from_yaml("path_to_your_model.yaml")
92+
amici_model = import_petab_problem(petab_problem, verbose=False)
93+
# Simulate for all conditions
94+
res = simulate_petab(petab_problem, amici_model)
95+
# Visualize trajectory of first condition (indexing starts at 0)
96+
plot_state_trajectories(res["rdatas"][0])
97+
98+
**Next steps:**
99+
100+
* Start to play around with parameters (see `this amici example <https://amici.readthedocs.io/en/v0.34.2/examples/example_petab/petab.html>`_)
101+
* Integrate with pyPESTO for advanced optimization features (see above)
102+
103+
**Documentation:** https://amici.readthedocs.io/
104+
105+
Model Simulation with COPASI
106+
---------------------------------
107+
108+
`COPASI <https://copasi.org/>`_ (COmplex PAthway SImulator) is a standalone software with a graphical user interface for modeling and simulation of biochemical networks.
109+
110+
**Key features:**
111+
112+
* Cross-platform GUI application (Windows, macOS, Linux)
113+
* Advanced simulation possibilities (deterministic, stochastic, steady-state)
114+
* User friendly creation and adaptation of SBML models, e.g. introducing events
115+
* Support for parameter estimation and sensitivity analysis
116+
117+
**Python Interface:**
118+
119+
COPASI also provides the python interface `basiCO <https://basico.readthedocs.io/en/latest/index.html>`_, which supports the full feature set of PEtab.
120+
121+
.. code-block:: python
122+
123+
from basico import *
124+
import basico.petab
125+
from petab import Problem
126+
import petab.visualize
127+
128+
129+
pp = Problem.from_yaml('./Elowitz_Nature2000/Elowitz_Nature2000.yaml')
130+
sim = basico.petab.PetabSimulator(pp, working_dir='./temp_dir/')
131+
df = sim.simulate()
132+
petab.visualize.plot_problem(pp, simulations_df=df)
133+
134+
see `here <https://basico.readthedocs.io/en/latest/notebooks/Working_with_PEtab.html>`_ for an example notebook.
135+
136+
**Documentation:** https://copasi.org/Support/User_Manual/ and https://basico.readthedocs.io/
137+
138+
Parameter Estimation with PEtab.jl
139+
-----------------------------------
140+
141+
`PEtab.jl <https://sebapersson.github.io/PEtab.jl/stable/>`_ is a Julia library for working with PEtab files, offering high-performance parameter estimation with automatic differentiation.
142+
143+
**Key features:**
144+
145+
* High-performance Julia implementation
146+
* Automatic differentiation for fast gradient computation
147+
* Support for ODE and SDE models
148+
* Native integration with Optimization.jl
149+
150+
**Minimal working example:**
151+
152+
.. code-block:: julia
153+
154+
using PEtab
155+
156+
# Import PEtab problem from YAML
157+
model = PEtabModel("your_model.yaml")
158+
159+
petab_prob = PEtabODEProblem(model)
160+
161+
# Parameter estimation
162+
using Optim, Plots
163+
x0 = get_startguesses(petab_prob, 1)
164+
res = calibrate(petab_prob, x0, IPNewton())
165+
plot(res, petab_prob; linewidth = 2.0)
166+
# Multistart optimization using 50 starts
167+
ms_res = calibrate_multistart(petab_prob, IPNewton(), 50)
168+
plot(ms_res; plot_type=:waterfall)
169+
plot(ms_res, petab_prob; linewidth = 2.0)
170+
171+
**Next steps:**
172+
173+
* Explore different ODE solvers for your problem type
174+
* Use gradient-based optimizers with automatic differentiation
175+
* Perform uncertainty quantification with sampling methods
176+
177+
**Documentation:** https://sebapersson.github.io/PEtab.jl/stable/
178+
179+
Parameter Estimation with Data2Dynamics
180+
----------------------------------------
181+
182+
`Data2Dynamics (D2D) <https://github.com/Data2Dynamics/d2d>`_ is a MATLAB-based framework for comprehensive modeling of biological processes with focus on ordinary differential equations.
183+
184+
**Key features:**
185+
186+
* MATLAB-based framework with PEtab support
187+
* Profile likelihood-based uncertainty analysis
188+
* Model identifiability analysis
189+
* PEtab import functionality
190+
191+
**Minimal working example:**
192+
193+
.. code-block:: matlab
194+
195+
% Setup Data2Dynamics environment
196+
arInit;
197+
198+
% Import PEtab problem
199+
arImportPEtab({'my_model','my_observables','my_measurements','my_conditions','my_parameters'}) % note the order of input arguments!
200+
201+
% Multi-start optimization (100 starts)
202+
arFitLHS(100);
203+
204+
% Display results
205+
arPlotFits;
206+
arPlot;
207+
arPrint;
208+
209+
**Documentation:** https://github.com/Data2Dynamics/d2d/wiki
210+
211+
Contribute to the Benchmark Collection
212+
---------------------------------------
213+
214+
Before diving into parameter estimation, consider contributing your PEtab problem to the community! The `PEtab Benchmark Collection <https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab>`_ is a curated repository of parameter estimation problems that helps:
215+
216+
* **Validate** your PEtab problem by ensuring it works with multiple tools
217+
* **Enable reproducibility** by providing a permanent reference for your model
218+
* **Facilitate method comparison** by allowing others to test algorithms on your problem
219+
* **Support the community** by expanding the available benchmark suite
220+
221+
**How to contribute:**
222+
223+
See their `How to Contribute <https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab?tab=contributing-ov-file#readme>`_, and for a complete checklist see the
224+
`pull request template <https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab/blob/master/.github/pull_request_template.md>`_.
225+
226+
Additional Resources
227+
--------------------
228+
229+
**PEtab Ecosystem:**
230+
231+
* `PEtab Format Specification <https://petab.readthedocs.io/en/latest/v1/documentation_data_format.html>`_ - Complete PEtab documentation
232+
* `PEtab Select <https://petab-select.readthedocs.io/>`_ - Model selection extension
233+
234+
**Model Repositories:**
235+
236+
* `Benchmark Collection <https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab>`_ - Curated PEtab problems
237+
* `BioModels <https://www.ebi.ac.uk/biomodels/>`_ - Database of published SBML models
238+
239+
**Getting Help:**
240+
241+
* PEtab-GUI Issues: https://github.com/PEtab-dev/PEtab-GUI/issues
242+
* PEtab Issues: https://github.com/PEtab-dev/PEtab/issues
243+
* PEtab Discussion: https://github.com/PEtab-dev/PEtab/discussions
244+
* Systems Biology Community: https://groups.google.com/g/sbml-discuss

0 commit comments

Comments
 (0)