# pol-sb/simul-protein-small-molecule architecture

> Architecture diagram of the GitHub repository pol-sb/simul-protein-small-molecule, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pol-sb/simul-protein-small-molecule
- Repository: https://github.com/pol-sb/simul-protein-small-molecule

## Overview

##### Main Components

a) Core Simulation Engine:
- Center the OpenMM integration as the primary computational engine
- Simulation configuration and parameter handling
- GPU/CPU platform selection system

b) Module Structure:
- Simulation management modules
- Analysis modules
- Data handling and storage
- Web application interface

c) Data Flow Components:
- Input processing
- Simulation execution
- Results processing
- Database management

##### Input Layer
- Configuration parsing from command-line arguments
- Protein data input (proteins.csv, proteins.pkl)
- Small molecule parameter handling

##### Core Processing Layer
- OpenMM simulation engine integration
- Platform management (GPU/CPU selection)
- Simulation control flow
- Small molecule integration system

##### Analysis Layer
- Density profile analysis
- Database creation and management
- Results visualization
- Testing framework

##### Output Layer
- Trajectory file generation (.dcd)
- System configuration output (.pdb)
- Logging system
- Results database integration

Use these specific visual elements:

- Hexagons for data stores
- Blue: Core simulation components
- Green: Data processing modules
- Yellow: Analysis tools
- Gray: External dependencies

Key Relationships to Highlight:

##### Data Flow
**Input Files → Simulation Engine → Results Storage → Analysis Tools**

##### Module Dependencies
**simulate.py → modules/add_new_IDP.py**
- → modules/analyse.py
- → modules/sasa_cg.py
- → modules/small_molecule.py

##### Results Processing
**Simulation Output → result_analysis/density_profile.py**
- → result_analysis/plot_densities.py
- → Database (results/simulations_df.pkl)

Specific components:

##### Command Interface
- simulate
- check_version
- database
- tests

##### Data Stores
- Protein database
- Results database
- Trajectory files
- Configuration files

##### Processing Units
- OpenMM simulation engine
- Small molecule integration
- Analysis tools
- Visualization components

##### External Interfaces
- GPU/CPU platforms
- ntfy.sh notification service
- File system interaction

This architecture should emphasize the modular nature of the system while showing how all components work together to perform IDP simulations with small molecule integration capabilities.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef core fill:#2b6cb0,stroke:#1a4971,color:white
    classDef data fill:#48bb78,stroke:#2f855a,color:white
    classDef analysis fill:#ecc94b,stroke:#d69e2e,color:black
    classDef external fill:#a0aec0,stroke:#718096,color:white
    classDef interface fill:#ed8936,stroke:#dd6b20,color:white

    %% Input Layer
    subgraph Input
        CLI[Command Line Interface]
        PDB[Protein Database]
        Config[Configuration Files]
    end

    %% Core Processing Layer
    subgraph Processing
        SimEngine["Core Simulation Engine"]:::core
        Platform["GPU/CPU Platform"]:::external
        SmallMol["Small Molecule Integration"]:::core
        Recovery["Simulation Recovery"]:::core
    end

    %% Analysis Layer
    subgraph Analysis
        DensityAnalysis["Density Profile Analysis"]:::analysis
        SASA["SASA Analysis"]:::analysis
        ResultsDB["Results Database"]:::data
        Visualization["Visualization Tools"]:::analysis
    end

    %% Output Layer
    subgraph Output
        Trajectory["Trajectory Files (.dcd)"]:::data
        SystemConfig["System Config (.pdb)"]:::data
        Notification["ntfy.sh Notifications"]:::external
    end

    %% Data Flow
    CLI --> SimEngine
    PDB --> SimEngine
    Config --> SimEngine
    
    SimEngine --> Platform
    SimEngine --> SmallMol
    SimEngine --> Recovery
    
    SimEngine --> Trajectory
    SimEngine --> SystemConfig
    SimEngine --> Notification
    
    Trajectory --> DensityAnalysis
    Trajectory --> SASA
    
    DensityAnalysis --> ResultsDB
    SASA --> ResultsDB
    
    ResultsDB --> Visualization

    %% Click Events
    click SimEngine "https://github.com/pol-sb/simul-protein-small-molecule/blob/main/simulate.py"
    click SmallMol "https://github.com/pol-sb/simul-protein-small-molecule/blob/main/modules/small_molecule.py"
    click PDB "https://github.com/pol-sb/simul-protein-small-molecule/blob/main/data/proteins.pkl"
    click SASA "https://github.com/pol-sb/simul-protein-small-molecule/blob/main/modules/sasa_cg.py"
    click DensityAnalysis "https://github.com/pol-sb/simul-protein-small-molecule/blob/main/result_analysis/density_profile.py"
    click Visualization "https://github.com/pol-sb/simul-protein-small-molecule/blob/main/result_analysis/vis_db.py"
    click ResultsDB "https://github.com/pol-sb/simul-protein-small-molecule/blob/main/results/simulations_df.pkl"
    click Recovery "https://github.com/pol-sb/simul-protein-small-molecule/blob/main/modules/resume_dcd.py"

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Data Storage"]:::data
        L3["Analysis Tools"]:::analysis
        L4["External Services"]:::external
        L5["Interface Components"]:::interface
    end
```
