How mkarthikeya866-ops/xgbioactive works
This repository presents a COX-2 bioactivity prediction product: users submit a molecular SMILES string, the backend calculates descriptors, runs an XGBoost model, and returns a class and confidence while recording prediction history. It also provides compound catalog operations and a research workflow for preparing data and training the classifier. The backend call paths are supported by excerpts; research-stage links follow the README. The frontend source was indexed but not excerpted, so its connection to the API is left unverified.
Main entry points: main.py FastAPI application · database.py SQL database access · router.py API router · predict.py Prediction endpoint
Components 19
User interface
- Web frontend
Frontend/script.js
API layer
- FastAPI application
Backend/app/main.py - API router
Backend/app/api/v1/router.py - Health endpoint
Backend/app/api/v1/endpoints/system.py - Application settings
Backend/app/config.py
Prediction
- Prediction endpoint
Backend/app/api/v1/endpoints/predict.py - Descriptor and prediction service
Backend/app/services/prediction.py - COX-2 XGBoost model
Backend/models/xgb_cox2.joblib - Prediction schemas
Backend/app/schemas_prediction.py
Compound catalog
- Compound catalog API
Backend/app/api/v1/endpoints/compounds.py - Compound schemas
Backend/app/schemas.py - Database models
Backend/app/models.py - SQL database access
Backend/app/database.py - Starter catalog seeding
Backend/app/seed.py
Research workflow
- Chemical activity data
data/CHEMBL230_RAW_DATA.csv - ChEMBL data import
Backend/scripts/import_chembl.py - Preprocessed COX-2 data
Backend/data/CHEMBL230_Preprocessed_Data.csv - Model training and evaluation
Backend/scripts/train_model.py
Other components
- User
Connections 24
- User → Web frontend: uses
- Web frontend → FastAPI application: submits predictions
- FastAPI application → API router: registers routes
Backend/app/main.py - FastAPI application → Application settings: loads settings
Backend/app/main.py - FastAPI application → SQL database access: initializes schema
Backend/app/main.py - FastAPI application → Starter catalog seeding: seeds catalog
Backend/app/main.py - API router → Health endpoint: registers endpoint
Backend/app/api/v1/router.py - API router → Compound catalog API: registers endpoint
Backend/app/api/v1/router.py - API router → Prediction endpoint: registers endpoint
Backend/app/api/v1/router.py - Health endpoint → Application settings: reads settings
Backend/app/api/v1/endpoints/system.py - Prediction endpoint → Descriptor and prediction service: calls prediction
Backend/app/api/v1/endpoints/predict.py - Prediction endpoint → SQL database access: records and reads history
Backend/app/api/v1/endpoints/predict.py - Prediction endpoint → Prediction schemas: validates and returns
Backend/app/api/v1/endpoints/predict.py - Descriptor and prediction service → COX-2 XGBoost model: loads model
Backend/app/services/prediction.py - Compound catalog API → SQL database access: queries and updates
Backend/app/api/v1/endpoints/compounds.py - Compound catalog API → Database models: queries compounds
Backend/app/api/v1/endpoints/compounds.py - Compound catalog API → Compound schemas: validates and returns
Backend/app/api/v1/endpoints/compounds.py - Database models → SQL database access: uses ORM base
Backend/app/models.py - Starter catalog seeding → Database models: creates starter compounds
Backend/app/seed.py - Starter catalog seeding → SQL database access: persists seed records
Backend/app/seed.py - Chemical activity data → ChEMBL data import: provides source data
README.md - ChEMBL data import → Preprocessed COX-2 data: prepares compounds
README.md - Preprocessed COX-2 data → Model training and evaluation: trains on data
README.md - Model training and evaluation → COX-2 XGBoost model: produces classifier
README.md