# tiwarylab/af2rave architecture

> Architecture diagram of the GitHub repository tiwarylab/af2rave, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tiwarylab/af2rave
- Repository: https://github.com/tiwarylab/af2rave

## Overview

##### Main components
- CLI/Entry Script: The package entry point (e.g., the “af2rave” script and the __main__.py for SPIB).
- Alphafold Module: Contains submodules (base.py, colabfold.py, openfold.py) for protein structure prediction.
- AMINO Module: Provides utilities for handling protein amino acid data.
- COLVAR Module: Manages collective variables crucial for molecular dynamics analysis.
- Feature Module: Extracts and analyzes features from simulation and prediction results.
- Simulation Module: Manages simulation routines, forcefield definitions (e.g., charmm36m_protein.xml), reporters, and utility functions.
- SPIB Module: Deals with state predictive information bottleneck analysis, including training and result modules.
- Auxiliary Components: Datasets (example PDB files), tests, documentation, and notebooks.
- External Dependencies: For example, the separate installation of ColabFold.

##### Relationships and interactions
- The CLI/entry component routes user calls to various modules.
- Alphafold operations generate structure predictions that flow to simulation and feature extraction.
- Simulation routines (using the defined forcefield) feed into analysis modules like COLVARS and SPIB.
- AMINO and Feature modules enhance data processing throughout the pipeline.
- Datasets and test suites support validation and benchmarking.

##### Architectural patterns
- The project is modular and follows a layered approach, with data flowing across prediction, simulation, and analysis layers.
- Each module component focuses on a specific aspect (e.g., structure prediction, feature extraction, simulation) that interact in a pipeline-style architecture.
- The separation of CLI, core libraries, and testing helps keep concerns distinct and fosters extensibility.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Entry and External"
        A["CLI / Entry Script"]
        B["External Dependencies (ColabFold, etc.)"]
    end

    subgraph "Prediction Module"
        C["Alphafold Module"]
        C1["base.py"]
        C2["colabfold.py"]
        C3["openfold.py"]
        C --> C1
        C --> C2
        C --> C3
    end

    subgraph "Data Processing"
        D["AMINO Module"]
        E["COLVAR Module"]
        F["Feature Module"]
    end

    subgraph "Simulation and Analysis"
        G["Simulation Module"]
        G1["Simulation Routine"]
        G2["Forcefield (charmm36m_protein.xml)"]
        G3["Reporter & Utils"]
        G --> G1
        G --> G2
        G --> G3

        H["SPIB Module"]
        H1["SPIB Main & Training"]
        H2["SPIB Result"]
        H --> H1
        H --> H2
    end

    subgraph "Support"
        I["Datasets"]
        J["Tests & Validation"]
        K["Documentation"]
        L["Notebooks"]
    end

    A -->|"routes-to"| C
    A -->|"routes-to"| D
    A -->|"routes-to"| E
    A -->|"routes-to"| F
    C -->|"predicts-for"| G
    D -->|"enhances"| F
    E -->|"enhances"| F
    F -->|"feeds"| G
    G -->|"triggers"| H
    B -->|"provides"| C
    I ---|"supports"| G
    J ---|"validates"| G
    K ---|"documents"| A
    L ---|"illustrates"| A

    style A fill:#e0f7fa,stroke:#006064,stroke-width:2px
    style C fill:#ffe0b2,stroke:#bf360c,stroke-width:2px
    style G fill:#d1c4e9,stroke:#4a148c,stroke-width:2px
    style H fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px

    click A "https://github.com/tiwarylab/af2rave/blob/main/af2rave/spib/__main__.py"
    click C "https://github.com/tiwarylab/af2rave/tree/main/af2rave/alphafold/"
    click D "https://github.com/tiwarylab/af2rave/tree/main/af2rave/amino/"
    click E "https://github.com/tiwarylab/af2rave/blob/main/af2rave/colvar.py"
    click F "https://github.com/tiwarylab/af2rave/tree/main/af2rave/feature/"
    click G "https://github.com/tiwarylab/af2rave/tree/main/af2rave/simulation/"
    click H "https://github.com/tiwarylab/af2rave/tree/main/af2rave/spib/"
    click I "https://github.com/tiwarylab/af2rave/tree/main/datasets/"
    click J "https://github.com/tiwarylab/af2rave/tree/main/tests/"
    click K "https://github.com/tiwarylab/af2rave/tree/main/docs/"
    click L "https://github.com/tiwarylab/af2rave/tree/main/notebooks/"
```
