How keltoumboukra/protein-optimizer works
Primary Components
• API Service (Backend): Represented by "src/api/main.py". This FastAPI-based service provides REST endpoints to serve prediction results and likely manage job submissions or other back-office workflows.
• Data Pipeline: Located in "src/data_pipeline/mock_data.py". It handles the generation or processing of data, including creating mock data for development or testing.
• Machine Learning Models: Found in "src/ml_models/predictor.py". This module implements a RandomForest-based model for predicting protein expression and solubility.
Relationships and Interactions
• The Dashboard queries the API service to fetch prediction data.
• The API service acts as the central hub that accepts requests (e.g., prediction requests), processes them, and interacts with both the data pipeline (for raw or mock data generation/processing) and the ML models (to generate and return predictions).
• The Data Pipeline module supplies or transforms data that feeds into the ML predictor.
• Both the API and ML modules are built on Python and utilize libraries such as scikit-learn for modeling, with configuration managed by common Python configuration files (e.g., pyproject.toml, setup.py).
Architectural Patterns and Design Principles
• Separation of Concerns: The system clearly separates user interface (dashboard), presentation/API layer (FastAPI), data processing (data_pipeline), and model inference (ml_models).
• Modularity: Each functional component is isolated in separate directories promoting easy testing and potential for future extension.
• RESTful Architecture: The API layer follows REST paradigms, allowing integration with diverse lab workflows.
Relevant Technologies and Frameworks
• Backend: FastAPI (for API endpoints) and Uvicorn (for ASGI server)
• Frontend: Streamlit (for dashboard visualizations) and Plotly (for interactive plots)
• Machine Learning: scikit-learn (for model implementation, specifically RandomForest)
• Testing & Development: Pytest, mypy, and black for ensuring code quality
Putting It All Together
• A note section or annotations summarizing that the API layer is built using FastAPI with uvicorn, and that the dashboard is built using Streamlit with plotly visualizations.