Skip to content
Merged
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
47 changes: 47 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/sh
set -eu

export PYTHONUTF8=1
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

expected_name="stevezkw"
author_ident="$(git var GIT_AUTHOR_IDENT)"
committer_ident="$(git var GIT_COMMITTER_IDENT)"

case "$author_ident" in
"$expected_name <"*) ;;
*)
echo "pre-commit: author must be '$expected_name'; got: $author_ident" >&2
exit 1
;;
esac

case "$committer_ident" in
"$expected_name <"*) ;;
*)
echo "pre-commit: committer must be '$expected_name'; got: $committer_ident" >&2
exit 1
;;
esac

git diff --cached --check

changed_paths="$(git diff --cached --name-only --diff-filter=ACMR)"

if printf '%s\n' "$changed_paths" | grep -Eq '^\.githooks/(pre-commit|pre-push)$'; then
sh -n .githooks/pre-commit .githooks/pre-push
fi

if printf '%s\n' "$changed_paths" | grep -Eq '^(README(\.[^.]+)?\.md|i18n/(glossary\.md|readme_state\.json)|scripts/readme_i18n\.py|tests/test_readme_i18n\.py)$'; then
python3 scripts/readme_i18n.py check
uv run pytest -q tests/test_readme_i18n.py
fi

if printf '%s\n' "$changed_paths" | grep -Eq '^(src|scripts|tests)/.*\.py$'; then
uv run ruff check src scripts tests
fi

if printf '%s\n' "$changed_paths" | grep -Eq '^(src/neorepro/(audit|cli|metrics)\.py|tests/test_(audit_cli|metrics)\.py)$'; then
uv run pytest -q tests/test_audit_cli.py tests/test_metrics.py
fi
9 changes: 9 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -eu

export PYTHONUTF8=1
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

