# maxplanck-ie/snakepipes architecture

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

- Interactive diagram: https://gitdiagram.com/maxplanck-ie/snakepipes
- Repository: https://github.com/maxplanck-ie/snakepipes

## Overview

##### Main Components

a. Core Framework Layer:
- snakePipes core module
- Common functions and parsers
- Shared resources and configurations

b. Workflow Layer:
- DNA mapping
- ChIP-seq
- RNA-seq (mRNA and ncRNA)
- ATAC-seq
- scRNA-seq
- HiC
- WGBS
- Other specialized workflows

c. Resource Management Layer:
- Conda environment management
- Workflow-specific environments
- Shared tools and scripts

d. Execution Layer:
- Local execution profile
- Generic cluster profile
- Job management system

##### Component Relationships

- Core Framework → Workflows (inheritance/dependency)
- Workflows → Shared Rules (usage)
- Workflows → Environment Files (configuration)
- Execution Layer → All Components (orchestration)

##### Specific Design Elements

Use the following visual elements:
- Hexagons for workflow modules
- Blue: Core components
- Green: Workflows
- Yellow: Resource management
- Gray: Execution layer

##### Detailed Component Breakdown

**┌─ Core Framework ─────────────────┐**
- Common Functions              │
- Parser Common                 │
- Shared Defaults              │
- ┬────────────────┘

**┌───────────────▼────────────────┐**
- Workflow Management            │
- ┬──────────┬───────┤
- DNA/RNA    │ Epigenetic│ Other │
- DNAmap   │ - ChIP    │ - HiC │
- mRNA     │ - ATAC    │ - WGBS│
- ncRNA    │           │       │
- ┴──────────┴───────┘

- ▼
**┌─ Resource Management ──────────┐**
- Conda Environments          │
- Shared Tools               │
- R Scripts                  │
- ┬──────────────┘

**┌───────────────▼──────────────┐**
- Execution Layer              │
- Local Profile             │
- Cluster Profile           │
- ┘

##### Important Details

- File organization structure
- Workflow dependencies
- Configuration inheritance
- Resource allocation paths
- Data flow between components
- Input/Output relationships

##### Notes for Implementation

- Architectural relationships
- Extensibility points
- Integration with external tools
- Version control and testing frameworks

Remember to include documentation references and maintain alignment with the actual codebase structure as shown in the file tree.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        CF[Common Functions]
        PC[Parser Common]
        SD[Shared Defaults]
    end

    subgraph Workflows
        direction TB
        subgraph "DNA/RNA Workflows"
            direction TB
            DNA["DNA Mapping"]:::workflow
            RNA["RNA-seq"]:::workflow
            ncRNA["ncRNA-seq"]:::workflow
            scRNA["scRNA-seq"]:::workflow
        end

        subgraph "Epigenetic Workflows"
            direction TB
            CHIP["ChIP-seq"]:::workflow
            ATAC["ATAC-seq"]:::workflow
            WGBS["WGBS"]:::workflow
        end

        subgraph "Other Workflows"
            direction TB
            HIC["HiC"]:::workflow
        end
    end

    subgraph "Resource Management"
        direction TB
        CONDA["Conda Environments"]
        RSCRIPT["R Scripts"]
        TOOLS["Shared Tools"]
        RULES["Shared Rules"]
    end

    subgraph "Execution Layer"
        direction TB
        LP["Local Profile"]
        CP["Generic Cluster Profile"]
    end

    subgraph "Organism Resources"
        ORG["Organism Configurations"]
    end

    subgraph "Testing"
        TEST["Test Suite"]
        CI["CI Configuration"]
    end

    %% Core relationships
    CF --> DNA
    CF --> RNA
    CF --> CHIP
    PC --> DNA
    PC --> RNA
    PC --> CHIP
    SD --> RULES

    %% Workflow dependencies
    DNA --> RULES
    RNA --> RULES
    CHIP --> RULES
    ATAC --> RULES
    scRNA --> RULES
    HIC --> RULES
    WGBS --> RULES
    ncRNA --> RULES

    %% Resource relationships
    RULES --> CONDA
    RULES --> RSCRIPT
    RULES --> TOOLS

    %% Execution relationships
    LP --> RULES
    CP --> RULES

    %% Testing relationships
    TEST --> Workflows
    CI --> TEST

    %% Resource dependencies
    ORG --> Workflows

    %% Styling
    classDef workflow fill:#90EE90
    classDef core fill:#ADD8E6
    classDef resource fill:#FFE4B5
    classDef execution fill:#D3D3D3
    classDef testing fill:#F0F8FF

    %% Click events
    click CF "https://github.com/maxplanck-ie/snakePipes/blob/master/snakePipes/common_functions.py"
    click PC "https://github.com/maxplanck-ie/snakePipes/blob/master/snakePipes/parserCommon.py"
    click SD "https://github.com/maxplanck-ie/snakePipes/blob/master/snakePipes/shared/defaults.yaml"
    click DNA "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/workflows/DNAmapping/"
    click CHIP "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/workflows/ChIPseq/"
    click RNA "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/workflows/mRNAseq/"
    click ATAC "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/workflows/ATACseq/"
    click scRNA "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/workflows/scRNAseq/"
    click HIC "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/workflows/HiC/"
    click WGBS "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/workflows/WGBS/"
    click ncRNA "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/workflows/ncRNAseq/"
    click CONDA "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/shared/rules/envs/"
    click RSCRIPT "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/shared/rscripts/"
    click TOOLS "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/shared/tools/"
    click RULES "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/shared/rules/"
    click LP "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/shared/profiles/local/"
    click CP "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/shared/profiles/snakepipes_genericprofile/"
    click ORG "https://github.com/maxplanck-ie/snakePipes/tree/master/snakePipes/shared/organisms/"
    click TEST "https://github.com/maxplanck-ie/snakePipes/tree/master/tests/"
    click CI "https://github.com/maxplanck-ie/snakePipes/tree/master/.github/workflows"
```
