yassinekolsi commited on
Commit
a85e132
·
1 Parent(s): dedd15b

fix: resolve 3Dmol viewer background color crash

Browse files
TECHNICAL_REPORT.md ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BioFlow: AI-Powered Drug-Target Interaction Platform
2
+ ## Technical Report - January 2026
3
+
4
+ ---
5
+
6
+ ## Table of Contents
7
+ 1. [Executive Summary](#executive-summary)
8
+ 2. [System Architecture](#system-architecture)
9
+ 3. [Core Technologies](#core-technologies)
10
+ 4. [Pipeline Implementation](#pipeline-implementation)
11
+ 5. [Model Training & Results](#model-training--results)
12
+ 6. [Qdrant Vector Database Integration](#qdrant-vector-database-integration)
13
+ 7. [FastAPI Backend](#fastapi-backend)
14
+ 8. [Frontend Application](#frontend-application)
15
+ 9. [Langflow Integration](#langflow-integration)
16
+ 10. [Current Status](#current-status)
17
+ 11. [Future Roadmap](#future-roadmap)
18
+
19
+ ---
20
+
21
+ ## Executive Summary
22
+
23
+ **BioFlow** is an end-to-end AI-powered drug discovery platform designed for predicting Drug-Target Interactions (DTI). The system combines deep learning models (DeepPurpose), vector similarity search (Qdrant), and a modern React-based frontend to enable researchers to:
24
+
25
+ - Train and evaluate DTI prediction models on benchmark datasets
26
+ - Perform similarity search across drug-target embedding space
27
+ - Visualize molecular structures in 2D and 3D
28
+ - Build visual pipelines using Langflow for no-code experimentation
29
+
30
+ ### Key Achievements
31
+ - ✅ Trained models on **3 benchmark datasets** (KIBA, DAVIS, BindingDB_Kd)
32
+ - ✅ Best Concordance Index (CI): **0.805** on BindingDB_Kd
33
+ - ✅ Indexed **23,531 drug-target pairs** in Qdrant vector database
34
+ - ✅ Real-time similarity search via FastAPI backend
35
+ - ✅ Interactive 2D/3D molecular visualization
36
+ - ✅ Langflow pipeline for no-code DTI prediction
37
+
38
+ ---
39
+
40
+ ## System Architecture
41
+
42
+ ```
43
+ ┌─────────────────────────────────────────────────────────────────────────────┐
44
+ │ BioFlow Architecture │
45
+ ├─────────────────────────────────────────────────────────────────────────────┤
46
+ │ │
47
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │
48
+ │ │ Frontend │────▶│ FastAPI │────▶│ Qdrant │ │
49
+ │ │ (Next.js) │ │ Backend │ │ Vector Database │ │
50
+ │ │ Port 3000 │ │ Port 8001 │ │ Port 6333 │ │
51
+ │ └──────────────┘ └──────────────┘ └──────────────────────────┘ │
52
+ │ │ │ ▲ │
53
+ │ │ │ │ │
54
+ │ ▼ ▼ │ │
55
+ │ ┌──────────────┐ ┌──────────────┐ ┌─────────┴──────────────┐ │
56
+ │ │ 3Dmol.js │ │ DeepPurpose │ │ Ingestion Pipeline │ │
57
+ │ │ Smiles- │ │ Model │ │ (ingest_qdrant.py) │ │
58
+ │ │ Drawer │ │ (PyTorch) │ └────────────────────────┘ │
59
+ │ └──────────────┘ └──────────────┘ │
60
+ │ │ │
61
+ │ ▼ │
62
+ │ ┌──────────────┐ ┌────────────────────────┐ │
63
+ │ │ Langflow │────▶│ Visual Pipeline │ │
64
+ │ │ Port 7860 │ │ (DTI Orchestrator) │ │
65
+ │ └──────────────┘ └────────────────────────┘ │
66
+ │ │
67
+ └─────────────────────────────────────────────────────────────────────────────┘
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Core Technologies
73
+
74
+ ### Backend Stack
75
+ | Component | Technology | Purpose |
76
+ |-----------|------------|---------|
77
+ | ML Framework | **DeepPurpose** (PyTorch) | Drug-Target Interaction prediction |
78
+ | Vector DB | **Qdrant** | Similarity search on embeddings |
79
+ | API Server | **FastAPI** + Uvicorn | REST API for frontend |
80
+ | Data Source | **TDC (Therapeutics Data Commons)** | Benchmark DTI datasets |
81
+ | Pipeline UI | **Langflow** | No-code visual pipeline builder |
82
+
83
+ ### Frontend Stack
84
+ | Component | Technology | Purpose |
85
+ |-----------|------------|---------|
86
+ | Framework | **Next.js 16** (App Router) | React server components |
87
+ | UI Library | **Shadcn/UI** + Radix | Component system |
88
+ | Styling | **Tailwind CSS** | Utility-first CSS |
89
+ | 3D Viz | **3Dmol.js** | Protein structure viewer |
90
+ | 2D Viz | **smiles-drawer** | Molecule structure rendering |
91
+ | Package Manager | **pnpm** | Fast, disk-efficient |
92
+
93
+ ---
94
+
95
+ ## Pipeline Implementation
96
+
97
+ ### 1. Training Pipeline (`deeppurpose002.py`)
98
+
99
+ The training script is a comprehensive CLI tool that:
100
+
101
+ ```bash
102
+ python deeppurpose002.py --dataset KIBA --epochs 10 --drug_enc Morgan --target_enc CNN
103
+ ```
104
+
105
+ **Features:**
106
+ - Automatic GPU detection (CUDA support)
107
+ - Multiple dataset support: DAVIS, KIBA, BindingDB_Kd, BindingDB_Ki, BindingDB_IC50
108
+ - Label transformation: `paffinity_nm` (converts nM to -log10 scale)
109
+ - Comprehensive metrics: MSE, RMSE, MAE, Pearson, Spearman, Concordance Index
110
+ - Automatic visualization generation (scatter plots, residuals, sorted curves)
111
+
112
+ **Encoding Configuration:**
113
+ ```python
114
+ MODEL_CONFIG = {
115
+ "drug_encoding": "Morgan", # Morgan fingerprints (1024-bit)
116
+ "target_encoding": "CNN", # CNN for protein sequences
117
+ "cls_hidden_dims": [1024, 1024, 512],
118
+ "hidden_dim_drug": 128,
119
+ "hidden_dim_protein": 128,
120
+ }
121
+ ```
122
+
123
+ ### 2. Ingestion Pipeline (`ingest_qdrant.py`)
124
+
125
+ Converts trained model embeddings into searchable vectors:
126
+
127
+ ```
128
+ [1/6] Load Model (model.pt + config.pkl)
129
+ [2/6] Load Dataset from TDC (KIBA test split)
130
+ [3/6] Generate Embeddings (no shuffle to preserve order)
131
+ [4/6] Compute PCA projections (drug, target, combined)
132
+ [5/6] Connect to Qdrant (localhost:6333)
133
+ [6/6] Upload points with payloads
134
+ ```
135
+
136
+ **Vector Schema:**
137
+ ```python
138
+ vectors_config = {
139
+ "drug": VectorParams(size=128, distance=Distance.COSINE),
140
+ "target": VectorParams(size=128, distance=Distance.COSINE),
141
+ }
142
+ ```
143
+
144
+ **Payload Structure:**
145
+ ```json
146
+ {
147
+ "smiles": "CC(=O)OC1=CC=CC=C1C(=O)O",
148
+ "target_seq": "MKTAYIAK...",
149
+ "label_true": 7.2,
150
+ "pca_drug": [0.12, -0.34, 0.56],
151
+ "pca_target": [-0.21, 0.78, 0.11],
152
+ "pca_combined": [0.45, -0.12, 0.67],
153
+ "affinity_class": "high" // high: >7, medium: 5-7, low: <5
154
+ }
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Model Training & Results
160
+
161
+ ### Benchmark Performance
162
+
163
+ | Dataset | Samples | CI | Pearson | MSE | Training Time |
164
+ |---------|---------|-----|---------|-----|---------------|
165
+ | **BindingDB_Kd** | 42,227 | **0.805** | 0.768 | 0.667 | 1h 49m |
166
+ | **KIBA** | 117,656 | 0.703 | 0.522 | 0.0008 | 3h 42m |
167
+ | **DAVIS** | 25,772 | 0.786 | 0.545 | 0.468 | 9m |
168
+
169
+ ### Best Model Configuration
170
+ - **Selected Run:** `20260125_104915_KIBA`
171
+ - **Hardware:** NVIDIA GeForce RTX 3070 Laptop GPU
172
+ - **Epochs:** 10
173
+ - **Batch Size:** 256
174
+ - **Learning Rate:** 1e-4
175
+ - **Split:** 80/10/10 (train/val/test)
176
+
177
+ ### Metrics Explanation
178
+ - **Concordance Index (CI):** Probability that predictions preserve true ordering (0.5 = random, 1.0 = perfect)
179
+ - **Pearson Correlation:** Linear correlation between true and predicted values
180
+ - **MSE:** Mean Squared Error (lower is better)
181
+
182
+ ---
183
+
184
+ ## Qdrant Vector Database Integration
185
+
186
+ ### Collection: `bio_discovery`
187
+
188
+ **Statistics:**
189
+ - Total Vectors: **23,531** drug-target pairs
190
+ - Vector Dimensions: 128 (drug) + 128 (target)
191
+ - Distance Metric: Cosine Similarity
192
+ - Pre-computed PCA: 3D projections for visualization
193
+
194
+ ### Search Capabilities
195
+
196
+ **1. Drug Similarity Search**
197
+ ```python
198
+ # Input: SMILES string
199
+ query = "CC(=O)Nc1ccc(O)cc1" # Acetaminophen
200
+ # Output: Top-K similar drugs by Morgan fingerprint embedding
201
+ ```
202
+
203
+ **2. Target Similarity Search**
204
+ ```python
205
+ # Input: Protein sequence
206
+ query = "MKTAYIAKQRQISFVKSHFSRQLE..."
207
+ # Output: Top-K similar targets by CNN embedding
208
+ ```
209
+
210
+ **3. Text Search (Fallback)**
211
+ ```python
212
+ # Input: Partial SMILES or keyword
213
+ # Output: Substring matches in payload
214
+ ```
215
+
216
+ ### API Endpoints
217
+
218
+ | Endpoint | Method | Description |
219
+ |----------|--------|-------------|
220
+ | `/api/search` | POST | Vector similarity search |
221
+ | `/api/points` | GET | Get points for 3D visualization |
222
+ | `/api/stats` | GET | Collection statistics |
223
+ | `/health` | GET | Service health check |
224
+
225
+ ---
226
+
227
+ ## FastAPI Backend
228
+
229
+ ### Server: `server/api.py`
230
+
231
+ **Startup Sequence:**
232
+ ```
233
+ [STARTUP] Loading DeepPurpose model...
234
+ [STARTUP] Model loaded from runs\20260125_104915_KIBA\model.pt
235
+ [STARTUP] Using device: cuda
236
+ [STARTUP] Connecting to Qdrant...
237
+ [STARTUP] Connected. Collections: ['bio_discovery']
238
+ [STARTUP] Ready!
239
+ ```
240
+
241
+ **Key Features:**
242
+ 1. **Model Caching:** Model loaded once at startup (not per-request)
243
+ 2. **Device Override:** Fixes DeepPurpose's global device variable for GPU inference
244
+ 3. **CORS Enabled:** Allows frontend on port 3000
245
+ 4. **Error Handling:** Fallback to text search if encoding fails
246
+
247
+ ### Direct Encoding (No data_process)
248
+
249
+ The API uses direct encoding to avoid DeepPurpose's `data_process` overhead:
250
+
251
+ ```python
252
+ # Drug encoding (Morgan fingerprints)
253
+ from DeepPurpose.utils import smiles2morgan
254
+ morgan_fp = smiles2morgan(smiles, radius=2, nBits=1024)
255
+ vector = model.model.model_drug(torch.tensor([morgan_fp]))
256
+
257
+ # Target encoding (CNN)
258
+ from DeepPurpose.utils import trans_protein
259
+ target_encoding = trans_protein(sequence)
260
+ vector = model.model.model_protein(torch.tensor([target_encoding]))
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Frontend Application
266
+
267
+ ### Page Structure
268
+
269
+ ```
270
+ ui/app/
271
+ ├── page.tsx # Landing page
272
+ ├── layout.tsx # Root layout (ThemeProvider)
273
+ └── dashboard/
274
+ ├── page.tsx # Dashboard home
275
+ ├── discovery/ # Drug discovery search
276
+ │ └── page.tsx
277
+ ├── explorer/ # Data exploration
278
+ │ ├── page.tsx
279
+ │ ├── chart.tsx
280
+ │ └── components.tsx
281
+ ├── molecules-2d/ # 2D molecule viewer
282
+ │ ├── page.tsx
283
+ │ └── _components/
284
+ │ └── Smiles2DViewer.tsx
285
+ ├── molecules-3d/ # 3D molecule viewer
286
+ │ ├── page.tsx
287
+ │ └── _components/
288
+ │ └── Molecule3DViewer.tsx
289
+ └── proteins-3d/ # 3D protein viewer
290
+ ├── page.tsx
291
+ └── _components/
292
+ └── ProteinViewer.tsx
293
+ ```
294
+
295
+ ### Key Components
296
+
297
+ **1. Discovery Page**
298
+ - Input: SMILES or protein sequence
299
+ - Search types: Similarity, Text
300
+ - Results: Ranked list with affinity scores
301
+
302
+ **2. Molecules 2D Viewer**
303
+ - Renders molecules using `smiles-drawer`
304
+ - Supports common molecules (Caffeine, Aspirin, etc.)
305
+ - Copy SMILES functionality
306
+
307
+ **3. Proteins 3D Viewer**
308
+ - Uses `3Dmol.js` for WebGL rendering
309
+ - Fetches PDB files from RCSB
310
+ - Multiple representation styles (cartoon, surface, stick)
311
+
312
+ **4. Explorer**
313
+ - 3D scatter plot of embedding space
314
+ - Color-coded by affinity class
315
+ - Interactive point selection
316
+
317
+ ---
318
+
319
+ ## Langflow Integration
320
+
321
+ ### Purpose
322
+
323
+ Langflow provides a **no-code visual interface** for building DTI prediction pipelines. It allows researchers without coding experience to:
324
+
325
+ 1. Create drug-target interaction workflows
326
+ 2. Chain API calls visually
327
+ 3. Filter results based on affinity thresholds
328
+ 4. Export predictions
329
+
330
+ ### Pipeline Configuration
331
+
332
+ File: `langflow/bioflow_dti_pipeline.json`
333
+
334
+ ```
335
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
336
+ │ Drug Input │────▶│ DeepPurpose │────▶│ Qdrant │
337
+ │ (SMILES) │ │ Encoder │ │ Vector Store │
338
+ └─────────────────┘ └─────────────────┘ └─────────────────┘
339
+
340
+ ┌─────────────────┐ ▼
341
+ │ Target Input │────▶ ┌─────────────────┐
342
+ │ (Protein Seq) │ │ Affinity │
343
+ └─────────────────┘ │ Filter (>0.8) │
344
+ └─────────────────┘
345
+
346
+
347
+ ┌─────────────────┐
348
+ │ DTI Results │
349
+ │ Output │
350
+ └─────────────────┘
351
+ ```
352
+
353
+ ### Running Langflow
354
+
355
+ ```bash
356
+ # Start Langflow server
357
+ .\.venv\Scripts\langflow run --host 0.0.0.0 --port 7860
358
+
359
+ # Or use the dedicated venv
360
+ .\langflow_venv\Scripts\langflow run --host 0.0.0.0 --port 7860
361
+ ```
362
+
363
+ **Note:** Langflow requires a separate virtual environment due to dependency conflicts with DeepPurpose.
364
+
365
+ ---
366
+
367
+ ## Current Status
368
+
369
+ ### ✅ Completed Features
370
+
371
+ | Feature | Status | Notes |
372
+ |---------|--------|-------|
373
+ | DeepPurpose Training Pipeline | ✅ Done | 3 datasets trained |
374
+ | Qdrant Ingestion | ✅ Done | 23,531 vectors indexed |
375
+ | FastAPI Backend | ✅ Done | Running on port 8001 |
376
+ | Vector Search API | ✅ Done | Drug/Target similarity |
377
+ | Next.js Frontend | ✅ Done | 6 pages implemented |
378
+ | 2D Molecule Viewer | ✅ Done | smiles-drawer integration |
379
+ | 3D Protein Viewer | ✅ Done | 3Dmol.js integration |
380
+ | Dark Mode | ✅ Done | next-themes provider |
381
+ | Langflow Pipeline | ✅ Done | JSON config ready |
382
+
383
+ ### 🚧 Partially Complete
384
+
385
+ | Feature | Status | Notes |
386
+ |---------|--------|-------|
387
+ | 3D Molecule Viewer | 🚧 WIP | SDF fetching needs work |
388
+ | Explorer Visualization | 🚧 WIP | Chart rendering issues |
389
+ | Data Page | 🚧 WIP | API stats integration |
390
+
391
+ ### ❌ Not Yet Implemented
392
+
393
+ | Feature | Priority | Description |
394
+ |---------|----------|-------------|
395
+ | OpenBioMed Integration | High | Multi-modal foundation model |
396
+ | User Authentication | Medium | Login/session management |
397
+ | Batch Predictions | Medium | Upload CSV for bulk inference |
398
+ | Model Fine-tuning UI | Low | Retrain on custom data |
399
+ | Export Results | Low | CSV/JSON download |
400
+
401
+ ---
402
+
403
+ ## Future Roadmap
404
+
405
+ ### Phase 1: OpenBioMed Integration (High Priority)
406
+
407
+ [OpenBioMed](https://github.com/PharMolix/OpenBioMed) is a multi-modal foundation model for biomedicine that would significantly enhance BioFlow's capabilities:
408
+
409
+ **Planned Features:**
410
+ 1. **Molecule-Text Alignment**
411
+ - Search drugs using natural language descriptions
412
+ - Example: "Find molecules similar to aspirin that reduce inflammation"
413
+
414
+ 2. **Protein-Text Alignment**
415
+ - Describe targets in plain English
416
+ - Example: "Kinase involved in cancer cell proliferation"
417
+
418
+ 3. **Cross-Modal Retrieval**
419
+ - Find drugs for a given text description
420
+ - Find targets for a given drug structure
421
+
422
+ 4. **Enhanced Embeddings**
423
+ - Replace Morgan/CNN with transformer-based encoders
424
+ - Better generalization to novel compounds
425
+
426
+ **Implementation Plan:**
427
+ ```python
428
+ # Replace current encoding
429
+ # FROM: Morgan fingerprints + CNN
430
+ # TO: OpenBioMed's BioMedGPT encoder
431
+
432
+ from openbiomedgpt import BioMedGPTEncoder
433
+ encoder = BioMedGPTEncoder.load_pretrained("biomedgpt-base")
434
+
435
+ # Multi-modal embedding
436
+ drug_embedding = encoder.encode_molecule(smiles)
437
+ target_embedding = encoder.encode_protein(sequence)
438
+ text_embedding = encoder.encode_text("kinase inhibitor")
439
+ ```
440
+
441
+ ### Phase 2: Advanced Search & Filtering
442
+
443
+ 1. **Faceted Search**
444
+ - Filter by molecular weight, logP, TPSA
445
+ - Filter by target family (kinases, GPCRs, etc.)
446
+
447
+ 2. **ADMET Predictions**
448
+ - Absorption, Distribution, Metabolism, Excretion, Toxicity
449
+ - Integrate with ADMETlab 2.0
450
+
451
+ 3. **Structure-Activity Relationship (SAR)**
452
+ - Identify key structural features
453
+ - Scaffold hopping suggestions
454
+
455
+ ### Phase 3: Collaboration Features
456
+
457
+ 1. **Project Workspaces**
458
+ - Save searches and results
459
+ - Share with team members
460
+
461
+ 2. **Annotation System**
462
+ - Tag molecules with notes
463
+ - Track experimental validation
464
+
465
+ 3. **Integration with Lab Notebooks**
466
+ - Export to ELN systems
467
+ - Import experimental data
468
+
469
+ ---
470
+
471
+ ## Running the System
472
+
473
+ ### Quick Start
474
+
475
+ ```powershell
476
+ # 1. Start Qdrant (Docker)
477
+ docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
478
+
479
+ # 2. Start Backend API
480
+ .\.venv\Scripts\python -m uvicorn server.api:app --host 0.0.0.0 --port 8001
481
+
482
+ # 3. Start Frontend
483
+ cd ui
484
+ pnpm dev
485
+
486
+ # 4. (Optional) Start Langflow
487
+ .\langflow_venv\Scripts\langflow run --host 0.0.0.0 --port 7860
488
+ ```
489
+
490
+ ### Service Ports
491
+ | Service | Port | URL |
492
+ |---------|------|-----|
493
+ | Frontend | 3000 | http://localhost:3000 |
494
+ | Backend API | 8001 | http://localhost:8001 |
495
+ | Qdrant | 6333 | http://localhost:6333 |
496
+ | Langflow | 7860 | http://localhost:7860 |
497
+
498
+ ### Health Check
499
+ ```powershell
500
+ # Check all services
501
+ $qdrant = netstat -ano | Select-String ":6333.*LISTENING"
502
+ $api = netstat -ano | Select-String ":8001.*LISTENING"
503
+ $ui = netstat -ano | Select-String ":3000.*LISTENING"
504
+
505
+ Write-Host "Qdrant: $($qdrant -ne $null)"
506
+ Write-Host "API: $($api -ne $null)"
507
+ Write-Host "UI: $($ui -ne $null)"
508
+ ```
509
+
510
+ ---
511
+
512
+ ## File Structure
513
+
514
+ ```
515
+ lacoste001/
516
+ ├── config.py # Shared configuration
517
+ ├── deeppurpose002.py # Training pipeline
518
+ ├── ingest_qdrant.py # Vector ingestion
519
+ ├── runs/ # Model checkpoints & results
520
+ │ ├── 20260125_080409_BindingDB_Kd/
521
+ │ ├── 20260125_104915_KIBA/ # Best model ★
522
+ │ └── 20260126_160009_DAVIS/
523
+ ├── server/
524
+ │ └── api.py # FastAPI backend
525
+ ├── langflow/
526
+ │ └── bioflow_dti_pipeline.json
527
+ ├── data/
528
+ │ ├── davis.tab
529
+ │ └── kiba.tab
530
+ └── ui/ # Next.js frontend
531
+ ├── app/
532
+ │ ├── layout.tsx
533
+ │ ├── page.tsx
534
+ │ └── dashboard/
535
+ │ ├── discovery/
536
+ │ ├── explorer/
537
+ │ ├── molecules-2d/
538
+ │ ├── molecules-3d/
539
+ │ └── proteins-3d/
540
+ ├── components/
541
+ └── lib/
542
+ ```
543
+
544
+ ---
545
+
546
+ ## Conclusion
547
+
548
+ BioFlow demonstrates a complete pipeline for AI-powered drug discovery, from model training to interactive visualization. The system successfully:
549
+
550
+ 1. **Trains** DTI prediction models achieving CI > 0.80
551
+ 2. **Indexes** embeddings for fast similarity search
552
+ 3. **Serves** predictions via REST API
553
+ 4. **Visualizes** molecules and proteins in the browser
554
+ 5. **Enables** no-code experimentation via Langflow
555
+
556
+ The next major milestone is **OpenBioMed integration**, which will unlock multi-modal search and dramatically improve the user experience for drug discovery researchers.
557
+
558
+ ---
559
+
560
+ *Report generated: January 26, 2026*
561
+ *Repository: github.com/hamzasammoud11-dotcom/lacoste001*
562
+ *Branch: core-progress*
ui/app/dashboard/page.tsx DELETED
@@ -1,172 +0,0 @@
1
- "use client"
2
-
3
- import { ArrowUp, Database, FileText, Search, Sparkles, Zap } from "lucide-react"
4
- import Link from "next/link"
5
-
6
- import { Badge } from "@/components/ui/badge"
7
- import { Button } from "@/components/ui/button"
8
- import { Card, CardContent } from "@/components/ui/card"
9
- import { Separator } from "@/components/ui/separator"
10
-
11
- export default function DashboardHome() {
12
- return (
13
- <div className="space-y-8 animate-in fade-in duration-500 p-8">
14
- {/* Hero Section */}
15
- <div className="flex flex-col lg:flex-row gap-6">
16
- <div className="flex-1 rounded-2xl bg-gradient-to-br from-primary/10 via-background to-background p-8 border">
17
- <Badge variant="secondary" className="mb-4">New • BioFlow 2.0</Badge>
18
- <h1 className="text-4xl font-bold tracking-tight mb-4">AI-Powered Drug Discovery</h1>
19
- <p className="text-lg text-muted-foreground mb-6 max-w-xl">
20
- Run discovery pipelines, predict binding, and surface evidence in one streamlined workspace.
21
- </p>
22
- <div className="flex gap-2 mb-6">
23
- <Badge variant="outline" className="bg-primary/5 border-primary/20 text-primary">Model-aware search</Badge>
24
- <Badge variant="outline" className="bg-green-500/10 border-green-500/20 text-green-700 dark:text-green-400">Evidence-linked</Badge>
25
- <Badge variant="outline" className="bg-amber-500/10 border-amber-500/20 text-amber-700 dark:text-amber-400">Fast iteration</Badge>
26
- </div>
27
-
28
- <div className="flex gap-4">
29
- <Link href="/dashboard/discovery">
30
- <Button size="lg" className="font-semibold">
31
- Start Discovery
32
- </Button>
33
- </Link>
34
- <Link href="/dashboard/explorer">
35
- <Button size="lg" variant="outline">
36
- Explore Data
37
- </Button>
38
- </Link>
39
- </div>
40
- </div>
41
-
42
- <div className="lg:w-[350px]">
43
- <Card className="h-full">
44
- <CardContent className="p-6 flex flex-col justify-between h-full">
45
- <div>
46
- <div className="text-xs font-bold uppercase tracking-wider text-muted-foreground mb-2">Today</div>
47
- <div className="text-4xl font-bold mb-2">156 Discoveries</div>
48
- <div className="text-sm text-green-600 font-medium flex items-center gap-1">
49
- <ArrowUp className="h-4 w-4" />
50
- +12% vs last week
51
- </div>
52
- </div>
53
-
54
- <Separator className="my-4" />
55
-
56
- <div className="space-y-2">
57
- <div className="flex items-center justify-between text-sm">
58
- <span className="flex items-center gap-2">
59
- <span className="h-2 w-2 rounded-full bg-primary"></span>
60
- Discovery
61
- </span>
62
- <span className="font-mono font-medium">64</span>
63
- </div>
64
- <div className="flex items-center justify-between text-sm">
65
- <span className="flex items-center gap-2">
66
- <span className="h-2 w-2 rounded-full bg-green-500"></span>
67
- Prediction
68
- </span>
69
- <span className="font-mono font-medium">42</span>
70
- </div>
71
- <div className="flex items-center justify-between text-sm">
72
- <span className="flex items-center gap-2">
73
- <span className="h-2 w-2 rounded-full bg-amber-500"></span>
74
- Evidence
75
- </span>
76
- <span className="font-mono font-medium">50</span>
77
- </div>
78
- </div>
79
- </CardContent>
80
- </Card>
81
- </div>
82
- </div>
83
-
84
- {/* Metrics Row */}
85
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
86
- {[
87
- { label: "Molecules", value: "12.5M", icon: "🧪", change: "+2.3%", color: "text-blue-500" },
88
- { label: "Proteins", value: "847K", icon: "🧬", change: "+1.8%", color: "text-cyan-500" },
89
- { label: "Papers", value: "1.2M", icon: "📚", change: "+5.2%", color: "text-emerald-500" },
90
- { label: "Discoveries", value: "156", icon: "✨", change: "+12%", color: "text-amber-500" }
91
- ].map((metric, i) => (
92
- <Card key={i}>
93
- <CardContent className="p-6">
94
- <div className="flex justify-between items-start mb-2">
95
- <div className="text-sm font-medium text-muted-foreground">{metric.label}</div>
96
- <div className="text-lg">{metric.icon}</div>
97
- </div>
98
- <div className="text-2xl font-bold mb-1">{metric.value}</div>
99
- <div className="text-xs font-medium flex items-center gap-1 text-green-500">
100
- <ArrowUp className="h-3 w-3" />
101
- {metric.change}
102
- </div>
103
- </CardContent>
104
- </Card>
105
- ))}
106
- </div>
107
-
108
- {/* Quick Actions */}
109
- <div className="pt-4">
110
- <div className="flex items-center gap-2 mb-4">
111
- <Zap className="h-5 w-5 text-amber-500" />
112
- <h2 className="text-xl font-semibold">Quick Actions</h2>
113
- </div>
114
-
115
- <div className="grid grid-cols-1 md:grid-cols-4 gap-4">
116
- <Link href="/dashboard/molecules-2d" className="block">
117
- <Card className="hover:bg-accent/50 transition-colors cursor-pointer h-full">
118
- <CardContent className="p-6 flex flex-col items-center text-center gap-3">
119
- <div className="h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-primary">
120
- <Search className="h-5 w-5" />
121
- </div>
122
- <div>
123
- <div className="font-semibold">Molecules 2D</div>
124
- <div className="text-sm text-muted-foreground">View 2D structures</div>
125
- </div>
126
- </CardContent>
127
- </Card>
128
- </Link>
129
- <Link href="/dashboard/molecules-3d" className="block">
130
- <Card className="hover:bg-accent/50 transition-colors cursor-pointer h-full">
131
- <CardContent className="p-6 flex flex-col items-center text-center gap-3">
132
- <div className="h-10 w-10 rounded-full bg-blue-500/10 flex items-center justify-center text-blue-500">
133
- <Database className="h-5 w-5" />
134
- </div>
135
- <div>
136
- <div className="font-semibold">Molecules 3D</div>
137
- <div className="text-sm text-muted-foreground">View 3D structures</div>
138
- </div>
139
- </CardContent>
140
- </Card>
141
- </Link>
142
- <Link href="/dashboard/proteins-3d" className="block">
143
- <Card className="hover:bg-accent/50 transition-colors cursor-pointer h-full">
144
- <CardContent className="p-6 flex flex-col items-center text-center gap-3">
145
- <div className="h-10 w-10 rounded-full bg-purple-500/10 flex items-center justify-center text-purple-500">
146
- <FileText className="h-5 w-5" />
147
- </div>
148
- <div>
149
- <div className="font-semibold">Proteins 3D</div>
150
- <div className="text-sm text-muted-foreground">View protein structures</div>
151
- </div>
152
- </CardContent>
153
- </Card>
154
- </Link>
155
- <Link href="/dashboard/discovery" className="block">
156
- <Card className="hover:bg-accent/50 transition-colors cursor-pointer h-full">
157
- <CardContent className="p-6 flex flex-col items-center text-center gap-3">
158
- <div className="h-10 w-10 rounded-full bg-slate-500/10 flex items-center justify-center text-slate-500">
159
- <Sparkles className="h-5 w-5" />
160
- </div>
161
- <div>
162
- <div className="font-semibold">Discovery</div>
163
- <div className="text-sm text-muted-foreground">Run predictions</div>
164
- </div>
165
- </CardContent>
166
- </Card>
167
- </Link>
168
- </div>
169
- </div>
170
- </div>
171
- )
172
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ui/app/{dashboard/discovery → discovery}/page.tsx RENAMED
File without changes
ui/app/{dashboard/explorer → explorer}/chart.tsx RENAMED
File without changes
ui/app/{dashboard/explorer → explorer}/components.tsx RENAMED
File without changes
ui/app/{dashboard/explorer → explorer}/page.tsx RENAMED
File without changes
ui/app/{dashboard/molecules-2d → molecules-2d}/_components/Smiles2DViewer.tsx RENAMED
File without changes
ui/app/{dashboard/molecules-2d → molecules-2d}/page.tsx RENAMED
File without changes
ui/app/{dashboard/molecules-3d → molecules-3d}/_components/Molecule3DViewer.tsx RENAMED
@@ -90,7 +90,7 @@ export function Molecule3DViewer({
90
 
91
  // Create viewer
92
  const viewer = $3Dmol.createViewer(containerRef.current, {
93
- backgroundColor: 'transparent',
94
  });
95
  viewerRef.current = viewer;
96
 
 
90
 
91
  // Create viewer
92
  const viewer = $3Dmol.createViewer(containerRef.current, {
93
+ backgroundColor: 'white',
94
  });
95
  viewerRef.current = viewer;
96
 
ui/app/{dashboard/molecules-3d → molecules-3d}/page.tsx RENAMED
File without changes
ui/app/page.tsx CHANGED
@@ -27,12 +27,12 @@ export default function Home() {
27
  </div>
28
 
29
  <div className="flex gap-4">
30
- <Link href="/dashboard/discovery">
31
  <Button size="lg" className="font-semibold">
32
  Start Discovery
33
  </Button>
34
  </Link>
35
- <Link href="/dashboard/explorer">
36
  <Button size="lg" variant="outline">
37
  Explore Data
38
  </Button>
 
27
  </div>
28
 
29
  <div className="flex gap-4">
30
+ <Link href="/discovery">
31
  <Button size="lg" className="font-semibold">
32
  Start Discovery
33
  </Button>
34
  </Link>
35
+ <Link href="/explorer">
36
  <Button size="lg" variant="outline">
37
  Explore Data
38
  </Button>
ui/app/{dashboard/proteins-3d → proteins-3d}/_components/ProteinViewer.tsx RENAMED
File without changes
ui/app/{dashboard/proteins-3d → proteins-3d}/page.tsx RENAMED
File without changes
ui/components/sidebar.tsx CHANGED
@@ -58,86 +58,101 @@ import { useIsMobile } from '@/hooks/use-mobile';
58
  const navMain = [
59
  {
60
  title: 'Home',
61
- url: '/dashboard',
62
  icon: Home,
63
  isActive: true,
64
  },
65
  {
66
  title: 'Visualization',
67
- url: '/dashboard/molecules-2d',
68
  icon: FlaskConical,
69
  items: [
70
  {
71
  title: 'Molecules 2D',
72
- url: '/dashboard/molecules-2d',
73
  },
74
  {
75
  title: 'Molecules 3D',
76
- url: '/dashboard/molecules-3d',
77
  },
78
  {
79
  title: 'Proteins 3D',
80
- url: '/dashboard/proteins-3d',
81
  },
82
  ],
83
  },
84
  {
85
  title: 'Discovery',
86
- url: '/dashboard/discovery',
87
  icon: Microscope,
88
  items: [
89
  {
90
  title: 'Drug Discovery',
91
- url: '/dashboard/discovery',
92
  },
93
  {
94
  title: 'Molecule Search',
95
- url: '/dashboard/discovery#search',
96
  },
97
  ],
98
  },
99
  {
100
  title: 'Explorer',
101
- url: '/dashboard/explorer',
102
  icon: Dna,
103
  items: [
104
  {
105
  title: 'Embeddings',
106
- url: '/dashboard/explorer',
107
  },
108
  {
109
  title: 'Predictions',
110
- url: '/dashboard/explorer#predictions',
111
  },
112
  ],
113
  },
114
  {
115
  title: 'Data',
116
- url: '/dashboard/data',
117
  icon: BarChart2,
118
  items: [
119
  {
120
  title: 'Datasets',
121
- url: '/dashboard/data',
122
  },
123
  {
124
  title: 'Analytics',
125
- url: '/dashboard/data#analytics',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  },
127
  ],
128
  },
129
  {
130
  title: 'Settings',
131
- url: '/dashboard/settings',
132
  icon: Settings,
133
  items: [
134
  {
135
  title: 'General',
136
- url: '/dashboard/settings',
137
  },
138
  {
139
  title: 'Models',
140
- url: '/dashboard/settings#models',
141
  },
142
  ],
143
  },
@@ -160,7 +175,7 @@ export function AppSidebar() {
160
  <SidebarMenu>
161
  <SidebarMenuItem>
162
  <SidebarMenuButton size="lg" asChild>
163
- <Link href="/dashboard">
164
  <div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground">
165
  <Dna className="size-4" />
166
  </div>
 
58
  const navMain = [
59
  {
60
  title: 'Home',
61
+ url: '/',
62
  icon: Home,
63
  isActive: true,
64
  },
65
  {
66
  title: 'Visualization',
67
+ url: '/molecules-2d',
68
  icon: FlaskConical,
69
  items: [
70
  {
71
  title: 'Molecules 2D',
72
+ url: '/molecules-2d',
73
  },
74
  {
75
  title: 'Molecules 3D',
76
+ url: '/molecules-3d',
77
  },
78
  {
79
  title: 'Proteins 3D',
80
+ url: '/proteins-3d',
81
  },
82
  ],
83
  },
84
  {
85
  title: 'Discovery',
86
+ url: '/discovery',
87
  icon: Microscope,
88
  items: [
89
  {
90
  title: 'Drug Discovery',
91
+ url: '/discovery',
92
  },
93
  {
94
  title: 'Molecule Search',
95
+ url: '/discovery#search',
96
  },
97
  ],
98
  },
99
  {
100
  title: 'Explorer',
101
+ url: '/explorer',
102
  icon: Dna,
103
  items: [
104
  {
105
  title: 'Embeddings',
106
+ url: '/explorer',
107
  },
108
  {
109
  title: 'Predictions',
110
+ url: '/explorer#predictions',
111
  },
112
  ],
113
  },
114
  {
115
  title: 'Data',
116
+ url: '/data',
117
  icon: BarChart2,
118
  items: [
119
  {
120
  title: 'Datasets',
121
+ url: '/data',
122
  },
123
  {
124
  title: 'Analytics',
125
+ url: '/data#analytics',
126
+ },
127
+ ],
128
+ },
129
+ {
130
+ title: 'Workflow',
131
+ url: '/workflow',
132
+ icon: Sparkles,
133
+ items: [
134
+ {
135
+ title: 'Langflow Pipeline',
136
+ url: '/workflow',
137
+ },
138
+ {
139
+ title: 'Open Langflow',
140
+ url: 'http://localhost:7860',
141
  },
142
  ],
143
  },
144
  {
145
  title: 'Settings',
146
+ url: '/settings',
147
  icon: Settings,
148
  items: [
149
  {
150
  title: 'General',
151
+ url: '/settings',
152
  },
153
  {
154
  title: 'Models',
155
+ url: '/settings#models',
156
  },
157
  ],
158
  },
 
175
  <SidebarMenu>
176
  <SidebarMenuItem>
177
  <SidebarMenuButton size="lg" asChild>
178
+ <Link href="/">
179
  <div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground">
180
  <Dna className="size-4" />
181
  </div>