python3 scripts/readme_i18n.py check
uv run pytest -q
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ __pycache__/
*.py[cod]
.pytest_cache/
.ruff_cache/
.bootstrap_checkpoint.json
.bootstrap_checkpoint.json.tmp
.coverage
htmlcov/
build/
Expand All @@ -35,6 +37,8 @@ results/raw_predictions/**
!results/raw_predictions/improve/baselines/loso/*.csv
!results/raw_predictions/zhao/
!results/raw_predictions/zhao/*.csv
!results/raw_predictions/rcc/
!results/raw_predictions/rcc/*.csv
!results/raw_predictions/improve/expanded_9_10/
!results/raw_predictions/improve/expanded_9_10/*.csv
results/raw_predictions/improve/peptide_sensitivity/
Expand Down
6 changes: 6 additions & 0 deletions FINAL_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ This cohort is complementary, not a pure biological replication. Peptide-pulsed

On the original IMPROVE 9–10mer subset, the expanded model set retained the original direction: PRIME AUROC 0.605, BigMHC 0.547, DeepImmuno-CNN 0.527 on its 11,036 supported records, and DeepHLApan 0.508. Thus the external reversal is not explained merely by adding the two older models; it is specifically a dataset/endpoint-domain change.

## RCC cohort and reusable-resource extension

A second endpoint-distinct vaccine extension adds 129 individually assayed short peptides from nine RCC vaccine recipients. Its protocol was frozen before prediction, its source workbook is checksum-pinned, and no known exact PRIME2, BigMHC-construction or DeepImmuno training overlap was identified. Because the cohort is small, uses source-predicted HLA assignments and measures post-vaccination in-vitro stimulation, its results are descriptive and do not establish natural presentation, untreated immunogenicity, clinical efficacy or a universal predictor order. All quantitative RCC results and uncertainty intervals are generated into `paper/manuscript_resource.md` from `results/analysis/rcc/metrics.json`.

The repository now also includes an expanded public-artifact census and a machine-validated extension contract for datasets, predictors and standardized prediction artifacts. Heterogeneous or failed tools remain visible in the registry but are not promoted into the peptide–HLA benchmark. Three-domain stability outputs are explicitly exploratory, task-stratified and conditional on observed support.

## Robustness and interpretation

- Excluding 35 peptides seen in PRIME2 training only under another HLA left the main direction unchanged (BigMHC AUROC 0.545; PRIME 0.596). Excluding 18 additional same-HLA, same-length Hamming-distance-one records did likewise (0.546; 0.596).
Expand Down
47 changes: 44 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export LC_ALL := en_US.UTF-8
export LANG := en_US.UTF-8
PY := uv run python

.PHONY: install setup-predictors download-improve build-improve audit-improve extension download-zhao build-zhao audit-zhao predict-zhao evaluate-zhao predict-expanded-improve evaluate-expanded-improve \
.PHONY: install setup-predictors contract-gate release-boundary predictor-census external-funnel rcc evaluate-rcc stability download-improve build-improve audit-improve extension download-zhao build-zhao audit-zhao predict-zhao evaluate-zhao predict-expanded-improve evaluate-expanded-improve \
predict-improve baselines-improve evaluate-improve hla-improve figures manuscript \
sensitivity-improve build-peptide-sensitivity evaluate-peptide-sensitivity \
evaluate-peptide-hla-rank-sensitivity build-fixed-sensitivities \
Expand All @@ -14,6 +14,47 @@ PY := uv run python
install:
uv sync --extra dev --extra analysis

contract-gate:
cd /tmp && PYTHONPATH="$(CURDIR)/src" uv run --no-project --with pytest python -m neorepro.cli dataset validate "$(CURDIR)/contracts/dataset-card.example.json"
cd /tmp && PYTHONPATH="$(CURDIR)/src" uv run --no-project --with pytest python -m neorepro.cli predictor validate "$(CURDIR)/contracts/predictor-card.example.json"
cd /tmp && PYTHONPATH="$(CURDIR)/src" uv run --no-project --with pytest python -m neorepro.cli artifact "$(CURDIR)/contracts/synthetic/predictions.csv" --benchmark "$(CURDIR)/contracts/synthetic/benchmark.csv"
cd /tmp && PYTHONPATH="$(CURDIR)/src" uv run --no-project --with pytest python -m neorepro.cli evaluate "$(CURDIR)/contracts/synthetic/benchmark.csv" "$(CURDIR)/contracts/synthetic/predictions.csv" \
--output /tmp/neorepro-contract-evaluation.json --report /tmp/neorepro-contract-evaluation.md
cd /tmp && PYTHONPATH="$(CURDIR)/src" uv run --no-project --with pytest pytest "$(CURDIR)/tests/test_contract.py" -q

release-boundary:
$(PY) scripts/audit_release_boundary.py

predictor-census:
$(PY) scripts/reproduce_public_predictors.py

external-funnel:
$(PY) scripts/validate_external_cohort_funnel.py

rcc:
$(PY) scripts/build_rcc_benchmark.py --input data/raw/rcc_2025_table2.xlsx \
--output data/processed/rcc_vaccine_benchmark.csv --summary data/rcc_vaccine_summary.json
$(PY) scripts/audit_external_training_overlap.py \
--benchmark data/processed/rcc_vaccine_benchmark.csv \
--prime2-archive data/raw/prime2_table_s4.xlsx \
--output research/training_overlap_audit_rcc.csv \
--summary research/training_overlap_summary_rcc.json
$(MAKE) evaluate-rcc

evaluate-rcc:
PYTHONPATH=src $(PY) scripts/evaluate_benchmark.py \
--benchmark data/processed/rcc_vaccine_benchmark.csv \
--predictions results/raw_predictions/rcc/*.csv \
--output-dir results/analysis/rcc --bootstrap 2000 --seed 20260820

stability:
$(PY) scripts/analyze_stability.py \
--benchmark data/processed/improve_benchmark.csv data/processed/zhao_vaccine_benchmark.csv data/processed/rcc_vaccine_benchmark.csv \
--prediction-dir results/raw_predictions/improve results/raw_predictions/zhao results/raw_predictions/rcc \
--output-dir results/analysis/stability --bootstrap 2000 --seed 20260820
$(PY) scripts/render_stability_figure.py


setup-predictors:
$(PY) scripts/setup_predictors.py --accept-academic-licenses

Expand Down Expand Up @@ -218,7 +259,7 @@ figures: evaluate-improve baselines-improve hla-improve
--loso results/analysis/improve/baselines/loso/metrics.json \
--hla results/analysis/improve/hla_sensitivity.csv

manuscript: figures sensitivity-improve
manuscript: figures sensitivity-improve evaluate-rcc stability external-funnel contract-gate
$(PY) scripts/build_manuscript.py

manifest: manuscript validate-metrics
Expand All @@ -232,7 +273,7 @@ validate-metrics: evaluate-improve baselines-improve sensitivity-improve
reproduce-results: install
$(MAKE) verify-reproduction

verify-reproduction: manifest
verify-reproduction: manifest release-boundary
$(MAKE) test

# Also download source data and install/run licensed third-party predictors.
Expand Down
12 changes: 10 additions & 2 deletions README.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# NeoRepro

> 🧪 **[Wir suchen aktiv externe Gutachterinnen und Gutachter sowie Autorinnen und Autoren von Prädiktoren.](https://github.com/stevezkw1998/NeoRepro/issues/2)**
>
> Plausibilitätsprüfungen von 15–30 Minuten, Reproduktionsversuche, Datensatzvorschläge und kritische Gegenprüfungen sind willkommen.

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22037063.svg)](https://doi.org/10.5281/zenodo.22037063)

NeoRepro ist eine reproduzierbare, patientenbezogene Benchmark-Ressource für öffentliche MHC-I-Peptid–HLA-Neoantigen-Prädiktoren unter Berücksichtigung von Datenlecks. Sie bündelt festgeschriebene Prädiktor-Artefakte, Provenienz auf Datensatzebene, Prüfungen auf Überschneidungen mit Trainingsdaten, Vergleiche auf einer gemeinsamen Auswertungsmenge, patientenbezogene Unsicherheit, an die Abdeckung angepasste Zufallsreferenzen und maschinell erzeugte Ergebnisse.
Expand All @@ -13,17 +17,21 @@ Der Beitrag ist eine Benchmark- und Forschungsressource, kein neuer Prädiktor u
- **Aktuelles Manuskript:** [als Ressource positioniertes Manuskript](paper/manuscript_resource.md).
- **Evidenz in zwei Minuten:** [zweisprachige Expertenübersicht](output/pdf/neorepro_expert_brief_bilingual.pdf) und [Zusammenfassung der unabhängigen Kohortenerweiterung](reports/extension_summary.md).
- **Festgeschriebene Ergebnisse reproduzieren:** den Befehl im Abschnitt „Reproduktion“ verwenden.
- **Eigenen Prädiktor benchmarken:** `neorepro benchmark predictions.csv --output-dir neorepro-results` ausführen; siehe [Standardvertrag für eine einzelne Datei](contracts/README.md).
- **Drittanbieter-Datensatz oder -Prädiktor hinzufügen:** den [plug-in contract](contracts/README.md) verwenden.
- **Feste Version zitieren:** [CITATION.cff](CITATION.cff), [v0.1.1 release](https://github.com/stevezkw1998/NeoRepro/releases/tag/v0.1.1) und [Zenodo DOI 10.5281/zenodo.22037064](https://doi.org/10.5281/zenodo.22037064).

Der wissenschaftliche Vertrag und Umfang stehen in [RESEARCH_SPEC.md](RESEARCH_SPEC.md).

## Status

- Aktuelle Literaturprüfung: abgeschlossen; Entscheidung `RESCOPE, then GO`
- Reproduzierte Prädiktoren: MHCflurry 2.2.1, BigMHC v1.0, PRIME 2.0, DeepImmuno-CNN und DeepHLApan
- Benchmark-Prädiktoren: MHCflurry 2.2.1, BigMHC v1.0, PRIME 2.0, DeepImmuno-CNN und DeepHLApan; für sieben weitere öffentliche Werkzeuge liegen versionierte Profil-, Nichtvergleichbarkeits- oder Fehlschlagsnachweise vor
- TESLA-Pilot: abgeschlossen; als Positivkontrolle für Trainingsdatenüberschneidung neu eingestuft
- Primärer Benchmark: IMPROVE, 17,475 nach Leakage-Filterung verbleibende Datensätze, 70 Patienten, 3 Kohorten
- Primäre IMPROVE-Inferenz: abgeschlossen; 52,425 Vorhersagen fester Werkzeuge ohne fehlende Datensätze
- Externe Domänen: Zhao-Impfkohorte sowie eine separat festgeschriebene RCC-Impfkohorte mit 129 Datensätzen und 9 Patienten
- Wiederverwendbare Erweiterungsschnittstelle: maschinell validierte Dataset Cards, Predictor Cards und Verträge für Vorhersageartefakte
- Manuskript: [Ressourcenfassung](paper/manuscript_resource.md), aus festgeschriebenen Ergebnisdateien erzeugt; unabhängige statistische und biologische Prüfung abgeschlossen

## Hauptergebnis
Expand All @@ -46,7 +54,7 @@ Unabhängige bootstrap-Analysen werden von Make parallelisiert. Bei begrenzter C
- **Prüfbare Ausgaben:** [endgültige Ergebnistabelle](results/final_results.csv), [Abbildungen](results/figures/), [Prüfung auf Trainingsüberschneidungen](research/training_overlap_summary_improve.json) und [SHA-256-Manifest](results/manifest.json).
- **Publikationsplanung:** [Strategie für Zielzeitschriften](reports/target_venues_2026-08-20.md).

Die unabhängige Erweiterung um die Zhao 2026-Impfkohorte lässt sich mit `make -j4 extension` reproduzieren. Die kompakte Evidenzübersicht steht in [reports/extension_summary.md](reports/extension_summary.md), der vor der Inferenz festgeschriebene Studienvertrag in [research/extension_protocol.json](research/extension_protocol.json). Der externe Endpunkt ist ELISPOT nach der Impfung und Verabreichung peptidgepulster dendritischer Zellen; er darf nicht als natürliche Tumorpräsentation oder klinische Wirksamkeit interpretiert werden.
Die unabhängige Erweiterung um die Zhao 2026-Impfkohorte lässt sich mit `make -j4 extension` reproduzieren. Die kompakte Evidenzübersicht steht in [reports/extension_summary.md](reports/extension_summary.md), der vor der Inferenz festgeschriebene Studienvertrag in [research/extension_protocol.json](research/extension_protocol.json). Die separat festgeschriebene RCC-Erweiterung steht in [research/extension_protocol_rcc_v1.json](research/extension_protocol_rcc_v1.json), explorative Stabilitätsausgaben für drei Domänen unter `results/analysis/stability/`. Beide externen Endpunkte wurden nach der Impfung erhoben und dürfen nicht als natürliche Tumorpräsentation oder klinische Wirksamkeit interpretiert werden.

## Lizenz

Expand Down
12 changes: 10 additions & 2 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# NeoRepro

> 🧪 **[Buscamos activamente revisores externos y autores de predictores.](https://github.com/stevezkw1998/NeoRepro/issues/2)**
>
> Agradecemos comprobaciones de coherencia de 15–30 minutos, intentos de reproducción, sugerencias de conjuntos de datos y críticas adversariales.

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22037063.svg)](https://doi.org/10.5281/zenodo.22037063)

NeoRepro es un recurso de evaluación reproducible, sensible a la fuga de datos y a nivel de paciente para predictores públicos de neoantígenos péptido–HLA de MHC-I. Reúne artefactos de predictores fijados, procedencia por registro, auditorías de solapamiento con datos de entrenamiento, comparaciones sobre soporte común, incertidumbre a nivel de paciente, referencias aleatorias ajustadas al soporte y resultados generados automáticamente.
Expand All @@ -13,17 +17,21 @@ Es una contribución de referencia y recursos, no un predictor nuevo ni una afir
- **Manuscrito actual:** [manuscrito orientado como recurso](paper/manuscript_resource.md).
- **Resumen de la evidencia en dos minutos:** [informe bilingüe para expertos](output/pdf/neorepro_expert_brief_bilingual.pdf) y [resumen de la extensión con cohorte independiente](reports/extension_summary.md).
- **Reproducir los resultados fijados:** usar el comando de la sección «Reproducción».
- **Evaluar su propio predictor:** ejecutar `neorepro benchmark predictions.csv --output-dir neorepro-results`; consultar el [contrato estándar de un solo archivo](contracts/README.md).
- **Añadir un conjunto de datos o predictor de terceros:** consultar el [plug-in contract](contracts/README.md).
- **Citar una versión fija:** [CITATION.cff](CITATION.cff), [v0.1.1 release](https://github.com/stevezkw1998/NeoRepro/releases/tag/v0.1.1) y [Zenodo DOI 10.5281/zenodo.22037064](https://doi.org/10.5281/zenodo.22037064).

El contrato científico y el alcance están en [RESEARCH_SPEC.md](RESEARCH_SPEC.md).

## Estado

- Auditoría de la literatura actual: completa; decisión `RESCOPE, then GO`
- Predictores reproducidos: MHCflurry 2.2.1, BigMHC v1.0, PRIME 2.0, DeepImmuno-CNN y DeepHLApan
- Predictores evaluados: MHCflurry 2.2.1, BigMHC v1.0, PRIME 2.0, DeepImmuno-CNN y DeepHLApan; otros siete instrumentos públicos conservan registros versionados de perfil, no comparabilidad o fallo de reproducción
- Piloto TESLA: completo; reclasificado como control positivo de solapamiento con entrenamiento
- Evaluación principal: IMPROVE, 17,475 registros tras filtrar fugas, 70 pacientes y 3 cohortes
- Inferencia principal de IMPROVE: completa; 52,425 predicciones de herramientas fijas sin registros ausentes
- Dominios externos: cohorte de vacunación Zhao y una cohorte RCC fijada por separado con 129 registros y 9 pacientes
- Interfaz de extensión reutilizable: Dataset Cards, Predictor Cards y contratos de artefactos de predicción validados por máquina
- Manuscrito: [versión orientada como recurso](paper/manuscript_resource.md), generada a partir de resultados fijados; revisión estadística y biológica independiente completada

## Resultado principal
Expand All @@ -46,7 +54,7 @@ Make paraleliza los análisis bootstrap independientes. Use `make reproduce-resu
- **Resultados auditables:** [tabla final de resultados](results/final_results.csv), [figuras](results/figures/), [auditoría de solapamiento con entrenamiento](research/training_overlap_summary_improve.json) y [manifiesto SHA-256](results/manifest.json).
- **Planificación del envío:** [estrategia de revistas objetivo](reports/target_venues_2026-08-20.md).

La extensión independiente con la cohorte de vacunación Zhao 2026 se reproduce con `make -j4 extension`. El resumen conciso de la evidencia está en [reports/extension_summary.md](reports/extension_summary.md), y el contrato congelado antes de la inferencia en [research/extension_protocol.json](research/extension_protocol.json). El criterio externo es ELISPOT posterior a la vacunación tras administrar células dendríticas pulsadas con péptidos; no debe interpretarse como presentación tumoral natural ni eficacia clínica.
La extensión independiente con la cohorte de vacunación Zhao 2026 se reproduce con `make -j4 extension`. El resumen conciso de la evidencia está en [reports/extension_summary.md](reports/extension_summary.md), y el contrato congelado antes de la inferencia en [research/extension_protocol.json](research/extension_protocol.json). La extensión RCC fijada por separado está en [research/extension_protocol_rcc_v1.json](research/extension_protocol_rcc_v1.json), y las salidas exploratorias de estabilidad de tres dominios en `results/analysis/stability/`. Ambos criterios externos son posteriores a la vacunación y no deben interpretarse como presentación tumoral natural ni eficacia clínica.

## Licencia

Expand Down
Loading
Loading