# DRCMDA **Repository Path**: Tomhappy/DRCMDA ## Basic Information - **Project Name**: DRCMDA - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-08 - **Last Updated**: 2026-08-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DRCMDA DRCMDA is a novel drug repositioning framework that integrates cluster-aware structured mask reconstruction with diffusion-based metapath augmentation. ## Repository Structure ```text DRCMDA_release/ ├── train.py # Main cross-validation training entry ├── drcmda/ │ ├── data.py # Dataset loading, preprocessing, graph construction │ ├── model.py # DRCMDA prediction model │ ├── layers.py # HGT layers, fusion layers, contrastive losses │ ├── metrics.py # Evaluation metrics │ ├── sampling.py # Metapath and negative sampling utilities │ ├── modules/ │ │ ├── csmr/ # Cluster-guided similarity matrix reconstruction │ │ └── metapath/ # Diffusion-based metapath augmentation │ └── pretraining/sgmae/ # SGMAE encoder used to precompute entity embeddings ├── scripts/ │ └── precompute_embeddings.py # Regenerate SGMAE embeddings ├── data/ # Benchmark datasets ├── embeddings/ # Precomputed drug, disease, and protein embeddings └── requirements.txt ``` ## Installation Create a clean Python environment and install the required dependencies: ```bash python -m venv .venv source .venv/bin/activate pip install -r requirements.txt ``` DGL wheels are tied to the local PyTorch and CUDA setup. The included `requirements.txt` uses the CPU-compatible DGL package tested for this release. For GPU training, install the DGL build that matches your CUDA and PyTorch versions before running the model. ## Quick Start Run the default 10-fold experiment on the C-dataset: ```bash python train.py --dataset C-dataset --device 0 ``` Use CPU explicitly when a GPU is not available: ```bash python train.py --dataset C-dataset --device cpu ``` For a fast smoke test: ```bash python train.py \ --dataset C-dataset \ --device cpu \ --epochs 1 \ --k-fold 2 \ --diffusion-epochs 1 \ --diffusion-timesteps 10 \ --diffusion-batch-size 1 ``` Training prints fold-level AUROC, AUPR, accuracy, precision, recall, F1, MCC, and final mean metrics across folds. ## Regenerating Embeddings Precomputed SGMAE embeddings are provided under `embeddings/`. To regenerate them for a dataset: ```bash python scripts/precompute_embeddings.py --dataset C-dataset --device 0 ``` The generated `drug.csv`, `disease.csv`, and `protein.csv` files are written to `embeddings//`. ## Key Arguments | Argument | Description | Default | | --- | --- | --- | | `--dataset` | Benchmark dataset: `F-dataset`, `C-dataset`, or `B-dataset` | `C-dataset` | | `--device` | `auto`, `cpu`, or a CUDA index such as `0` | `auto` | | `--epochs` | Number of DRCMDA training epochs per fold | `300` | | `--k-fold` | Number of cross-validation folds | `10` | | `--neighbor` | KNN size for similarity graphs | `5` | | `--n-neg` | Number of two-hop negative candidates | `30` | | `--diffusion-epochs` | Training epochs for metapath diffusion augmentation | `500` | | `--diffusion-timesteps` | Diffusion timesteps | `1000` | | `--l-con-rate` | Contrastive regularization weight | `1e-5` | Run `python train.py --help` for the full configuration. ## Reproducibility Notes The training script fixes Python, NumPy, and PyTorch random seeds through `--seed`. Reported performance may still vary slightly across hardware, PyTorch/DGL versions, and CUDA kernels. For manuscript-scale reproduction, use the default 10-fold setting and a GPU-enabled DGL installation. ## Citation If this code supports your research, please cite the corresponding DRCMDA manuscript after publication.