# imallona/repeats architecture

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

- Interactive diagram: https://gitdiagram.com/imallona/repeats
- Repository: https://github.com/imallona/repeats

## Overview

##### Main Components Organization

a) Input Layer:
- Configuration files (workflow/configs/*.yaml)
- Reference data inputs (RepeatMasker and GENCODE annotations)

b) Workflow Layer (Core Processing):
Main Snakemake workflows as connected modules:
- Data Acquisition (data_acquisition.snmk)
- Reference Making (reference_making.snmk)
- Analysis Pipelines:
- Alevin Pipeline (alevin.snmk)
- STARsolo Pipeline (starsolo.snmk)
- Counting Pipeline (counting.snmk)
- Simulation Pipeline (simulations.snmk)

c) Processing Scripts Layer:
- Cell Barcode Processing Scripts
- Integration Scripts (R Markdown files)
- Summary Generation Scripts

d) Output Layer:
- Analysis Results
- Reports
- Integrated Data

##### Flow Directions

- Raw data → Data Acquisition → Processing Pipelines
- Reference Data → Reference Making → Processing Pipelines
- Processing Results → Integration Scripts → Final Reports

##### Key Features to Highlight

a) Conda Environment Integration:
- Connection to workflow/envs/repeats.yaml
- Conda-managed dependencies

b) Pipeline Variants:
- Different analysis paths for various sequencing technologies
- Parallel processing capabilities

c) Configuration Management:
- Configuration validation through workflow/schemas/config.schema.yaml
- How configs feed into different pipeline branches

##### Additional Details

- Version information (v0.1 vs. current)
- Integration points with Zenodo for data sharing
- Where different cell types are processed
- Parallel processing capabilities

- High-level workflow overview
- Detailed processing steps
- Technical implementation details
- Data flow patterns

Remember to:
- Clear separation between different analysis approaches
- Where configuration changes can affect the workflow
- Points where quality control and validation occur

This system design should clearly communicate how the pipeline processes different types of single-cell RNA-seq data while maintaining flexibility for different input types and analysis requirements.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input["Input Layer"]
        direction TB
        RawData[/"Raw scRNA-seq Datasets"/]
        ConfigFiles["Configuration Files"]:::config
        RefData[/"Reference Data (RepeatMasker & GENCODE)"/]
    end

    subgraph Workflow["Workflow Layer"]
        direction TB
        MainSnake["Main Workflow"]:::workflow
        DataAcq["Data Acquisition"]:::workflow
        RefMake["Reference Making"]:::workflow
        
        subgraph Pipelines["Analysis Pipelines"]
            direction TB
            Alevin["Alevin Pipeline"]:::workflow
            STARsolo["STARsolo Pipeline"]:::workflow
            Counting["Counting Pipeline"]:::workflow
            Sim["Simulation Pipeline"]:::workflow
        end
    end

    subgraph Processing["Processing Scripts Layer"]
        direction TB
        CellBarcode["Cell Barcode Processing"]:::script
        Integration["Integration Scripts"]:::script
        Summary["Summary Generation"]:::script
    end

    subgraph Output["Output Layer"]
        direction TB
        Results[/"Analysis Results"/]
        Reports[/"Reports"/]
        IntData[/"Integrated Data"/]
    end

    subgraph Environment["Environment & Utils"]
        direction TB
        Conda[("Conda Environment")]:::env
        Utils["Utility Tools"]:::utils
    end

    %% Relationships
    RawData --> DataAcq
    RefData --> RefMake
    ConfigFiles --> MainSnake
    
    MainSnake --> DataAcq
    MainSnake --> RefMake
    
    DataAcq --> Pipelines
    RefMake --> Pipelines
    
    Pipelines --> CellBarcode
    Pipelines --> Integration
    Pipelines --> Summary
    
    CellBarcode --> Results
    Integration --> IntData
    Summary --> Reports
    
    Conda -.-> Workflow
    Utils -.-> Workflow

    %% Click Events
    click MainSnake "https://github.com/imallona/repeats/tree/master/workflow/Snakefile"
    click DataAcq "https://github.com/imallona/repeats/blob/master/workflow/data_acquisition.snmk"
    click RefMake "https://github.com/imallona/repeats/blob/master/workflow/reference_making.snmk"
    click Alevin "https://github.com/imallona/repeats/blob/master/workflow/alevin.snmk"
    click STARsolo "https://github.com/imallona/repeats/blob/master/workflow/starsolo.snmk"
    click Counting "https://github.com/imallona/repeats/blob/master/workflow/counting.snmk"
    click Sim "https://github.com/imallona/repeats/blob/master/workflow/simulations.snmk"
    click ConfigFiles "https://github.com/imallona/repeats/tree/master/workflow/configs/"
    click CellBarcode "https://github.com/imallona/repeats/tree/master/workflow/scripts/"
    click Integration "https://github.com/imallona/repeats/tree/master/workflow/scripts/"
    click Summary "https://github.com/imallona/repeats/tree/master/workflow/scripts/"
    click Conda "https://github.com/imallona/repeats/blob/master/workflow/envs/repeats.yaml"
    click Utils "https://github.com/imallona/repeats/tree/master/workflow/utils/"

    %% Styling
    classDef workflow fill:#2374f7,stroke:#333,stroke-width:2px
    classDef script fill:#a44bf7,stroke:#333,stroke-width:2px
    classDef config fill:#f7d223,stroke:#333,stroke-width:2px
    classDef env fill:#23f7b2,stroke:#333,stroke-width:2px
    classDef utils fill:#f76223,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        direction TB
        L1["Workflow Component"]:::workflow
        L2["Processing Script"]:::script
        L3["Configuration"]:::config
        L4[("Environment")]:::env
        L5["Utilities"]:::utils
    end
```
