# humanomelab/mlcourse architecture

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

- Interactive diagram: https://gitdiagram.com/humanomelab/mlcourse
- Repository: https://github.com/humanomelab/mlcourse

## Overview

##### Main Components
- Data Repository Layer: Represent the primary data sources and storage. This includes the “data” folder (with subdirectories for images, sequences, and CSV data) and the “img” folder (which may hold additional visualization outputs).
- Notebook/Exploratory Environment: The Jupyter notebooks (0_data_prep_and_visualization.ipynb through 4_deep_learning_for_sequences.ipynb) serve as interactive notebooks guiding users through different steps in the machine learning workflow.
- Script Modules: The “script” folder includes standalone data processing utilities (e.g., extract_seq.py, get_chipseq_peak_info.py, random_seq_except_listed.py) that likely support or preprocess data prior to analysis.
- Model Implementation/Training Components: The “src” directory hosts Python modules (chipseq_prediction_cnn.py, yeast_feature_cnn.py, yeast_image_cnn.py) where deep learning models (CNNs) are implemented for prediction tasks on different data modalities.

##### Out the Data Flow and Relationships
- Feature-based Machine Learning Workflow: Follow the data flow into notebooks that perform ML using features (as in chapter 1 and 2 notebooks).
- Interconnections: Data prepared and features extracted feed into the corresponding neural network models found in the “src” folder, while additional scripts in “script” help process and tailor the input data.
- External Data Integration: Although not explicitly an API interaction, note that the README mentions resources such as SCMD and ChIP-Atlas, so a cloud/external data source component may be represented to show the origin of data or related external references.

##### Architectural Patterns and Technologies
- Technologies: Mention Jupyter Notebook for interactive exploration, Python scripts for utility functions, and deep learning frameworks (likely PyTorch as indicated in chapter 2) utilized for the CNN models.

## Diagram (Mermaid)

```mermaid
flowchart TD
    external("External Data Sources (SCMD,ChIP-Atlas)"):::external

    subgraph "Data Ingestion/Storage"
        dataRepo("Data Storage"):::data
        imgRepo("Image Storage"):::data
    end

    subgraph "Exploratory Analysis (Notebooks)"
        nb0("Notebook 0_data_prep_and_visualization.ipynb"):::notebook
        nb1("Notebook 1_machine_learning_with_features.ipynb"):::notebook
        nb2("Notebook 2_deep_learning_for_features.ipynb"):::notebook
        nb3("Notebook 3_deep_learning_for_images.ipynb"):::notebook
        nb4("Notebook 4_deep_learning_for_sequences.ipynb"):::notebook
    end

    subgraph "Data Processing Scripts"
        script1("Script extract_seq.py"):::script
        script2("Script get_chipseq_peak_info.py"):::script
        script3("Script random_seq_except_listed.py"):::script
    end

    subgraph "Deep Learning Models"
        model_feature("Model: yeast_feature_cnn.py"):::model
        model_image("Model: yeast_image_cnn.py"):::model
        model_chipseq("Model: chipseq_prediction_cnn.py"):::model
    end

    %% Data flow connections
    external -->|"feeds"| dataRepo
    external -->|"feeds"| imgRepo

    dataRepo -->|"provides data to"| nb0
    imgRepo  -->|"provides images to"| nb0

    nb0 -->|"prepares data for"| nb1
    nb0 -->|"prepares data for"| nb2
    nb0 -->|"prepares data for"| nb3
    nb0 -->|"prepares data for"| nb4

    %% Notebooks feeding into models
    nb1 -->|"triggers feature extraction"| model_feature
    nb2 -->|"triggers deep feature modeling"| model_feature
    nb3 -->|"triggers image analysis"| model_image
    nb4 -->|"triggers sequence modeling"| model_chipseq

    %% Scripts supporting sequence/chipseq processing 
    script1 -->|"processes sequences"| model_chipseq
    script2 -->|"gathers chipseq info"| model_chipseq
    script3 -->|"filters sequence data"| model_chipseq

    %% Click events
    click dataRepo "https://github.com/humanomelab/mlcourse/tree/master/data/"
    click imgRepo "https://github.com/humanomelab/mlcourse/tree/master/img/"
    click nb0 "https://github.com/humanomelab/mlcourse/blob/master/0_data_prep_and_visualization.ipynb"
    click nb1 "https://github.com/humanomelab/mlcourse/blob/master/1_machine_learning_with_features.ipynb"
    click nb2 "https://github.com/humanomelab/mlcourse/blob/master/2_deep_learning_for_features.ipynb"
    click nb3 "https://github.com/humanomelab/mlcourse/blob/master/3_deep_learning_for_images.ipynb"
    click nb4 "https://github.com/humanomelab/mlcourse/blob/master/4_deep_learning_for_sequences.ipynb"
    click script1 "https://github.com/humanomelab/mlcourse/blob/master/script/extract_seq.py"
    click script2 "https://github.com/humanomelab/mlcourse/blob/master/script/get_chipseq_peak_info.py"
    click script3 "https://github.com/humanomelab/mlcourse/blob/master/script/random_seq_except_listed.py"
    click model_feature "https://github.com/humanomelab/mlcourse/blob/master/src/yeast_feature_cnn.py"
    click model_image "https://github.com/humanomelab/mlcourse/blob/master/src/yeast_image_cnn.py"
    click model_chipseq "https://github.com/humanomelab/mlcourse/blob/master/src/chipseq_prediction_cnn.py"

    %% Styles
    classDef data fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef notebook fill:#90ee90,stroke:#000,stroke-width:2px;
    classDef script fill:#ffcc99,stroke:#000,stroke-width:2px;
    classDef model fill:#ff9999,stroke:#000,stroke-width:2px;
    classDef external fill:#dda0dd,stroke:#000,stroke-width:2px;
```
