repaircase 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- repaircase-0.1.0/LICENSE +21 -0
- repaircase-0.1.0/MANIFEST.in +5 -0
- repaircase-0.1.0/PKG-INFO +41 -0
- repaircase-0.1.0/README.md +26 -0
- repaircase-0.1.0/data/judgements.csv +16 -0
- repaircase-0.1.0/docs/CASE.md +76 -0
- repaircase-0.1.0/docs/RUBRIC.md +56 -0
- repaircase-0.1.0/pyproject.toml +39 -0
- repaircase-0.1.0/repaircase/__init__.py +0 -0
- repaircase-0.1.0/repaircase/score.py +165 -0
- repaircase-0.1.0/repaircase.egg-info/PKG-INFO +41 -0
- repaircase-0.1.0/repaircase.egg-info/SOURCES.txt +17 -0
- repaircase-0.1.0/repaircase.egg-info/dependency_links.txt +1 -0
- repaircase-0.1.0/repaircase.egg-info/entry_points.txt +2 -0
- repaircase-0.1.0/repaircase.egg-info/requires.txt +5 -0
- repaircase-0.1.0/repaircase.egg-info/top_level.txt +1 -0
- repaircase-0.1.0/results/scores.csv +16 -0
- repaircase-0.1.0/setup.cfg +4 -0
- repaircase-0.1.0/tests/test_score.py +49 -0
repaircase-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cedric Conday
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: repaircase
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Scores approved drugs for a myelin repair trial in multiple sclerosis against a pre-registered rubric
|
|
5
|
+
Author: Cedric Conday
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: repairmap>=0.1.0
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff; extra == "dev"
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# RepairCase
|
|
17
|
+
|
|
18
|
+
Working name. The written case for one already-approved drug as the candidate for a myelin repair trial in multiple sclerosis, scored against a rubric that was fixed before the scoring.
|
|
19
|
+
|
|
20
|
+
Started 2026-11-23. Part of RepairStack. Nothing here is medical advice.
|
|
21
|
+
|
|
22
|
+
## How it works
|
|
23
|
+
|
|
24
|
+
1. `docs/RUBRIC.md` sets the gates, the points and the bar. It was committed before any candidate was scored.
|
|
25
|
+
2. `repaircase/score.py` reads the RepairMap trial table and scores every candidate.
|
|
26
|
+
3. `docs/CASE.md` is the result: the ranking, and the case for and against the top candidate.
|
|
27
|
+
|
|
28
|
+
## Result on 2026-11-23
|
|
29
|
+
|
|
30
|
+
No approved drug clears the bar of 4 points. The best available candidate is metformin plus clemastine at 3 points. Read `docs/CASE.md` for the ranking, the case for and against, and what result would change it.
|
|
31
|
+
|
|
32
|
+
Scored on RepairMap v0.1.0 (64 trials).
|
|
33
|
+
|
|
34
|
+
## Run it
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
pip install repaircase # pulls in repairmap and its trial table
|
|
38
|
+
repaircase # prints the ranking, writes scores.csv
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Approval and tolerability for each drug are in `data/judgements.csv`, each with its source. US approval records come from the FDA's public Drugs@FDA database.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# RepairCase
|
|
2
|
+
|
|
3
|
+
Working name. The written case for one already-approved drug as the candidate for a myelin repair trial in multiple sclerosis, scored against a rubric that was fixed before the scoring.
|
|
4
|
+
|
|
5
|
+
Started 2026-11-23. Part of RepairStack. Nothing here is medical advice.
|
|
6
|
+
|
|
7
|
+
## How it works
|
|
8
|
+
|
|
9
|
+
1. `docs/RUBRIC.md` sets the gates, the points and the bar. It was committed before any candidate was scored.
|
|
10
|
+
2. `repaircase/score.py` reads the RepairMap trial table and scores every candidate.
|
|
11
|
+
3. `docs/CASE.md` is the result: the ranking, and the case for and against the top candidate.
|
|
12
|
+
|
|
13
|
+
## Result on 2026-11-23
|
|
14
|
+
|
|
15
|
+
No approved drug clears the bar of 4 points. The best available candidate is metformin plus clemastine at 3 points. Read `docs/CASE.md` for the ranking, the case for and against, and what result would change it.
|
|
16
|
+
|
|
17
|
+
Scored on RepairMap v0.1.0 (64 trials).
|
|
18
|
+
|
|
19
|
+
## Run it
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
pip install repaircase # pulls in repairmap and its trial table
|
|
23
|
+
repaircase # prints the ranking, writes scores.csv
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Approval and tolerability for each drug are in `data/judgements.csv`, each with its source. US approval records come from the FDA's public Drugs@FDA database.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
agent,approved,approved_source,advised_against,tolerability,tolerability_source,checked_on
|
|
2
|
+
metformin + clemastine,yes,"Drugs@FDA (api.fda.gov/drug/drugsfda): metformin 214 applications incl. NDA216778; clemastine fumarate 15 applications incl. ANDA074075",no,limited,"RepairMap row metformin-clemastine-ccmr2 (conference report): more fatigue and gut side effects on treatment; the report does not state it was well tolerated",2026-11-23
|
|
3
|
+
clemastine,yes,"Drugs@FDA: clemastine fumarate, 15 applications incl. ANDA074075",no,well,"PMID 29029896 abstract: no serious adverse events; fatigue more common on clemastine",2026-11-23
|
|
4
|
+
metformin,yes,"Drugs@FDA: metformin hydrochloride, 214 applications",no,na,no positive trial,2026-11-23
|
|
5
|
+
phenytoin,yes,"Drugs@FDA: phenytoin, 43 applications incl. NDA008762",no,well,"PMID 26822749 abstract: 'Treatment was well tolerated'; one attributable serious event (severe rash)",2026-11-23
|
|
6
|
+
bexarotene,yes,"Drugs@FDA: bexarotene, 11 applications incl. ANDA203174",yes,limited,"PMID 34418398 abstract: central hypothyroidism 26 of 26, hypertriglyceridaemia 24 of 26; authors advise against use",2026-11-23
|
|
7
|
+
bazedoxifene,yes,"Drugs@FDA: bazedoxifene acetate, NDA022247 (with conjugated oestrogens)",no,na,no positive trial,2026-11-23
|
|
8
|
+
domperidone,yes,"EMA referral page 'Domperidone-containing medicines': authorised nationally in EU member states for nausea and vomiting; no Drugs@FDA record",no,na,no positive trial,2026-11-23
|
|
9
|
+
high-dose biotin (MD1003),yes,"Drugs@FDA lists biotin only as a vitamin ingredient (15 applications); the 300 mg/day product itself was not found there",no,na,"tolerability of the positive trial not sourced; cannot change the ranking",2026-11-23
|
|
10
|
+
opicinumab,no,"no Drugs@FDA record on 2026-11-23; EMA not checked",no,na,no positive trial,2026-11-23
|
|
11
|
+
elezanumab,no,"no Drugs@FDA record on 2026-11-23; EMA not checked",no,na,no positive trial,2026-11-23
|
|
12
|
+
GSK239512,no,"no Drugs@FDA record on 2026-11-23; EMA not checked",no,na,no positive trial,2026-11-23
|
|
13
|
+
PIPE-307,no,"no Drugs@FDA record on 2026-11-23; EMA not checked",no,na,no positive trial,2026-11-23
|
|
14
|
+
PIPE-791,no,"no Drugs@FDA record on 2026-11-23; EMA not checked",no,na,no positive trial,2026-11-23
|
|
15
|
+
CNM-Au8,no,"no Drugs@FDA record on 2026-11-23; EMA not checked",no,na,no positive trial,2026-11-23
|
|
16
|
+
autologous MSC-derived neural progenitors,no,"cell therapy; no approval found, FDA and EMA product lists not checked",no,na,no positive trial,2026-11-23
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# RepairCase, 2026-11-23
|
|
2
|
+
|
|
3
|
+
**No approved drug clears the bar.** The bar is 4 of 7 points on published human trial evidence (`docs/RUBRIC.md`, fixed before scoring). The best available candidate for a repair trial is **metformin plus clemastine** at 3 points. It is not cleared.
|
|
4
|
+
|
|
5
|
+
Scored on RepairMap v0.1.0 (64 trials, 39 agents, 63 rows checked against their source). Nothing here is medical advice.
|
|
6
|
+
|
|
7
|
+
## Ranking
|
|
8
|
+
|
|
9
|
+
Approved drugs, ranked:
|
|
10
|
+
|
|
11
|
+
| Candidate | Total | Biomarker (E1) | Replication (E2) | Function (E3) | Negative trials (E4) | Harm (E5) | Tolerability (E6) |
|
|
12
|
+
|---|---|---|---|---|---|---|---|
|
|
13
|
+
| metformin + clemastine | 3 | 2 | 1 | 0 | 0 | 0 | 0 |
|
|
14
|
+
| phenytoin | 3 | 2 | 0 | 0 | 0 | 0 | 1 |
|
|
15
|
+
| clemastine | 2 | 2 | 1 | 0 | 0 | −2 | 1 |
|
|
16
|
+
| high-dose biotin | 0 | 0 | 0 | 2 | −2 | 0 | 0 |
|
|
17
|
+
| bazedoxifene | −1 | 0 | 0 | 0 | −1 | 0 | 0 |
|
|
18
|
+
| domperidone | −2 | 0 | 0 | 0 | −2 | 0 | 0 |
|
|
19
|
+
| metformin | −2 | 0 | 0 | 0 | −2 | 0 | 0 |
|
|
20
|
+
|
|
21
|
+
Not ranked, gate failed:
|
|
22
|
+
|
|
23
|
+
| Candidate | Points | Gate |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| bexarotene | 1 | Trial authors advised against its use (thyroid and blood-fat effects in almost every participant) |
|
|
26
|
+
| CNM-Au8, GSK239512, PIPE-791, PIPE-307, opicinumab, elezanumab, cell therapy | 1 to −2 | Not approved for any use |
|
|
27
|
+
|
|
28
|
+
Full output: `results/scores.csv`. Inputs: `data/judgements.csv`.
|
|
29
|
+
|
|
30
|
+
## Why metformin plus clemastine and not phenytoin
|
|
31
|
+
|
|
32
|
+
They tie on points. The tie breaks on what was measured, which the rubric reports but does not score.
|
|
33
|
+
|
|
34
|
+
- The phenytoin trial measured thinning of the retinal nerve fibre layer after acute optic neuritis. That is nerve fibre loss, so the result is about protection, not repair of myelin. Its registry record lists a myelin measure as a secondary aim; the abstract does not report it.
|
|
35
|
+
- The metformin plus clemastine trial measured signal speed along the optic nerve, which is the closest thing the field has to a repair readout.
|
|
36
|
+
|
|
37
|
+
## The case for metformin plus clemastine
|
|
38
|
+
|
|
39
|
+
- It met its main outcome in a randomised, placebo-controlled trial of 70 people with relapsing MS over 26 weeks: signal delay was 1.2 ms shorter than placebo (95% CI 0.1 to 2.4).
|
|
40
|
+
- Clemastine alone had already met the same kind of outcome in a separate trial of 50 people: 1.7 ms per eye (95% CI 0.5 to 2.9).
|
|
41
|
+
- Both drugs are old, approved and off patent.
|
|
42
|
+
|
|
43
|
+
## The case against
|
|
44
|
+
|
|
45
|
+
- The effect is small. The combination trial found no change in disability or in other measures of vision.
|
|
46
|
+
- The combination result is a conference report from September 2025. No results paper was on PubMed on 2026-11-23, so the numbers have not been through peer review.
|
|
47
|
+
- People on the combination had more fatigue and gut side effects.
|
|
48
|
+
- Clemastine alone has a harm signal in a different group: in older people with progressive MS, 3 of 9 worsened much faster than before and that trial arm was stopped. The two trials in younger people with relapsing MS did not report this.
|
|
49
|
+
- Metformin alone was dropped from a large progressive MS trial in September 2026 for lack of promise.
|
|
50
|
+
- A cleaner drug aimed at the same target as clemastine (PIPE-307, not approved) missed every outcome in a trial of 182 people.
|
|
51
|
+
|
|
52
|
+
## What would move it over the bar
|
|
53
|
+
|
|
54
|
+
One of these, each worth the missing point:
|
|
55
|
+
|
|
56
|
+
1. A second trial of the combination that meets a repair biomarker outcome.
|
|
57
|
+
2. Any positive or mixed result on a functional outcome such as low-contrast vision.
|
|
58
|
+
3. A peer-reviewed report stating the combination was well tolerated at the tested dose.
|
|
59
|
+
|
|
60
|
+
## Trials already running that bear on it
|
|
61
|
+
|
|
62
|
+
| Trial | Registry | Measures | Primary completion |
|
|
63
|
+
|---|---|---|---|
|
|
64
|
+
| Clemastine, ReVIVE | NCT05359653 | Myelin MRI | 2027-06 |
|
|
65
|
+
| Clemastine, ReCOVER | NCT02521311 | Signal delay, low-contrast vision | 2028-08 |
|
|
66
|
+
| Metformin, MACSiMiSE-BRAIN | NCT05893225 | Walking speed over 96 weeks | 2027-02 |
|
|
67
|
+
|
|
68
|
+
No registered follow-on trial of the combination was found.
|
|
69
|
+
|
|
70
|
+
## Limits
|
|
71
|
+
|
|
72
|
+
- The rubric counts trial outcomes. It does not weigh effect size, trial size or who was tested.
|
|
73
|
+
- 30 of 31 paper rows in the trial table were checked against the abstract only.
|
|
74
|
+
- "Not approved" means no record in the FDA's Drugs@FDA database on 2026-11-23; the EMA was not checked for those drugs.
|
|
75
|
+
- The bexarotene follow-up is counted as a positive biomarker result although it was a follow-up of 20 people, not a planned main outcome. It does not change the ranking, because bexarotene fails a gate.
|
|
76
|
+
- One reader, one pass. No second person has scored this.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# RepairCase rubric
|
|
2
|
+
|
|
3
|
+
Registered 2026-11-23, before the trial table (RepairMap) was checked a second time and before any candidate was scored. Changes after this commit are appended below with a date and a reason; the rules above are not edited.
|
|
4
|
+
|
|
5
|
+
## Question
|
|
6
|
+
|
|
7
|
+
Which drug that is already approved for some other use has the best published human evidence for a myelin repair trial in multiple sclerosis, and does any of them clear a fixed bar?
|
|
8
|
+
|
|
9
|
+
Only published results from trials in people count. Animal and cell results do not score.
|
|
10
|
+
|
|
11
|
+
## Candidates
|
|
12
|
+
|
|
13
|
+
Every distinct agent in RepairMap that has at least one trial with a result. A combination (written `A + B` in the table) is its own candidate.
|
|
14
|
+
|
|
15
|
+
## Gates
|
|
16
|
+
|
|
17
|
+
A candidate that fails a gate is listed with the reason and is not ranked.
|
|
18
|
+
|
|
19
|
+
- **G1 Approved.** The drug, or every drug in the combination, is approved for human use for some indication by the FDA or the EMA or a national European regulator. Source required.
|
|
20
|
+
- **G2 Tested for repair in MS.** At least one RepairMap row with a result of positive, mixed, negative or harm.
|
|
21
|
+
- **G3 Usable.** The trial authors did not advise against its use on tolerability grounds.
|
|
22
|
+
|
|
23
|
+
## Score
|
|
24
|
+
|
|
25
|
+
Computed from RepairMap rows by `repaircase/score.py`. No hand scoring except E6, which needs a sourced judgement.
|
|
26
|
+
|
|
27
|
+
| Item | Rule | Points |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| E1 Biomarker signal | A randomised trial of this candidate met a biomarker primary outcome (`outcome_class=biomarker`, `result=positive`) | 2 |
|
|
30
|
+
| | Otherwise a `mixed` biomarker result | 1 |
|
|
31
|
+
| E2 Replication | Two or more positive biomarker rows for this candidate | 2 |
|
|
32
|
+
| | One positive row, plus a positive row for a combination that contains it (or, for a combination, for one of its parts) | 1 |
|
|
33
|
+
| E3 Function | A positive result on a functional primary outcome | 2 |
|
|
34
|
+
| | Otherwise a `mixed` functional result | 1 |
|
|
35
|
+
| E4 Contradiction | Each trial of this candidate with a `negative` result | −1 each, at most −2 |
|
|
36
|
+
| E5 Harm in MS | Any row with `result=harm` | −2 |
|
|
37
|
+
| E6 Tolerability | Well tolerated at the tested dose in the positive trial, per the trial report | 1 |
|
|
38
|
+
| | Side effects that the report says limited use or dosing | 0 |
|
|
39
|
+
|
|
40
|
+
Maximum 7.
|
|
41
|
+
|
|
42
|
+
## Bar
|
|
43
|
+
|
|
44
|
+
A candidate **clears the bar** at 4 points or more with all gates passed.
|
|
45
|
+
|
|
46
|
+
If no candidate clears the bar, RepairCase says so in its first line, names the highest-scoring candidate as "best available, not cleared", and lists what single result would move it over the bar.
|
|
47
|
+
|
|
48
|
+
## Notes that are reported but not scored
|
|
49
|
+
|
|
50
|
+
- Whether a trial that could settle the question is already running (rows with `result=ongoing`). If so the case says "wait for this readout" and gives the date.
|
|
51
|
+
- Negative trials of other drugs with the same mechanism.
|
|
52
|
+
- Who was tested (age, disease stage), since the published explanations for failure point to both.
|
|
53
|
+
|
|
54
|
+
## What this rubric cannot do
|
|
55
|
+
|
|
56
|
+
It ranks on published trial outcomes only. It does not predict that a drug works, and nothing produced with it is medical advice.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "repaircase"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Scores approved drugs for a myelin repair trial in multiple sclerosis against a pre-registered rubric"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Cedric Conday" }]
|
|
13
|
+
dependencies = ["repairmap>=0.1.0"]
|
|
14
|
+
|
|
15
|
+
[project.optional-dependencies]
|
|
16
|
+
dev = ["pytest", "ruff"]
|
|
17
|
+
|
|
18
|
+
[project.scripts]
|
|
19
|
+
repaircase = "repaircase.score:main"
|
|
20
|
+
|
|
21
|
+
# The judgements live in data/ at the top of the repository; a built wheel carries
|
|
22
|
+
# the same file as repaircase/data/.
|
|
23
|
+
[tool.setuptools]
|
|
24
|
+
packages = ["repaircase", "repaircase.data"]
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.package-dir]
|
|
27
|
+
"repaircase.data" = "data"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.package-data]
|
|
30
|
+
"repaircase.data" = ["judgements.csv"]
|
|
31
|
+
|
|
32
|
+
[tool.ruff]
|
|
33
|
+
line-length = 110
|
|
34
|
+
|
|
35
|
+
[tool.ruff.lint]
|
|
36
|
+
select = ["E", "F", "I", "B", "UP"]
|
|
37
|
+
|
|
38
|
+
[tool.pytest.ini_options]
|
|
39
|
+
testpaths = ["tests"]
|
|
File without changes
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"""Score repair-trial candidates against docs/RUBRIC.md.
|
|
2
|
+
|
|
3
|
+
Reads the RepairMap trial table and a small sheet of sourced judgements
|
|
4
|
+
(approval, tolerability). Prints the ranking and writes results/scores.csv.
|
|
5
|
+
|
|
6
|
+
Run: repaircase (or, in a checkout: python -m repaircase.score --trials ../repairmap/data/trials.csv)
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import argparse
|
|
12
|
+
import csv
|
|
13
|
+
from dataclasses import dataclass, field
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
ROOT = Path(__file__).resolve().parent.parent
|
|
17
|
+
CHECKOUT = (ROOT / "pyproject.toml").exists() # run from the repository, not an installed wheel
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _packaged(package: str, name: str) -> Path:
|
|
21
|
+
from importlib.resources import files
|
|
22
|
+
|
|
23
|
+
return Path(str(files(package) / name))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _default_trials() -> Path:
|
|
27
|
+
"""The sibling RepairMap checkout when there is one, else the table in the installed repairmap."""
|
|
28
|
+
sibling = ROOT.parent / "repairmap" / "data" / "trials.csv"
|
|
29
|
+
return sibling if CHECKOUT and sibling.exists() else _packaged("repairmap.data", "trials.csv")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
JUDGEMENTS = ROOT / "data" / "judgements.csv" if CHECKOUT else _packaged("repaircase.data", "judgements.csv")
|
|
33
|
+
BAR = 4
|
|
34
|
+
DECIDED = {"positive", "mixed", "negative", "harm"}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass
|
|
38
|
+
class Score:
|
|
39
|
+
agent: str
|
|
40
|
+
e1: int = 0
|
|
41
|
+
e2: int = 0
|
|
42
|
+
e3: int = 0
|
|
43
|
+
e4: int = 0
|
|
44
|
+
e5: int = 0
|
|
45
|
+
e6: int = 0
|
|
46
|
+
gates_failed: list[str] = field(default_factory=list)
|
|
47
|
+
missing: list[str] = field(default_factory=list)
|
|
48
|
+
ongoing: list[str] = field(default_factory=list)
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def total(self) -> int:
|
|
52
|
+
return self.e1 + self.e2 + self.e3 + self.e4 + self.e5 + self.e6
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def status(self) -> str:
|
|
56
|
+
if self.gates_failed:
|
|
57
|
+
return "gate failed"
|
|
58
|
+
if self.missing:
|
|
59
|
+
return "incomplete"
|
|
60
|
+
return "clears the bar" if self.total >= BAR else "below the bar"
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def read_csv(path: Path) -> list[dict[str, str]]:
|
|
64
|
+
with path.open(newline="") as fh:
|
|
65
|
+
return list(csv.DictReader(fh))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def parts(agent: str) -> list[str]:
|
|
69
|
+
return [p.strip() for p in agent.split("+")]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _positive_biomarker(rows: list[dict[str, str]]) -> int:
|
|
73
|
+
return sum(r["outcome_class"] == "biomarker" and r["result"] == "positive" for r in rows)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def score_agent(agent: str, trials: list[dict[str, str]], judgement: dict[str, str] | None) -> Score:
|
|
77
|
+
s = Score(agent)
|
|
78
|
+
own = [r for r in trials if r["agent"] == agent]
|
|
79
|
+
decided = [r for r in own if r["result"] in DECIDED]
|
|
80
|
+
s.ongoing = [r["id"] for r in own if r["result"] == "ongoing"]
|
|
81
|
+
|
|
82
|
+
# Related rows: combinations that contain this agent, or the parts of this combination.
|
|
83
|
+
mine = set(parts(agent))
|
|
84
|
+
related = [
|
|
85
|
+
r for r in trials
|
|
86
|
+
if r["agent"] != agent and r["result"] in DECIDED
|
|
87
|
+
and (mine < set(parts(r["agent"])) or set(parts(r["agent"])) < mine)
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
pos_bio = _positive_biomarker(decided)
|
|
91
|
+
if pos_bio:
|
|
92
|
+
s.e1 = 2
|
|
93
|
+
elif any(r["outcome_class"] == "biomarker" and r["result"] == "mixed" for r in decided):
|
|
94
|
+
s.e1 = 1
|
|
95
|
+
|
|
96
|
+
if pos_bio >= 2:
|
|
97
|
+
s.e2 = 2
|
|
98
|
+
elif pos_bio == 1 and _positive_biomarker(related):
|
|
99
|
+
s.e2 = 1
|
|
100
|
+
|
|
101
|
+
functional = [r for r in decided if r["outcome_class"] == "functional"]
|
|
102
|
+
if any(r["result"] == "positive" for r in functional):
|
|
103
|
+
s.e3 = 2
|
|
104
|
+
elif any(r["result"] == "mixed" for r in functional):
|
|
105
|
+
s.e3 = 1
|
|
106
|
+
|
|
107
|
+
s.e4 = -min(2, sum(r["result"] == "negative" for r in decided))
|
|
108
|
+
s.e5 = -2 if any(r["result"] == "harm" for r in decided) else 0
|
|
109
|
+
|
|
110
|
+
if not decided:
|
|
111
|
+
s.gates_failed.append("G2 no trial with a result")
|
|
112
|
+
if judgement is None:
|
|
113
|
+
s.missing.append("no judgement row (approval, tolerability)")
|
|
114
|
+
return s
|
|
115
|
+
if judgement["approved"] == "no":
|
|
116
|
+
s.gates_failed.append("G1 not approved for any use")
|
|
117
|
+
elif judgement["approved"] != "yes":
|
|
118
|
+
s.missing.append("approval not sourced")
|
|
119
|
+
if judgement["advised_against"] == "yes":
|
|
120
|
+
s.gates_failed.append("G3 trial authors advised against use")
|
|
121
|
+
if judgement["tolerability"] == "well":
|
|
122
|
+
s.e6 = 1
|
|
123
|
+
elif judgement["tolerability"] not in {"limited", "na"}:
|
|
124
|
+
s.missing.append("tolerability not sourced")
|
|
125
|
+
return s
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def score_all(trials: list[dict[str, str]], judgements: list[dict[str, str]]) -> list[Score]:
|
|
129
|
+
by_agent = {j["agent"]: j for j in judgements}
|
|
130
|
+
agents = sorted({r["agent"] for r in trials if r["result"] in DECIDED})
|
|
131
|
+
scores = [score_agent(a, trials, by_agent.get(a)) for a in agents]
|
|
132
|
+
return sorted(scores, key=lambda s: (bool(s.gates_failed), -s.total, s.agent))
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def write(scores: list[Score], out: Path) -> None:
|
|
136
|
+
out.parent.mkdir(parents=True, exist_ok=True)
|
|
137
|
+
with out.open("w", newline="") as fh:
|
|
138
|
+
w = csv.writer(fh)
|
|
139
|
+
w.writerow(["agent", "total", "status", "e1", "e2", "e3", "e4", "e5", "e6",
|
|
140
|
+
"gates_failed", "missing", "ongoing_trials"])
|
|
141
|
+
for s in scores:
|
|
142
|
+
w.writerow([s.agent, s.total, s.status, s.e1, s.e2, s.e3, s.e4, s.e5, s.e6,
|
|
143
|
+
"; ".join(s.gates_failed), "; ".join(s.missing), "; ".join(s.ongoing)])
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def main() -> int:
|
|
147
|
+
ap = argparse.ArgumentParser(description="Score repair-trial candidates against docs/RUBRIC.md.")
|
|
148
|
+
ap.add_argument("--trials", type=Path, default=None,
|
|
149
|
+
help="RepairMap trials.csv (default: the installed repairmap's table)")
|
|
150
|
+
ap.add_argument("--judgements", type=Path, default=JUDGEMENTS)
|
|
151
|
+
ap.add_argument("--out", type=Path, default=ROOT / "results" / "scores.csv" if CHECKOUT else Path("scores.csv"))
|
|
152
|
+
a = ap.parse_args()
|
|
153
|
+
|
|
154
|
+
judgements = read_csv(a.judgements) if a.judgements.exists() else []
|
|
155
|
+
scores = score_all(read_csv(a.trials or _default_trials()), judgements)
|
|
156
|
+
write(scores, a.out)
|
|
157
|
+
for s in scores:
|
|
158
|
+
print(f"{s.total:>3} {s.status:<15} {s.agent} "
|
|
159
|
+
f"[E1 {s.e1} E2 {s.e2} E3 {s.e3} E4 {s.e4} E5 {s.e5} E6 {s.e6}]"
|
|
160
|
+
+ (f" ({'; '.join(s.gates_failed + s.missing)})" if s.gates_failed or s.missing else ""))
|
|
161
|
+
return 0
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
if __name__ == "__main__":
|
|
165
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: repaircase
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Scores approved drugs for a myelin repair trial in multiple sclerosis against a pre-registered rubric
|
|
5
|
+
Author: Cedric Conday
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: repairmap>=0.1.0
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff; extra == "dev"
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# RepairCase
|
|
17
|
+
|
|
18
|
+
Working name. The written case for one already-approved drug as the candidate for a myelin repair trial in multiple sclerosis, scored against a rubric that was fixed before the scoring.
|
|
19
|
+
|
|
20
|
+
Started 2026-11-23. Part of RepairStack. Nothing here is medical advice.
|
|
21
|
+
|
|
22
|
+
## How it works
|
|
23
|
+
|
|
24
|
+
1. `docs/RUBRIC.md` sets the gates, the points and the bar. It was committed before any candidate was scored.
|
|
25
|
+
2. `repaircase/score.py` reads the RepairMap trial table and scores every candidate.
|
|
26
|
+
3. `docs/CASE.md` is the result: the ranking, and the case for and against the top candidate.
|
|
27
|
+
|
|
28
|
+
## Result on 2026-11-23
|
|
29
|
+
|
|
30
|
+
No approved drug clears the bar of 4 points. The best available candidate is metformin plus clemastine at 3 points. Read `docs/CASE.md` for the ranking, the case for and against, and what result would change it.
|
|
31
|
+
|
|
32
|
+
Scored on RepairMap v0.1.0 (64 trials).
|
|
33
|
+
|
|
34
|
+
## Run it
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
pip install repaircase # pulls in repairmap and its trial table
|
|
38
|
+
repaircase # prints the ranking, writes scores.csv
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Approval and tolerability for each drug are in `data/judgements.csv`, each with its source. US approval records come from the FDA's public Drugs@FDA database.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
data/judgements.csv
|
|
6
|
+
docs/CASE.md
|
|
7
|
+
docs/RUBRIC.md
|
|
8
|
+
repaircase/__init__.py
|
|
9
|
+
repaircase/score.py
|
|
10
|
+
repaircase.egg-info/PKG-INFO
|
|
11
|
+
repaircase.egg-info/SOURCES.txt
|
|
12
|
+
repaircase.egg-info/dependency_links.txt
|
|
13
|
+
repaircase.egg-info/entry_points.txt
|
|
14
|
+
repaircase.egg-info/requires.txt
|
|
15
|
+
repaircase.egg-info/top_level.txt
|
|
16
|
+
results/scores.csv
|
|
17
|
+
tests/test_score.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
repaircase
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
agent,total,status,e1,e2,e3,e4,e5,e6,gates_failed,missing,ongoing_trials
|
|
2
|
+
metformin + clemastine,3,below the bar,2,1,0,0,0,0,,,
|
|
3
|
+
phenytoin,3,below the bar,2,0,0,0,0,1,,,
|
|
4
|
+
clemastine,2,below the bar,2,1,0,0,-2,1,,,clemastine-recover; clemastine-revive
|
|
5
|
+
high-dose biotin (MD1003),0,below the bar,0,0,2,-2,0,0,,,
|
|
6
|
+
bazedoxifene,-1,below the bar,0,0,0,-1,0,0,,,
|
|
7
|
+
domperidone,-2,below the bar,0,0,0,-2,0,0,,,
|
|
8
|
+
metformin,-2,below the bar,0,0,0,-2,0,0,,,metformin-macsimise; metformin-paediatric; metformin-ageing
|
|
9
|
+
CNM-Au8,1,gate failed,0,0,1,0,0,0,G1 not approved for any use,,
|
|
10
|
+
GSK239512,1,gate failed,1,0,0,0,0,0,G1 not approved for any use,,
|
|
11
|
+
bexarotene,1,gate failed,2,0,0,-1,0,0,G3 trial authors advised against use,,
|
|
12
|
+
PIPE-791,0,gate failed,0,0,0,0,0,0,G1 not approved for any use,,
|
|
13
|
+
PIPE-307,-1,gate failed,0,0,0,-1,0,0,G1 not approved for any use,,
|
|
14
|
+
autologous MSC-derived neural progenitors,-1,gate failed,0,0,0,-1,0,0,G1 not approved for any use,,
|
|
15
|
+
elezanumab,-2,gate failed,0,0,0,-2,0,0,G1 not approved for any use,,
|
|
16
|
+
opicinumab,-2,gate failed,0,0,0,-2,0,0,G1 not approved for any use,,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from repaircase.score import BAR, score_all
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def row(agent, outcome_class, result, id_=None):
|
|
5
|
+
return {"id": id_ or f"{agent}-{outcome_class}-{result}", "agent": agent,
|
|
6
|
+
"outcome_class": outcome_class, "result": result}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def judge(agent, approved="yes", advised_against="no", tolerability="well"):
|
|
10
|
+
return {"agent": agent, "approved": approved, "advised_against": advised_against,
|
|
11
|
+
"tolerability": tolerability}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def by_agent(scores):
|
|
15
|
+
return {s.agent: s for s in scores}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_replicated_positive_with_function_clears_the_bar():
|
|
19
|
+
trials = [row("a", "biomarker", "positive", "t1"), row("a", "biomarker", "positive", "t2"),
|
|
20
|
+
row("a", "functional", "positive", "t3")]
|
|
21
|
+
s = by_agent(score_all(trials, [judge("a")]))["a"]
|
|
22
|
+
assert (s.e1, s.e2, s.e3, s.e6) == (2, 2, 2, 1)
|
|
23
|
+
assert s.total == 7 and s.status == "clears the bar"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def test_single_positive_is_below_the_bar():
|
|
27
|
+
s = by_agent(score_all([row("a", "biomarker", "positive")], [judge("a")]))["a"]
|
|
28
|
+
assert s.total == 3 < BAR and s.status == "below the bar"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_combination_supports_its_part_and_the_reverse():
|
|
32
|
+
trials = [row("a", "biomarker", "positive"), row("a + b", "biomarker", "positive")]
|
|
33
|
+
scores = by_agent(score_all(trials, [judge("a"), judge("a + b")]))
|
|
34
|
+
assert scores["a"].e2 == 1 and scores["a + b"].e2 == 1
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_negatives_are_capped_and_harm_counts():
|
|
38
|
+
trials = [row("a", "functional", "negative", f"n{i}") for i in range(3)] + [row("a", "safety", "harm")]
|
|
39
|
+
s = by_agent(score_all(trials, [judge("a", tolerability="limited")]))["a"]
|
|
40
|
+
assert s.e4 == -2 and s.e5 == -2 and s.total == -4
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def test_gates_and_missing_judgement():
|
|
44
|
+
trials = [row("a", "biomarker", "positive"), row("b", "biomarker", "positive"),
|
|
45
|
+
row("c", "biomarker", "positive"), row("d", "biomarker", "ongoing")]
|
|
46
|
+
scores = by_agent(score_all(trials, [judge("a", approved="no"), judge("b", advised_against="yes")]))
|
|
47
|
+
assert scores["a"].status == "gate failed" and scores["b"].status == "gate failed"
|
|
48
|
+
assert scores["c"].status == "incomplete"
|
|
49
|
+
assert "d" not in scores
|