Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The PEtab files are available in the respective subdirectories.
| [Fiedler_BMCSystBiol2016](problems/Fiedler_BMCSystBiol2016/) | [v1](problems/Fiedler_BMCSystBiol2016/v1/) | | Reaction network model of RAF/MEK/ERK signaling with ERK feedback in HeLa cells, fitted to phospho-MEK/ERK data without and with RAF or MEK inhibitors. |
| [Froehlich_CellSystems2018](problems/Froehlich_CellSystems2018/) | [v1](problems/Froehlich_CellSystems2018/v1/) | | Large-scale reaction network model of cancer signaling pathways, parameterized by cell-line-specific gene expression and fitted to drug response viability data. |
| [Fujita_SciSignal2010](problems/Fujita_SciSignal2010/) | [v1](problems/Fujita_SciSignal2010/v1/) | | Reaction network model of EGF-induced EGFR, Akt and S6 phosphorylation in PC12 cells under different EGF stimulation profiles. |
| [Giordano_Nature2020](problems/Giordano_Nature2020/) | [v1](problems/Giordano_Nature2020/v1/) | | Compartmental epidemiological model (SIDARTHE, distinguishing detected/undetected and symptom severity) of the COVID-19 epidemic in Italy. |
| [Giordano_NatMed2020](problems/Giordano_NatMed2020/) | [v1](problems/Giordano_NatMed2020/v1/) | | Compartmental epidemiological model (SIDARTHE, distinguishing detected/undetected and symptom severity) of the COVID-19 epidemic in Italy. |
| [Isensee_JCB2018](problems/Isensee_JCB2018/) | [v1](problems/Isensee_JCB2018/v1/) | | Reaction network model of cAMP-induced PKA activation and phosphorylation of its regulatory subunit in rat sensory neurons under pharmacological perturbations. |
| [Lang_PLOSComputBiol2024](problems/Lang_PLOSComputBiol2024/) | [v1](problems/Lang_PLOSComputBiol2024/v1/) | | Reaction network model of the human cell cycle, generated from a rule-based model and fitted to compartment-resolved single-cell imaging data of RPE-1 cells. |
| [Laske_PLOSComputBiol2019](problems/Laske_PLOSComputBiol2019/) | [v1](problems/Laske_PLOSComputBiol2019/v1/) | | Reaction network model of intracellular influenza A virus replication, fitted to viral RNA, genome import and virus release data in human A549 cells. |
Expand All @@ -49,10 +49,10 @@ The PEtab files are available in the respective subdirectories.
| [Raia_CancerResearch2011](problems/Raia_CancerResearch2011/) | [v1](problems/Raia_CancerResearch2011/v1/) | | Reaction network model of IL-13-induced JAK2/STAT5 signaling in the primary mediastinal B-cell lymphoma cell line MedB-1. |
| [Raimundez_PCB2020](problems/Raimundez_PCB2020/) | [v1](problems/Raimundez_PCB2020/v1/) | | Reaction network model of EGFR and MET signaling to ERK and AKT in two gastric cancer cell lines in response to EGF and the anti-EGFR antibody cetuximab. |
| [SalazarCavazos_MBoC2020](problems/SalazarCavazos_MBoC2020/) | [v1](problems/SalazarCavazos_MBoC2020/v1/) | | Reaction network model of EGFR dimerization, multisite phosphorylation and binding of the adaptor proteins GRB2 and SHC1, generated from a rule-based model. |
| [Schwen_PONE2014](problems/Schwen_PONE2014/) | [v1](problems/Schwen_PONE2014/v1/) | [v2](problems/Schwen_PONE2014/v2/) | Reaction network model of insulin binding, internalization and degradation in two subpopulations of isolated hepatocytes with low and high insulin binding. |
| [Schwen_PLoSOne2015](problems/Schwen_PLoSOne2015/) | [v1](problems/Schwen_PLoSOne2015/v1/) | [v2](problems/Schwen_PLoSOne2015/v2/) | Reaction network model of insulin binding, internalization and degradation in two subpopulations of isolated hepatocytes with low and high insulin binding. |
| [Smith_BMCSystBiol2013](problems/Smith_BMCSystBiol2013/) | [v1](problems/Smith_BMCSystBiol2013/v1/) | | Large reaction network model of insulin signaling in rodent adipocytes and its regulation by oxidative stress. |
| [Sneyd_PNAS2002](problems/Sneyd_PNAS2002/) | [v1](problems/Sneyd_PNAS2002/v1/) | | Kinetic model of the type-2 IP3 receptor, fitted to time courses of calcium release from liver microsomes at varying IP3 and calcium concentrations. |
| [Weber_BMC2015](problems/Weber_BMC2015/) | [v1](problems/Weber_BMC2015/v1/) | | Reaction network model of interactions of protein kinase D, a lipid kinase (PI4KIIIbeta) and a ceramide transfer protein (CERT) at the trans-Golgi network. |
| [Weber_BMCSystBiol2015](problems/Weber_BMCSystBiol2015/) | [v1](problems/Weber_BMCSystBiol2015/v1/) | | Reaction network model of interactions of protein kinase D, a lipid kinase (PI4KIIIbeta) and a ceramide transfer protein (CERT) at the trans-Golgi network. |
| [Zhao_QuantBiol2020](problems/Zhao_QuantBiol2020/) | [v1](problems/Zhao_QuantBiol2020/v1/) | | Compartmental epidemiological model of COVID-19 in Wuhan, Hubei and the rest of China, with quarantined and unquarantined infected individuals. |
| [Zheng_PNAS2012](problems/Zheng_PNAS2012/) | [v1](problems/Zheng_PNAS2012/v1/) | | Reaction network model of the combinatorial methylation of lysines 27 and 36 on histone H3. |
<!-- END OVERVIEW TABLE -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created by COPASI version 4.29 (Build 228) on 2020-09-17 20:49 with libSBML version 5.18.0. -->
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model metaid="COPASI0" id="Giordano_Nature2020" name="Giordano_Nature2020">
<model metaid="COPASI0" id="Giordano_NatMed2020" name="Giordano_NatMed2020">
<notes>
<body xmlns="http://www.w3.org/1999/xhtml">
<pre>This is a model created on COPASI 4.27 (Build 217) which reproduces the Figures 2b, 2d, 3b, 3d, 4b, 4d in the article - https://www.nature.com/articles/s41591-020-0883-7
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="Schwen_PONE2014" name="Schwen_PONE2014">
<model id="Schwen_PLoSOne2015" name="Schwen_PLoSOne2015">
<notes>
<body xmlns="http://www.w3.org/1999/xhtml">
<pre>PEtab implementation of the model from Schwen et al. (2015), PLoS One, 10, e0133653</pre>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="Schwen_PONE2014" name="Schwen_PONE2014">
<model id="Schwen_PLoSOne2015" name="Schwen_PLoSOne2015">
<notes>
<body xmlns="http://www.w3.org/1999/xhtml">
<pre>PEtab implementation of the model from Schwen et al. (2015), PLoS One, 10, e0133653</pre>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="Weber_BMC2015" name="Weber_BMC2015">
<model id="Weber_BMCSystBiol2015" name="Weber_BMCSystBiol2015">
<notes>
<body xmlns="http://www.w3.org/1999/xhtml">
<pre>PEtab implementation of the model from Weber et al. (2015), BMC Syst. Biol., 9, 9</pre>
Expand Down
8 changes: 8 additions & 0 deletions src/python/benchmark_models_petab/C.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
MODELS: List[str] = sorted(os.listdir(MODELS_DIR))
MODEL_DIRS: List[str] = [os.path.join(MODELS_DIR, d) for d in MODELS]

