From 30a0735ad38a6fce25a49bb1c5992e11e3ecd065 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 22 Oct 2026 09:46:11 +0200 Subject: [PATCH 1/7] Add `references` to the per-problem metadata Add a required `references` list to `ProblemMetadata`: the publications a problem is based on, each with its `doi` and a `bibtex` entry. The first entry is the main publication, its BibTeX key is the problem ID (checked by `bmp-check-metadata`). `get_bibtex()` aggregates the main publications' entries; the site build writes them to `references.bib`. Co-Authored-By: Claude Opus 5.5 --- .github/pull_request_template.md | 2 +- CONTRIBUTING.md | 21 +++-- src/python/benchmark_models_petab/__init__.py | 2 +- .../benchmark_models_petab/_site/build.py | 9 ++- .../_site/templates/index.html.j2 | 2 + .../benchmark_models_petab/check_metadata.py | 9 ++- src/python/benchmark_models_petab/metadata.py | 71 +++++++++++++++- src/python/benchmark_models_petab/overview.py | 9 ++- .../schemas/metadata.schema.json | 37 ++++++++- src/python/test/test_metadata.py | 80 +++++++++++++++---- src/python/test/test_overview.py | 1 + 11 files changed, 205 insertions(+), 38 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e5a511c..ac26c2d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -21,7 +21,7 @@ - [ ] A visualization table is included, that can be used with the simulated data to reproduce figures from the original publication - [ ] The PEtab problem is valid (check with e.g. `petablint -vy problem.yaml`) - [ ] Labels (e.g. `parameterName` in the parameter table or `xLabel` in the visualization table) encode special characters with tex-style strings instead of unicode, e.g. use `H$_2$O` for water. -- [ ] `problems//metadata.yaml` contains a single-sentence `short_description` of the problem and passes `bmp-check-metadata` +- [ ] `problems//metadata.yaml` contains a single-sentence `short_description` of the problem and the `references` (DOI and BibTeX entry, key = problem ID) of the original publication(s), and passes `bmp-check-metadata` - [ ] The PEtab problem author(s) are assigned to the GitHub issue - [ ] The README has been updated with `bmp-create-overview --update` (requires `pip install -e src/python` from the repository root) - [ ] The new PEtab problem row in the generated table has the correct reference (and other entries) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 594c32f..6f8b79d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,17 +7,16 @@ Each problem lives under `problems//`, with at least one of `v1/`/`v2 `conditions.tsv`, `measurements.tsv`, `observables.tsv`, `parameters.tsv`, and optionally `simulations.tsv` and `visualizations.tsv`. - `v2/` holds the same problem in PEtab v2 format. -- `metadata.yaml` contains version-independent metadata. Currently, this is a single-sentence - `short_description` of the problem, stating the type of model (e.g., biochemical reaction network, - compartmental epidemiological model), the biological system, and, where informative, the data. - For example: - ```yaml - short_description: Reaction network model of Epo-induced STAT5A/STAT5B phosphorylation and homo- and heterodimerization, fitted to quantitative mass spectrometry data. - ``` - The file is validated against the `ProblemMetadata` model in - [`metadata.py`](src/python/benchmark_models_petab/metadata.py) - (check with `bmp-check-metadata`); the corresponding JSON schema is - [`metadata.schema.json`](src/python/benchmark_models_petab/schemas/metadata.schema.json). +- `metadata.yaml` contains version-independent metadata: + - `short_description`: a single sentence stating the type of model (e.g., biochemical reaction + network, compartmental epidemiological model), the biological system, and, where informative, + the data. + - `references`: the publications the problem is based on, each with its `doi` and a `bibtex` + entry (one field per line, including a matching `doi` field). The first entry is the main + publication; its BibTeX key is the problem ID. + + See [`problems/Boehm_JProteomeRes2014/metadata.yaml`](problems/Boehm_JProteomeRes2014/metadata.yaml) + for an example. - `resources/` (optional) holds anything else related to the problem that isn't part of the PEtab files themselves (e.g. raw data, scripts, notebooks, figures). There's no prescribed structure — organize it however fits your problem. diff --git a/src/python/benchmark_models_petab/__init__.py b/src/python/benchmark_models_petab/__init__.py index c901db2..d4faeea 100644 --- a/src/python/benchmark_models_petab/__init__.py +++ b/src/python/benchmark_models_petab/__init__.py @@ -7,7 +7,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 .metadata import ProblemMetadata, get_metadata +from .metadata import ProblemMetadata, get_bibtex, get_metadata from .overview import get_overview_df from importlib.metadata import PackageNotFoundError, version diff --git a/src/python/benchmark_models_petab/_site/build.py b/src/python/benchmark_models_petab/_site/build.py index 07f8dc0..2b41b50 100644 --- a/src/python/benchmark_models_petab/_site/build.py +++ b/src/python/benchmark_models_petab/_site/build.py @@ -14,7 +14,7 @@ V1_DIRNAME, V2_DIRNAME, ) -from ..metadata import get_metadata +from ..metadata import get_bibtex, get_metadata REPO_URL = f"https://github.com/{GITHUB_REPO}" LOGO_URL = ( @@ -22,6 +22,8 @@ f"/{GITHUB_DEFAULT_BRANCH}/gfx/logo.svg" ) CONTRIBUTING_URL = f"{REPO_URL}/blob/{GITHUB_DEFAULT_BRANCH}/CONTRIBUTING.md" +#: File name of the BibTeX entries of all problems, next to the page. +BIBTEX_FILENAME = "references.bib" #: Rendering of the columns that are not plain text, by column name. #: Other columns of integer dtype are rendered as numbers. @@ -170,6 +172,9 @@ def get_summary_tiles(v1_df: pd.DataFrame, v2_df: pd.DataFrame) -> list: def create_overview_page(dest: Path) -> None: """Create the HTML page with the v1 and v2 overview tables. + The BibTeX entries of all problems' main publications are written to + `BIBTEX_FILENAME` in the same directory, linked from the page. + :param dest: Path to the output HTML file. """ from jinja2 import Environment, PackageLoader, select_autoescape @@ -184,6 +189,7 @@ def create_overview_page(dest: Path) -> None: repo_url=REPO_URL, logo_url=LOGO_URL, contributing_url=CONTRIBUTING_URL, + bibtex_url=BIBTEX_FILENAME, summary_tiles=get_summary_tiles(v1_df, v2_df), tables={ "v2": get_table( @@ -202,3 +208,4 @@ def create_overview_page(dest: Path) -> None: ) dest.parent.mkdir(parents=True, exist_ok=True) dest.write_text(html, encoding="utf-8") + (dest.parent / BIBTEX_FILENAME).write_text(get_bibtex(), encoding="utf-8") diff --git a/src/python/benchmark_models_petab/_site/templates/index.html.j2 b/src/python/benchmark_models_petab/_site/templates/index.html.j2 index 278ddd8..9c5a6be 100644 --- a/src/python/benchmark_models_petab/_site/templates/index.html.j2 +++ b/src/python/benchmark_models_petab/_site/templates/index.html.j2 @@ -361,6 +361,8 @@ footer { >10, <=5, or 10-100. Click a table and press Ctrl+C to copy its visible rows, including the column headers. + BibTeX entries of the publications the problems are based on: + {{ bibtex_url }}.