# dellacortelab/prospr architecture

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

- Interactive diagram: https://gitdiagram.com/dellacortelab/prospr
- Repository: https://github.com/dellacortelab/prospr

## Overview

##### Main Components
The system should be divided into these key components:

a) Input Processing Layer
- A3M file input (Multiple Sequence Alignment)
- Data loading and preprocessing components (from prospr/dataloader.py)

b) Neural Network Core
- Three neural network models (prospr0421_a.pt, prospr0421_b.pt, prospr0421_c.pt)
- Neural network architecture (defined in prospr/nn.py)

c) Prediction Pipeline
- Prediction workflow (prospr/prediction.py)
- Multiple output types (distance maps, ASA, phi/psi angles, secondary structure)

d) Training Infrastructure
- Training pipeline (prospr/train.py)
- Data flow from training datasets

##### Component Relationships

- Training data flow from data/training directory
- Evaluation data flow from data/evaluate directory
- Output flow to data/predictions and data/results

##### Specific Elements

**┌─────────────────────────────────────┐**
- Input Processing                    │
- A3M file handling                │
- Sequence processing              │
- ┘
- ↓
**┌─────────────────────────────────────┐**
- Neural Network Ensemble             │
- Model A (prospr0421_a.pt)        │
- Model B (prospr0421_b.pt)        │
- Model C (prospr0421_c.pt)        │
- ┘
- ↓
**┌─────────────────────────────────────┐**
- Prediction Output                   │
- Distance Maps                     │
- ASA Predictions                   │
- Phi/Psi Angles                    │
- Secondary Structure               │
- ┘

##### Additional Details

Elements:
- Data persistence layers (training data, model weights, predictions)
- Evaluation pipeline
- Training/Prediction mode switch

##### Technical Specifications

Annotations for:
- File formats (.a3m, .pdb, .pkl)
- Model architecture details
- Input/output specifications
- Performance metrics

##### Training mode (for model development)

This will create a comprehensive system design that accurately represents ProSPr's architecture while maintaining clarity and usefulness for development and documentation purposes.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Legend"
        L1[Processing Component]
        L2[(Data Storage)]
        L3{Decision Point}
        L4([Neural Network Model])
        style L1 fill:#AEC6CF
        style L2 fill:#E6E6E6
        style L3 fill:#FFB366
        style L4 fill:#98FB98
    end

    subgraph "Input Processing"
        A1["Data Loading"]:::processing
        A2["Sequence Processing"]:::processing
        A3["I/O Operations"]:::processing
        A1 --> A2 --> A3
    end

    subgraph "Neural Network Core"
        B1(["Model A"]):::nn
        B2(["Model B"]):::nn
        B3(["Model C"]):::nn
        B4["Network Architecture"]:::nn
        B4 --> B1
        B4 --> B2
        B4 --> B3
    end

    subgraph "Prediction Pipeline"
        C1["Prediction Logic"]:::prediction
        C2["Distance Maps"]:::output
        C3["ASA Predictions"]:::output
        C4["Phi/Psi Angles"]:::output
        C5["Secondary Structure"]:::output
        C6[(Predictions Storage)]:::storage
        C7[(Results Visualization)]:::storage
        C1 --> C2
        C1 --> C3
        C1 --> C4
        C1 --> C5
        C2 & C3 & C4 & C5 --> C6
        C6 --> C7
    end

    subgraph "Training Infrastructure"
        D1["Training Logic"]:::training
        D2[(Training Data)]:::storage
        D3[(Training Logs)]:::storage
        D4[(A3Ms)]:::storage
        D5[(PDBs)]:::storage
        D6[(Training Set)]:::storage
        D2 --> D1
        D1 --> D3
        D4 & D5 & D6 --> D2
    end

    subgraph "Evaluation System"
        E1["Evaluation Logic"]:::eval
        E2[(Evaluation Data)]:::storage
        E2 --> E1
    end

    A3 --> B4
    B1 & B2 & B3 --> C1
    D1 --> B4
    C1 --> E1

    classDef processing fill:#AEC6CF
    classDef storage fill:#E6E6E6
    classDef nn fill:#98FB98
    classDef prediction fill:#FFB366
    classDef output fill:#FFE5CC
    classDef training fill:#FF9999
    classDef eval fill:#DDA0DD

    click A1 "https://github.com/dellacortelab/prospr/blob/master/prospr/dataloader.py"
    click A2 "https://github.com/dellacortelab/prospr/blob/master/prospr/sequence.py"
    click A3 "https://github.com/dellacortelab/prospr/blob/master/prospr/io.py"
    click B4 "https://github.com/dellacortelab/prospr/blob/master/prospr/nn.py"
    click B1 "https://github.com/dellacortelab/prospr/blob/master/nn/prospr0421_a.pt"
    click B2 "https://github.com/dellacortelab/prospr/blob/master/nn/prospr0421_b.pt"
    click B3 "https://github.com/dellacortelab/prospr/blob/master/nn/prospr0421_c.pt"
    click C1 "https://github.com/dellacortelab/prospr/blob/master/prospr/prediction.py"
    click C6 "https://github.com/dellacortelab/prospr/tree/master/data/predictions"
    click C7 "https://github.com/dellacortelab/prospr/tree/master/data/results"
    click D1 "https://github.com/dellacortelab/prospr/blob/master/prospr/train.py"
    click D2 "https://github.com/dellacortelab/prospr/tree/master/data/training"
    click D3 "https://github.com/dellacortelab/prospr/tree/master/data/logs"
    click D4 "https://github.com/dellacortelab/prospr/tree/master/data/training/a3ms"
    click D5 "https://github.com/dellacortelab/prospr/tree/master/data/training/pdbs"
    click D6 "https://github.com/dellacortelab/prospr/blob/master/data/training/training-set-EXPANDED_21may.pkl"
    click E1 "https://github.com/dellacortelab/prospr/blob/master/prospr/evaluate.py"
    click E2 "https://github.com/dellacortelab/prospr/tree/master/data/evaluate"
```