#: Former problem IDs, mapped to the current ones.
#: Accepted by the accessor functions, but not part of `MODELS`.
RENAMED_MODELS: dict[str, str] = {
"Giordano_Nature2020": "Giordano_NatMed2020",
"Schwen_PONE2014": "Schwen_PLoSOne2015",
"Weber_BMC2015": "Weber_BMCSystBiol2015",
}

# layout of a single problem directory (`<MODELS_DIR>/<ProblemID>/...`)
V1_DIRNAME: str = "v1"
V2_DIRNAME: str = "v2"
Expand Down
2 changes: 1 addition & 1 deletion src/python/benchmark_models_petab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from . import v1, v2
from .v1 import get_problem, get_problem_yaml_path, get_simulation_df
from .C import MODEL_DIRS, MODELS, MODELS_DIR
from .C import MODEL_DIRS, MODELS, MODELS_DIR, RENAMED_MODELS
from .metadata import ProblemMetadata, get_metadata
from .overview import get_overview_df
from importlib.metadata import PackageNotFoundError, version
Expand Down
22 changes: 22 additions & 0 deletions src/python/benchmark_models_petab/_ids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Handling of former problem IDs."""

import warnings

from .C import RENAMED_MODELS


def resolve_id(id_: str) -> str:
"""Map a former problem ID to the current one, with a warning.

