Jamorham
Nightscout용 xDrip+ 버전
AI가 예측한 항균 활성을 가진 기존 의약품을 MRSA 대상 검색
Search approved medicines for AI-predicted antibacterial activity against MRSA, E. coli, K. pneumoniae and M. tuberculosis, and see the documented evidence behind each one. Nothing here establishes cl
건강Python · TypeScriptGitHub @VED2107온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기AI-assisted screening of approved medicines against four drug-resistant bacteria, with an evidence-inspectable web interface
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
AI-driven screening of approved drugs against antimicrobial-resistant pathogens.
A working research prototype that ingests real bioactivity and regulatory data,
trains and benchmarks machine-learning models on 1024-bit Morgan fingerprints,
docks prioritised candidates with AutoDock Vina, attaches retrospective clinical
context, and presents everything in a scientific dashboard.README 전문 보기 ↗AI-driven screening of approved drugs against antimicrobial-resistant pathogens.
A working research prototype that ingests real bioactivity and regulatory data, trains and benchmarks machine-learning models on 1024-bit Morgan fingerprints, docks prioritised candidates with AutoDock Vina, attaches retrospective clinical context, and presents everything in a scientific dashboard.
Scientific boundary. Everything this system produces is a computational prediction. Model probabilities and docking scores are hypotheses for experimental validation. They are not evidence of clinical efficacy or safety, and nothing here should be read as a claim that a drug treats or cures any disease.
Antimicrobial resistance outpaces new antibiotic discovery. Repurposing already approved drugs shortens the path to the clinic because the pharmacology, dosing and human safety profile are already characterised.
This project screens the FDA-approved drug library against four priority pathogens:
| Pathogen | Organism |
|---|---|
| MRSA | Staphylococcus aureus (methicillin-resistant) |
| E. coli | Escherichia coli |
| K. pneumoniae | Klebsiella pneumoniae |
| M. tuberculosis | Mycobacterium tuberculosis |
COLLECT -> DECODE -> PREDICT -> VALIDATE -> DELIVER
| Stage | What happens |
|---|---|
| Collect | ChEMBL bioactivity, FDA Orange Book approvals, ClinicalTrials.gov records |
| Decode | RDKit standardisation, 1024-bit Morgan fingerprints, descriptors |
| Predict | Random Forest baseline plus a benchmarked model zoo, per pathogen |
| Validate | AutoDock Vina against one validated protein target per pathogen |
| Deliver | Streamlit dashboard with full provenance on every number |
See docs/ARCHITECTURE.md for the full module map, data model, selection protocol and automation rules.
src/ingestion ChEMBL, FDA Orange Book, HTTP client
src/chemistry standardisation, fingerprints, descriptors, depiction
src/ml labelling, datasets, splits, models, training, registry, sanity
src/docking receptor prep, ligand prep, Vina
src/clinical ClinicalTrials.gov
src/ranking evidence assembly and composite scoring
src/pipeline the runnable stages
app Streamlit dashboard
| Source | Endpoint | Used for |
|---|---|---|
| ChEMBL | https://www.ebi.ac.uk/chembl/api/data | bioactivity (training labels) and approved molecules with structures |
| FDA Orange Book | https://www.fda.gov/media/76860/download?attachment | approved human drug products |
| openFDA Drugs@FDA | https://api.fda.gov/drug/drugsfda.json | fallback approved-drug source |
| ClinicalTrials.gov v2 | https://clinicaltrials.gov/api/v2/studies | retrospective human clinical history |
| RCSB PDB | https://files.rcsb.org/download/{id}.pdb | docking target structures |
No API keys are required. The source actually used for each record is stored in
data_sources and on the row itself, so the dashboard never overstates
provenance.
The FDA content CDN returns 404 to non-browser user agents on its public data files, so the Orange Book fetch presents a browser UA. It is a public dataset with no authentication.
Bioactivity records are filtered to whole-organism and direct-target endpoints (MIC, MIC50, MIC90, MBC, IC50, EC50, Ki, Kd) with usable units, joined to a parseable structure, labelled, then aggregated to one row per (compound, pathogen).
Each dataset version is content-addressed: identical data and configuration produce an identical version identifier, and every model records the dataset version it was trained on.
Full rationale: docs/LABELING.md. In brief:
pActivity = -log10(molar).pchembl_value is used when ChEMBL provides it; µg/mL converts via the
RDKit-computed molecular weight.MIC > 128 µg/mL can only support an
inactive call; MIC < 0.5 µg/mL can only support an active one.Requires Python 3.11+.
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install -e .
pip install -e ".[dev]" # test dependencies
Core dependencies are pinned in pyproject.toml: rdkit, pandas, numpy, scipy,
scikit-learn, joblib, streamlit, plotly, requests, PyYAML, meeko, py3Dmol.
Docking needs the Vina executable. Download the binary for your platform from
the AutoDock Vina releases
and either place it at tools/vina (tools/vina.exe on Windows) or point
AMR_VINA_BIN at it.
# Linux / macOS
mkdir -p tools && curl -L -o tools/vina \
https://github.com/ccsb-scripps/AutoDock-Vina/releases/download/v1.2.5/vina_1.2.5_linux_x86_64
chmod +x tools/vina
# Windows
curl -L -o tools/vina.exe \
https://github.com/ccsb-scripps/AutoDock-Vina/releases/download/v1.2.5/vina_1.2.5_win.exe
Receptor preparation additionally needs gemmi, which installs with Meeko:
pip install gemmi.
If Vina is unavailable the pipeline still runs. The docking stage records the limitation and every other stage completes normally.
Copy .env.example to .env. Nothing is required; every variable is optional.
| Variable | Purpose |
|---|---|
AMR_CONTACT_EMAIL | appended to the User-Agent sent to public APIs |
AMR_DB_PATH | override the SQLite location (used for demo mode) |
AMR_VINA_BIN | absolute path to the Vina executable |
AMR_OFFLINE | 1 blocks all outbound network calls |
Never commit .env.
python -m src.pipeline.train # Random Forest baseline only
python -m src.pipeline.train --benchmark # train and compare the full model zoo
python -m src.pipeline.train --check # report whether retraining is due
Protocol: one scaffold-aware split; every candidate trained on TRAIN and scored on VALIDATION; selection made on VALIDATION alone; the selection refit on TRAIN+VALIDATION and scored once on TEST. Random Forest is always trained and always recorded as the baseline.
Models are compared on prevalence-adjusted PR-AUC, because raw PR-AUC is bounded below by class prevalence and is not comparable across datasets with different balance. See docs/ARCHITECTURE.md.
python -m src.pipeline.predict # screen what is new
python -m src.pipeline.predict --all # rescore everything
python -m src.pipeline.predict --smiles "CC(=O)Oc1ccccc1C(=O)O" # ad-hoc, nothing stored
python -m src.pipeline.run --incremental
Refreshes the approved-drug library, processes only unprocessed molecules, and screens only unscored ones. Bulk bioactivity is not re-pulled.
A new drug never triggers retraining. It is fingerprinted and scored with the model that already exists.
Retraining is driven by new labelled bioactivity data:
python -m src.pipeline.train --check # is retraining due?
python -m src.pipeline.train --benchmark # train, evaluate, compare, promote
A challenger is promoted only if it clears the absolute quality floors and
beats the incumbent by the configured margin. A worse model never replaces a
better one; it is kept as a CANDIDATE with the decision recorded.
python -m src.pipeline.dock # all targets
python -m src.pipeline.dock --target sa_dhfr --limit 10
Targets are declared in configs/targets.yaml with the
PDB entry, chain, binding-site definition and a written selection rationale. The
search box is computed from the structure itself, never hard-coded.
The -7.0 kcal/mol figure from the project brief is exposed as a configurable
display threshold, not a scientific cutoff.
Ligands above docking.max_ligand_rotatable_bonds / max_ligand_heavy_atoms
are skipped, because Vina's search neither converges nor stays reliable on very
flexible molecules. The number skipped is reported per target, and those
compounds still receive ML predictions — they simply carry no docking evidence.
python -m src.pipeline.clinical --limit 50 # shortlisted candidates only
python -m src.pipeline.clinical --all --limit 5000 # the whole approved library
python -m src.pipeline.clinical --retry-failed # only the ones that errored
python -m src.pipeline.clinical --refresh --limit 200 # re-query, refresh records
The stage is resumable. Each medicine is committed before the next lookup
starts, and a medicine already recorded in clinical_queries is skipped, so an
interrupted sweep is restarted by running the same command again. --delay
(default 0.35 s) paces the requests; the full library takes roughly 25 minutes.
Orange Book ingredient strings are normalised into a registry search term before
the request — combination products are named like
TRISULFAPYRIMIDINES (SULFADIAZINE; SULFAMERAZINE), and the bracket has to come
off or the registry answers HTTP 400.
A lookup that fails is stored with status = 'failed' and its error, not
silently dropped, which is what makes --retry-failed meaningful.
Queries ClinicalTrials.gov for the selected medicines. Trials are tagged
amr_related only when the study's own title or conditions name an
infection context — intervention text is deliberately excluded, so an antibiotic
given as background therapy in an oncology trial is not miscounted as AMR
evidence.
Drugs that return nothing are still recorded, so the dashboard distinguishes "no trials found" from "never looked".
streamlit run app/streamlit_app.py
See docs/CODEBASE_MAP.md for a file-by-file map of the repository.
Thirteen pages: Overview, Drug screening, Candidate explorer, Drug details, Case study, Medicine x Disease, Molecular analysis, Docking and 3D, Clinical evidence, Model and dataset, Pipeline, Retraining and Run history.
Medicine x Disease answers "could this medicine matter for this condition?" from stored evidence only. It grades each pairing Clinical, Experimental, Computational, No evidence found or Not yet checked, and shows a probability only where a trained model exists - that is, for the four bacteria and nothing else.
Opening the dashboard performs no computation beyond reading stored results.
DEMO.md is a scripted walkthrough of the dashboard with the exact navigation, the demo candidate and the expected values. WEBSITE_UI_HANDOFF.md specifies the production website that will be built from this prototype; nothing in it is built yet.
python scripts/build_demo.py
AMR_DB_PATH=data/demo/amr_demo.sqlite streamlit run app/streamlit_app.py
Builds a deterministic subset of a completed run with every row flagged
is_demo = 1, so the dashboard shows a DEMO DATA banner. It contains real
data, clearly labelled — nothing is fabricated — and needs no network access.
pytest # full suite
pytest tests/test_labeling.py # one module
pytest -q --tb=short
The suite covers SMILES validation and canonicalisation, salt stripping, fingerprint generation and round-tripping, descriptors, the full labelling strategy including censored relations, scaffold-split integrity and leakage, the model zoo, evaluation metrics on degenerate inputs, registry promotion rules, ranking, database constraints, API parsing against malformed and failing responses, docking site derivation and Vina output parsing, and an end-to-end run from raw records to ranked candidates.
No test touches the network or the project database.
See docs/LIMITATIONS.md for the full statement. The most important:
match_method.predictions is unique per
(molecule, pathogen, model version), so a retrain adds a generation rather
than replacing one. The dashboard filters every prediction query to the ACTIVE
model; anything reading predictions directly must do the same or one medicine
will appear with two different probabilities.| The system says | It means | It does not mean |
|---|---|---|
| ML probability 0.92 | structurally similar to compounds active against this species in published assays | the drug works, or that it overcomes resistance |
| Docking score −9.1 | the pose scored well in a rigid-receptor calculation | the drug binds in vivo |
| 12 clinical trials | the compound has registered human clinical history | it has been tested against resistant infection |
| Rank 1 | highest combined computational evidence in this run | it is the best drug |
Approved vocabulary: predicted candidate, computationally promising, prioritised candidate, candidate for experimental validation. Never best drug, winner, confirmed treatment or cure.
# Install
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
# Pipeline stages
python -m src.pipeline.ingest # ChEMBL + FDA Orange Book
python -m src.pipeline.process # standardise, fingerprint, label
python -m src.pipeline.train --benchmark # train, compare, promote
python -m src.pipeline.predict # screen with the active model
python -m src.pipeline.predict --all # rescore everything after a promotion
python -m src.pipeline.dock # AutoDock Vina on top candidates
python -m src.pipeline.clinical # ClinicalTrials.gov evidence
# Orchestration
python -m src.pipeline.run # everything, in order
python -m src.pipeline.run --incremental # only what is new
python -m src.pipeline.run --skip-dock # skip a stage
python -m src.pipeline.train --check # retraining status
# Dashboard
streamlit run app/streamlit_app.py
python scripts/build_demo.py # deterministic offline demo
# Utilities
python scripts/check_environment.py # diagnose packages, Vina, network
python scripts/backfill_curves.py --active # regenerate stored ROC/PR curve points
python scripts/responsive_qa.py # measured layout QA at 1440/1024/760/400px
python -m scripts.promote_clean_dataset_models --dry-run # promote on dataset integrity
# Tests
pytest
backfill_curves.py recomputes a stored evaluation from the saved model
artefact and the recorded test partition. It verifies that the recomputed
ROC-AUC reproduces the stored value before writing anything, and skips the model
if it does not — so it can never attach a chart that disagrees with the metric
beside it.
pyproject.toml.configs/config.yaml and is hashed into
the dataset version.random_seed governs splitting, model initialisation, conformer
generation and the Vina search.Code in this repository is a research prototype. The data it retrieves belongs to its sources and remains under their terms: ChEMBL (EMBL-EBI, CC BY-SA), the FDA Orange Book and openFDA (US public domain), ClinicalTrials.gov (NIH), and the RCSB Protein Data Bank.