Spaces:
Sleeping
Sleeping
File size: 7,768 Bytes
ca41776 5770d80 ca41776 | 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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | # BioFlow - AI-Powered Drug Discovery Platform
[]()
[](LICENSE)
**BioFlow** is a unified AI platform for drug discovery, combining molecular encoding, protein analysis, and drug-target interaction prediction in a modern web interface.
## ποΈ Architecture
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js Frontend β
β (React 19 + Tailwind) β
β localhost:3000 β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β HTTP/REST
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend β
β localhost:8000 β
β ββββββββββββββββ βββββββββββββββ ββββββββββββββββββββ β
β β ModelService β βQdrantServiceβ β DTI Predictor β β
β β (Encoders) β β (VectorDB) β β (DeepPurpose) β β
β ββββββββββββββββ βββββββββββββββ ββββββββββββββββββββ β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OpenBioMed Core β
β ββββββββββββββ ββββββββββββββ βββββββββββββββββββββββ β
β β Models β β Datasets β β Tasks β β
β β BioT5,ESM β β DAVIS,KIBA β β Property Prediction β β
β ββββββββββββββ ββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## π Quick Start
### Prerequisites
- Python 3.10+
- Node.js 18+ with pnpm
- (Optional) CUDA-compatible GPU
### Installation
```bash
# Clone the repository
git clone https://github.com/hamzasammoud11-dotcom/lacoste001.git
cd lacoste001
# Install Python dependencies
pip install -r bioflow/api/requirements.txt
# Install frontend dependencies
cd lacoste001/ui
pnpm install
cd ../..
```
### Running
**Option 1: Using the launch script (Windows)**
```bash
launch_bioflow_full.bat
```
**Option 2: Manual start**
```bash
# Terminal 1: Start FastAPI backend
python -m uvicorn bioflow.api.server:app --reload --port 8000
# Terminal 2: Start Next.js frontend
cd lacoste001/ui
pnpm dev
```
### Access
- **Frontend**: <http://localhost:3000>
- **API Docs**: <http://localhost:8000/docs>
- **API Health**: <http://localhost:8000/health>
## π Project Structure
```
OpenBioMed/
βββ bioflow/ # BioFlow Platform
β βββ api/ # FastAPI Backend
β β βββ server.py # Main API server
β β βββ model_service.py # Unified model access
β β βββ qdrant_service.py # Vector database
β β βββ dti_predictor.py # DTI prediction
β βββ core/ # Core abstractions
β βββ plugins/ # Encoders & retrievers
β βββ workflows/ # Pipeline definitions
β
βββ lacoste001/
β βββ ui/ # Next.js Frontend
β βββ app/
β β βββ api/ # API routes
β β βββ dashboard/ # UI pages
β βββ components/ # React components
β βββ lib/ # Services & utilities
β
βββ open_biomed/ # OpenBioMed Research Engine
β βββ models/ # BioT5, ESM, GraphMVP
β βββ datasets/ # Dataset loaders
β βββ tasks/ # Task implementations
β
βββ configs/ # YAML configurations
```
## π API Endpoints
### Discovery Pipeline
- `POST /api/discovery` - Start discovery job
- `GET /api/discovery/{job_id}` - Get job status
### Predictions
- `POST /api/predict` - DTI prediction
- `POST /api/encode` - Encode molecule/protein/text
### Data Management
- `POST /api/ingest` - Add data to vector DB
- `GET /api/molecules` - List molecules
- `GET /api/proteins` - List proteins
- `GET /api/collections` - List vector collections
### Visualization
- `GET /api/explorer/embeddings` - Get 2D projections
- `GET /api/similarity` - Compute similarity scores
## π§ͺ Features
### Drug Discovery Pipeline
- Natural language, SMILES, or FASTA input
- Automatic modality detection
- Vector similarity search
- Property prediction (MW, LogP, TPSA)
- Binding affinity prediction
### Molecular Analysis
- 2D/3D molecule visualization
- SMILES validation
- Property calculation via RDKit
### Protein Analysis
- 3D protein structure viewing
- Sequence embedding
- DTI prediction
### Explorer
- UMAP/t-SNE embedding visualization
- Cluster analysis
- Interactive filtering
## π§ Configuration
### Environment Variables
```bash
# .env file
NEXT_PUBLIC_API_URL=http://localhost:8000
QDRANT_URL=http://localhost:6333 # Optional: remote Qdrant
QDRANT_PATH=./qdrant_data # Local Qdrant storage
```
### API Configuration
Edit `lacoste001/ui/config/api.config.ts`:
```typescript
export const API_CONFIG = {
baseUrl: process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000",
// ...
}
```
## 𧬠Model Support
| Model | Type | Use Case |
|-------|------|----------|
| ChemBERTa | Molecule Encoder | SMILES embeddings |
| ESM-2 | Protein Encoder | Sequence embeddings |
| PubMedBERT | Text Encoder | Biomedical text |
| DeepPurpose | DTI | Binding prediction |
| GraphMVP | Property | Molecular properties |
| BioT5 | Generation | Molecule generation |
## π Development
### Verify Installation
```bash
python scripts/verify_phase3.py
```
### Run Tests
```bash
pytest tests/
```
### Type Checking (Frontend)
```bash
cd lacoste001/ui
pnpm tsc --noEmit
```
## π€ Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request
## π License
Apache 2.0 - See [LICENSE](LICENSE)
## π Acknowledgments
- [OpenBioMed](https://github.com/PharMolix/OpenBioMed) - Foundation models
- [DeepPurpose](https://github.com/kexinhuang12345/DeepPurpose) - DTI prediction
- [Qdrant](https://qdrant.tech/) - Vector database
- [Next.js](https://nextjs.org/) - React framework
- [Shadcn/ui](https://ui.shadcn.com/) - UI components
|