Other IDs are returned unchanged.
"""
if (new_id := RENAMED_MODELS.get(id_)) is None:
return id_

warnings.warn(
f"Problem `{id_}` was renamed to `{new_id}`. "
"The old ID will stop working in a future version.",
FutureWarning,
stacklevel=3,
)
return new_id
3 changes: 2 additions & 1 deletion src/python/benchmark_models_petab/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import yaml
from pydantic import BaseModel, ConfigDict, Field

from ._ids import resolve_id
from .C import METADATA_FILENAME, MODELS_DIR

METADATA_SCHEMA_FILENAME = "metadata.schema.json"
Expand Down Expand Up @@ -66,7 +67,7 @@ def get_metadata_path(id_: str) -> Path:
-------
The path to the metadata file. The file is not guaranteed to exist.
"""
return Path(MODELS_DIR, id_, METADATA_FILENAME)
return Path(MODELS_DIR, resolve_id(id_), METADATA_FILENAME)


def get_metadata(id_: str) -> ProblemMetadata:
Expand Down
3 changes: 3 additions & 0 deletions src/python/benchmark_models_petab/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pandas as pd

from ._ids import resolve_id
from .C import (
MODELS as ALL_MODELS,
MODELS_DIR,
Expand Down Expand Up @@ -33,6 +34,7 @@ def get_problem_yaml_path(id_: str) -> Path:
-------
The path to the PEtab problem YAML file.
"""
id_ = resolve_id(id_)
yaml_path = Path(MODELS_DIR, id_, V1_DIRNAME, PROBLEM_FILENAME)
if not yaml_path.exists():
raise ValueError(
Expand Down Expand Up @@ -69,6 +71,7 @@ def get_simulation_df(id_: str) -> pd.DataFrame | None:
-------
The simulation dataframe if it exists, else None.
"""
id_ = resolve_id(id_)
path = Path(MODELS_DIR, id_, V1_DIRNAME, SIMULATIONS_FILENAME)
if path.is_file():
return petab.get_simulation_df(path)
Expand Down
3 changes: 3 additions & 0 deletions src/python/benchmark_models_petab/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pandas as pd
import petab.v2 as petab

from ._ids import resolve_id
from .C import (
MODELS as ALL_MODELS,
MODELS_DIR,
Expand Down Expand Up @@ -32,6 +33,7 @@ def get_problem_yaml_path(id_: str) -> Path:
-------
The path to the PEtab v2 problem YAML file.
"""
id_ = resolve_id(id_)
yaml_path = Path(MODELS_DIR, id_, V2_DIRNAME, PROBLEM_FILENAME)
if not yaml_path.exists():
raise ValueError(
Expand Down Expand Up @@ -67,6 +69,7 @@ def get_simulation_df(id_: str) -> pd.DataFrame | None:
-------
The simulation dataframe if it exists, else None.
"""
id_ = resolve_id(id_)
path = Path(MODELS_DIR, id_, V2_DIRNAME, SIMULATIONS_FILENAME)
if path.is_file():
return pd.read_csv(
Expand Down
36 changes: 36 additions & 0 deletions src/python/test/test_renamed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Tests for former problem IDs."""

import pytest

import benchmark_models_petab as models
from benchmark_models_petab.overview import get_readme_table


def test_renamed_models_are_not_problems():
"""Former IDs are no separate problems, their replacements exist."""
assert not set(models.RENAMED_MODELS) & set(models.MODELS)
assert not set(models.RENAMED_MODELS) & set(models.v1.MODELS)
assert not set(models.RENAMED_MODELS) & set(models.v2.MODELS)
assert set(models.RENAMED_MODELS.values()) <= set(models.MODELS)

table = get_readme_table()
for old_id in models.RENAMED_MODELS:
assert old_id not in table


@pytest.mark.parametrize(
"old_id,new_id",
[("Schwen_PONE2014", "Schwen_PLoSOne2015")],
)
def test_former_id_is_accepted_with_warning(old_id, new_id):
for version in (models.v1, models.v2):
with pytest.warns(FutureWarning, match=new_id):
path = version.get_problem_yaml_path(old_id)
assert path == version.get_problem_yaml_path(new_id)
with pytest.warns(FutureWarning, match=new_id):
problem = models.get_problem(old_id)
assert problem.model.model_id == new_id
with pytest.warns(FutureWarning, match=new_id):
assert models.get_simulation_df(old_id) is not None
with pytest.warns(FutureWarning, match=new_id):
assert models.get_metadata(old_id) == models.get_metadata(new_id)
Loading