This repository contains the reproducible implementation associated with the MIWAI 2026 accepted paper:
Drug Repositioning through Interpretable Link Prediction in Drug–Disease Networks
The project formulates drug repositioning as a link prediction task over a bipartite drug–disease network derived from repoDB. The final pipeline combines an interpretable topological predictor, based on Katz paths of length 3 and 5, with a lightweight chemical similarity layer derived from PubChem/DrugBank molecular descriptors. External post-ranking pharmacological assessment is performed using ChEMBL-derived indication and mechanism annotations.
Note: Predicted drug–disease links are computational repositioning hypotheses. They are not biomedical, experimental, or clinical validation.
The pipeline evaluates whether known drug–disease associations can be recovered from the structure of a bipartite biomedical network and then uses the selected model to rank unknown drug–disease pairs as computational repositioning hypotheses.
The main components are:
- repoDB parsing and cleaning
- PubChem/DrugBank chemical enrichment
- Bipartite drug–disease network construction
- Topological link prediction using Katz L3+L5
- Chemical similarity support using Morgan fingerprints and Tanimoto similarity
- Hybrid scoring
- Final candidate ranking
- External post-ranking ChEMBL pharmacological assessment
- Top 1%, low-ranking 1%, and degree-matched ChEMBL control assessment
- End-to-end reproducible execution through
RepMed.py
This repository contains the consolidated final pipeline used for the Katz L3+L5 scoring, chemical support, hybrid candidate ranking, and post-ranking ChEMBL pharmacological assessment. The broader model-selection benchmark reported in the paper, including additional baselines such as Jaccard, Adamic–Adar, node2vec, GCN, and GraphSAGE, is described in the manuscript and may be released separately.
The core graph is a bipartite network:
G = (U, V, E)
where:
Urepresents drug nodes;Vrepresents disease nodes;Erepresents known drug–disease associations.
The main topological predictor is Katz L3+L5:
s_L3+L5(u,v) = beta^3 * A^3(u,v) + beta^5 * A^5(u,v)
where u is a drug node and v is a disease node.
In the paper notation:
betais the Katz attenuation parameter;alphais the topological weight in the hybrid score;gammais the chemical-support weight in the hybrid score.
The hybrid score combines topological and chemical evidence:
s_hybrid(u,v) = alpha * s_Katz(u,v) + gamma * s_chem(u,v)
In the final configuration used in the manuscript:
- Katz attenuation:
beta = 0.05 - topological weight:
alpha = 0.95 - chemical support weight:
gamma = 0.05
The chemical component is based on RDKit Morgan fingerprints and Tanimoto similarity. Drugs without valid chemical descriptors receive zero chemical support, without additional penalty.
The final hybrid model improved held-out link prediction performance over the topology-only Katz L3+L5 baseline.
| Method | ROC-AUC | Average Precision | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|---|---|
| Katz L3+L5 | 0.8581 | 0.8906 | 0.8500 | 0.8941 | 0.7942 | 0.8412 |
| Hybrid Katz + Chemical | 0.8911 | 0.9147 | 0.8699 | 0.8863 | 0.8486 | 0.8670 |
The hybrid model improved ROC-AUC, average precision, recall, and F1-score while preserving the dominant contribution of the interpretable graph-based score.
ChEMBL was used only as an external post-ranking pharmacological assessment layer. It was not used during training, model selection, scoring, or candidate ranking.
To reduce the risk of cherry-picking and degree/popularity artifacts, the final assessment compares:
- Top 1% of the saved final ranking: 2,500 candidate pairs
- Low-ranking 1% control: 2,500 candidate pairs from the lower tail of the same saved ranking
- Degree-matched control: 2,500 candidate pairs selected to assess whether ChEMBL support could be explained by drug or disease popularity
| Candidate set | n | Mechanism annotations | Direct/Near Matches | Direct/Related Support |
|---|---|---|---|---|
| Top 1% | 2,500 | 1,325 | 98 | 262 (10.48%) |
| Low 1% control | 2,500 | 1,385 | 23 | 95 (3.80%) |
| Degree-matched control | 2,500 | 1,544 | 55 | 162 (6.48%) |
The top 1% showed higher ChEMBL support than both controls. The degree-matched control was higher than the low-ranking control, indicating that degree/popularity contributes to external support. However, the top 1% remained enriched, suggesting that degree alone does not explain the observed pharmacological support.
These results provide external pharmacological context for the ranking, not clinical validation.
A typical project structure is:
project_root/
|
├── project/
│ └── RepMed.py
|
├── data/
│ ├── full.csv
│ ├── PubChem_search_records.json
│ └── RMResults/
|
├── requirements.txt
├── CITATION.cff
├── LICENSE
└── README.md
The repository may also include an additional preproject/ folder. This folder preserves the initial exploratory implementation used during the early development stage of the project. It contains first experimental scripts and intermediate analyses that supported the design of the final pipeline.
The preproject/ materials are kept for transparency and historical reproducibility, but the main reproducible implementation associated with the final manuscript is the consolidated RepMed.py pipeline in project/.
A typical extended structure is:
project_root/
|
├── preproject/
│ └── initial exploratory scripts and early experiments
|
├── project/
│ └── RepMed.py
|
├── data/
│ ├── full.csv
│ ├── PubChem_search_records.json
│ └── RMResults/
|
├── requirements.txt
├── CITATION.cff
├── LICENSE
└── README.md
The expected input files are:
| File | Description |
|---|---|
full.csv |
repoDB drug–disease association file |
PubChem_search_records.json |
PubChem/DrugBank chemical structure records |
By default, the script expects the following layout:
project_root/
|
├── project/
│ └── RepMed.py
|
└── data/
├── full.csv
├── PubChem_search_records.json
└── RMResults/
Data files are not necessarily redistributed with this repository. Users should obtain the original data from the appropriate data providers and respect the corresponding licenses and terms of use.
The consolidated pipeline is implemented in:
project/RepMed.py
It performs the full workflow from input files to final outputs.
Default execution from inside the project/ folder:
python RepMed.pyParameterized execution:
python RepMed.py \
--repodb "../data/full.csv" \
--pubchem "../data/PubChem_search_records.json" \
--out "../data/RMResults" \
--reuse-descriptors \
--reuse-similarity \
--run-chemblOn Windows PowerShell:
python .\RepMed.py `
--repodb "..\data\full.csv" `
--pubchem "..\data\PubChem_search_records.json" `
--out "..\data\RMResults" `
--reuse-descriptors `
--reuse-similarity `
--run-chemblUseful fast/debug run:
python RepMed.py \
--max-api-drugs 100 \
--candidate-save-top-n 50000Paper-oriented run:
python RepMed.py \
--repodb "../data/full.csv" \
--pubchem "../data/PubChem_search_records.json" \
--out "../data/RMResults" \
--alpha-katz 0.95 \
--gamma-chemical 0.05 \
--katz-beta 0.05 \
--candidate-save-top-n 250000 \
--chembl-set-size 2500 \
--reuse-descriptors \
--reuse-similarity \
--run-chemblFor compatibility with earlier local runs, the script may also accept --beta-chemical as an alias for --gamma-chemical. In the paper, the chemical weight is denoted by gamma, while beta is reserved for the Katz attenuation parameter.
| Parameter | Default | Description |
|---|---|---|
--katz-beta |
0.05 |
Katz attenuation factor |
--alpha-katz |
0.95 |
Hybrid weight for normalized Katz score |
--gamma-chemical |
0.05 |
Hybrid weight for normalized chemical support |
--test-size |
0.20 |
Fraction of positive edges held out for test evaluation |
--seed |
42 |
Random seed |
--min-chemical-similarity |
0.20 |
Minimum Tanimoto similarity for chemical support |
--chemical-topk |
20 |
Number of chemical neighbors retained per drug |
--morgan-radius |
2 |
Morgan fingerprint radius |
--morgan-bits |
2048 |
Morgan fingerprint bit vector size |
--candidate-save-top-n |
250000 |
Number of final ranking rows saved |
--chembl-set-size |
2500 |
Number of candidates per ChEMBL comparison set |
--run-chembl |
disabled | Enables ChEMBL post-ranking pharmacological assessment |
The pipeline generates several outputs, including:
| Output | Description |
|---|---|
RM1_katz_l3_l5_test_scores.csv |
Katz L3+L5 test predictions |
RM2_hybrid_katz_chemical_test_scores.csv |
Hybrid model test predictions |
RM3_final_results_table.csv |
Main performance comparison |
RM4_final_hybrid_candidate_ranking.csv |
Final ranked candidate drug–disease pairs |
RM5_paper_table_combined_candidate_examples.csv |
Representative candidate examples |
RM6_chembl_assessment_candidates.csv |
ChEMBL assessment for representative candidates |
RM7_chembl_assessment_summary.md |
ChEMBL assessment summary for representative candidates |
chembl_top1pct_low1pct_degree_matched_assessment.csv |
Comparative ChEMBL assessment for top, low-ranking, and degree-matched sets |
chembl_top1pct_low1pct_degree_matched_summary.csv |
Aggregated ChEMBL comparison |
chembl_top1pct_low1pct_degree_matched_summary.json |
JSON summary of ChEMBL comparison |
RM8_RepMedHybrid_summary.json |
Full reproducibility summary |
RM9_RepMedHybrid_report.md |
Markdown report of the run |
README_RepMed.md |
Additional execution notes generated by the pipeline |
Some output filenames preserve the word validation for compatibility with earlier versions of the pipeline. Conceptually, ChEMBL is used here only as post-ranking external pharmacological assessment/context and not as clinical validation.
The core pipeline reconstructs:
- 2,326 drug nodes
- 1,451 disease nodes
- 10,469 drug–disease edges
- 3,364,557 unknown candidate pairs
- 250,000 saved ranking rows
The expanded ChEMBL assessment compares three 2,500-candidate sets:
- top 1% of the saved final ranking
- low-ranking 1% control
- degree-matched control
The ChEMBL assessment depends on external API queries, which may increase runtime and may produce minor differences if external records change over time.
The full candidate-ranking step may require several GB of RAM because it scores all unobserved drug–disease pairs before saving the selected ranking rows.
Main Python dependencies include:
pandasnumpyscikit-learnscipyrequestsrdkit
Install dependencies with:
pip install -r requirements.txtIf RDKit installation through pip is not available in your environment, use Conda:
conda install -c conda-forge rdkitA minimal requirements.txt may include:
numpy
pandas
scipy
scikit-learn
requests
rdkit
tabulate
The tabulate package is recommended because the script uses pandas Markdown table output in generated reports.
This project uses data derived from:
- repoDB — drug repositioning validation resource
- DrugBank Live Substance data via PubChem
- ChEMBL — external post-ranking pharmacological assessment only
ChEMBL is not used for training, scoring, model selection, or candidate ranking.
Users should consult the original data providers for licensing, citation, access, and redistribution conditions.
This repository supports early-stage computational candidate prioritization.
Important limitations:
- The task is missing-edge recovery and candidate ranking within a known drug–disease graph.
- The evaluation is not cold-start generalization to unseen drugs or diseases.
- Sampled unobserved drug–disease pairs are operational negatives, not confirmed biomedical negatives.
- ChEMBL is used only after ranking as external pharmacological context.
- ChEMBL support does not constitute clinical validation.
- Morgan fingerprints and Tanimoto similarity do not fully capture pharmacodynamics, pharmacokinetics, targets, or disease biology.
- Hub drugs and diseases may influence path-based ranking.
Predicted candidates should be interpreted as computational hypotheses requiring independent biomedical review, literature assessment, and, where appropriate, experimental or clinical validation.
Citation information for the associated MIWAI 2026 paper will be added after publication.
Preliminary citation format:
Ceulin, W. L. C., Costa Pereira, J., Camacho, R., Dutra, I.
Drug Repositioning through Interpretable Link Prediction in Drug–Disease Networks.
Accepted for oral presentation at MIWAI 2026.
For repoDB, cite:
Brown, A.S., Patel, C.J. repoDB: A New Standard for Drug Repositioning Validation.
Scientific Data 4, 170029 (2017).
This project is licensed under the PolyForm Noncommercial License 1.0.0.
Noncommercial use, including research, education, personal study, and public-interest purposes, is permitted under the terms of the license. Commercial use is not permitted without separate authorization from the copyright holder.
See the LICENSE file for the full license terms.
This repository is associated with an accepted MIWAI 2026 paper.
The code and outputs are intended for reproducibility, inspection, and future extension of the proposed drug repositioning workflow.