r/foss • u/Snoo_74391 • 1h ago
MIT-licensed software that reads Open Targets and sorts rare-disease medicines, and the gaps patients have already flagged
In much of the world it is still hard for a patient or a family to see, in one place, which medicines are licensed for a rare condition and which are in clinical trials. The records exist, but they are spread across regulator labels, trial registries and specialist research portals. Moonlight is MIT-licensed open-source software that takes those links from the Open Targets Platform and shows them as a readable page: type a condition, see cards grouped as Approved, Being studied, New clues and Left out, each pointing back to its source.
That is not a theoretical problem. A person in Kochi, southern India, living with limb-girdle muscular dystrophy used the site to find a trial that was recruiting in the United States, and is content for us to say so. For someone already under a specialist team at a major centre, a page like this adds little. Where those teams are scarce, it can be the first clear map of what the public data actually contains.
HOW THE SOFTWARE IS BUILT
Open Targets is the source of record. The Python package under moonlight/ does not keep a private drug database. fetch.py calls the Open Targets Platform API for the disease, its linked protein targets and the drugs acting on them. translate.py maps an everyday name to a MONDO, EFO or HP identifier that Open Targets already knows. filter.py, engine.py, rank.py and records.py then classify each medicine with ordinary, deterministic rules: licensed for this condition goes to Approved; in a trial for it goes to Being studied; licensed for something else but acting on a disease-linked protein goes to New clues; unapproved or unclear links go to Left out. Salt forms are collapsed into one card. Ranking is by linked-protein score, then report count, then name.
The service is FastAPI and Uvicorn, with a single static HTML and JavaScript page, running in Docker on Google Cloud Run in asia-south1.
cache.py keeps three layers (in-memory, container disk, and Firestore for raw Open Targets responses) so a cold start does not hammer the upstream API.
protein.py and explain.py add a short UniProt line and a plain-English note to each card.
Hand-checked overrides live in versioned JSON beside the code (corrections.json, approvals.json, withdrawals.json, left_out.json and others), each pinned by a pytest test against saved Open Targets fixtures so a fix cannot silently vanish after an upstream release.
A language model is not used to invent drug-disease links when someone loads a page. Offline batch scripts read FDA, EMA, DailyMed and PMDA labels and flag cards whose approved status has no matching label; a person decides every correction. When people on Reddit point out a mistake, it becomes a numbered ticket, is checked against a regulator label, and lands in those JSON files with a test.
WHAT HAS ALREADY COME OF THAT
- Besides the Kochi trial find, Open Targets confirmed seven wrong approval records we reported and has scheduled the correction for release 26.12 (https://community.opentargets.org/t/2105).
- As of this afternoon we have 28 numbered feedback tickets from rare-disease community threads, each checked against a label or trial record before it is accepted.
WHAT STILL LIMITS US
- One upstream source means its gaps become ours: a medicine licensed in the UK, the EU or India, but not reflected the same way in Open Targets, can appear only as a trial, or not at all, until we add a checked override.
- Reading thousands of labels to find those mismatches costs model API credits, which we pay ourselves. There are no ads and no selling of data, and we intend to keep it that way.
LIVE SITE https://www.moonlightclues.com
REPOSITORY (MIT): https://github.com/Moonlight-Clues/moonlight.
A GitHub star is welcome if the work is useful.
The main thing that would help us finish the label audit is model API credits, or an introduction to a programme (or a person who can grant them) that supports open-source public-interest software. If you work on open biomedical data, regulator labels, or know clinicians or patient groups in US/India and other places where specialist access is thin, a pull request or a pointer is just as welcome.


