File size: 2,885 Bytes
4a8b134 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | # 𧬠Drug Repurposing API - QUICK REFERENCE
## π Get Started in 60 Seconds
```bash
# Windows
start.bat
# Linux/Mac
chmod +x start.sh && ./start.sh
```
Wait for "β
SETUP COMPLETE" message, then visit: **http://localhost:8000/docs**
---
## π― Main Endpoint
### POST `/api/v1/screen`
**Request:**
```json
{
"disease_name": "Type 2 Diabetes",
"min_score": 0.5,
"top_n_targets": 10,
"known_drugs": ["Metformin"]
}
```
**Response:**
```json
{
"disease": "Type 2 Diabetes",
"total_targets": 10,
"total_drugs": 200,
"total_predictions": 2000,
"top_results": [
{
"drug_name": "Drug_DB00838",
"target_symbol": "GCK",
"score": 0.92,
"status": "β
Known Treatment"
}
],
"success": true,
"message": "β
Screening completed in 45.23s"
}
```
---
## π Other Endpoints
| Endpoint | Method | Purpose |
|----------|--------|---------|
| `/health` | GET | Check API status |
| `/api/v1/model-status` | GET | Check AI model info |
| `/api/v1/disease-targets` | POST | Get disease targets |
| `/api/v1/protein-sequences` | POST | Get protein sequences |
| `/api/v1/drug-library` | GET | Get drug library |
---
## π Check Status
```bash
curl http://localhost:8000/health
curl http://localhost:8000/api/v1/model-status
```
---
## βοΈ Configuration
Edit `app/config.py` to adjust:
- `MAX_DRUGS_FOR_DEMO`: Number of drugs to screen
- `MAX_TARGETS`: Number of disease targets
- `BATCH_SIZE`: Optimization for GPU/CPU
---
## π Troubleshooting
| Problem | Solution |
|---------|----------|
| API won't start | Ensure Python 3.10+ installed |
| DeepPurpose missing | `pip install git+https://github.com/kexinhuang12345/DeepPurpose.git` |
| GPU not detected | Install PyTorch CUDA: `pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121` |
| Slow predictions | System uses CPU - GPU dramatically faster |
| No API docs | Visit http://localhost:8000/docs |
---
## π Performance
| Config | Speed | Throughput |
|--------|-------|-----------|
| GPU | ~5s | 1,200 pairs/sec |
| CPU | ~30s | 67 pairs/sec |
---
## π Full Documentation
- **PRODUCTION_GUIDE.md** - Complete guide
- **IMPLEMENTATION_SUMMARY.md** - What was built
- **http://localhost:8000/docs** - Interactive API docs
---
## π Pipeline Stages
```
Disease Input
β
[1] Disease β Targets (OpenTargets API)
β
[2] Targets β Sequences (UniProt API)
β
[3] Load Drug Library (TDC)
β
[4] AI Screening (DeepPurpose MPNN_CNN)
β GPU CUDA acceleration
β
[5] Process Results
β
Ranked Drug Candidates
```
---
## π§ Dependencies
**Minimum**: Python 3.10, pip, 8GB RAM
**Recommended**: GPU with CUDA 12.0+, 16GB RAM
**Auto-installed by start scripts**:
- FastAPI
- PyTorch
- DeepPurpose (AI model)
- TDC (drug data)
---
**Version**: 1.0.0 | **Status**: Production-Ready β
|