# umcugenetics/dxnextflowrna architecture

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

- Interactive diagram: https://gitdiagram.com/umcugenetics/dxnextflowrna
- Repository: https://github.com/umcugenetics/dxnextflowrna

## Overview

##### Project type and purpose
- This is an open-source bioinformatics pipeline built in Nextflow DSL2, intended to process human RNA-seq FASTQ data into QC’d, trimmed, aligned, deduplicated, and QC-summarized outputs.
- The README describes a sequence of ten major steps (FastQC, MultiQC, TrimGalore, SortMeRNA, STAR, SAMtools, UMI-tools, CRAM conversion, RSeQC/Preseq QC, final MultiQC) and shows a “metro map” of the pipeline.

##### File structure
- Top-level:
- main.nf – the entrypoint workflow orchestrator
- nextflow.config, nf-params.yml, modules.json – configuration
- assets/ – templates for reports, config snippets, email/slack notifications
- conf/ – built-in profiles (base, test, modules)
- modules/ – DSL2 modules for each tool (fastqc, multiqc, picard, rseqc sub-tools, samtools sub-tools, etc.)
- subworkflows/ – higher-level composites (local vs nf-core variants)
- workflows/ – custom pipelines like dxnextflowrna.nf
- docs/, tests, CI configs, install.sh
- Patterns:
- DSL2 module directory = tool name, each with environment.yml (Conda) or Docker, main.nf, meta.yml, tests
- subworkflows wrap multiple modules into logical reusable chunks
- CI and testing via nf-test, GitHub Actions, AWS tests

##### README for additional insights
- Pipeline is configurable via CLI parameters or params files.
- Mentions conda, docker, singularity, Seqera launch.
- Emphasis on nf-core tools, versioning, citation updates.

##### Detailed capture of essential elements
- Don’t omit config injection, process isolation, testing, or reporting layers
- Modularity: each module has its own main.nf, meta.yml, environment.yml, tests
- That both local and nf-core subworkflows wrap these modules into alternative pipelines
- Way assets (email, Slack, templates) hook into pipeline for notifications

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Layer
    subgraph "Input Layer"
        Input["FASTQ Input"]:::external
    end
    click Input "https://github.com/umcugenetics/dxnextflowrna/blob/main/main.nf"

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        NextflowEngine["Nextflow Engine"]:::orchestration
        CustomWorkflow["Pipeline Definition"]:::orchestration
    end
    click NextflowEngine "https://github.com/umcugenetics/dxnextflowrna/blob/main/main.nf"
    click CustomWorkflow "https://github.com/umcugenetics/dxnextflowrna/blob/main/workflows/dxnextflowrna.nf"

    %% Configuration
    subgraph "Configuration"
        CoreConfig["nextflow.config"]:::orchestration
        ParamsConfig["nf-params.yml"]:::orchestration
        BaseConfig["conf/base.config"]:::orchestration
        ModulesConfig["conf/modules.config"]:::orchestration
        TestConfig["conf/test.config"]:::orchestration
        TestFullConfig["conf/test_full.config"]:::orchestration
    end
    click CoreConfig "https://github.com/umcugenetics/dxnextflowrna/blob/main/nextflow.config"
    click ParamsConfig "https://github.com/umcugenetics/dxnextflowrna/blob/main/nf-params.yml"
    click BaseConfig "https://github.com/umcugenetics/dxnextflowrna/blob/main/conf/base.config"
    click ModulesConfig "https://github.com/umcugenetics/dxnextflowrna/blob/main/conf/modules.config"
    click TestConfig "https://github.com/umcugenetics/dxnextflowrna/blob/main/conf/test.config"
    click TestFullConfig "https://github.com/umcugenetics/dxnextflowrna/blob/main/conf/test_full.config"

    %% Module Registry & Subworkflows
    subgraph "Module Registry & Subworkflows"
        ModulesRegistry["Modules Registry"]:::modules
        NFCoreModules["NF-Core Modules"]:::modules
        SubLocal["Subworkflows Local"]:::modules
        SubNFCore["Subworkflows NF-Core"]:::modules
    end
    click ModulesRegistry "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/"
    click NFCoreModules "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/"
    click SubLocal "https://github.com/umcugenetics/dxnextflowrna/tree/main/subworkflows/local/"
    click SubNFCore "https://github.com/umcugenetics/dxnextflowrna/tree/main/subworkflows/nf-core/"

    %% Execution Environments
    subgraph "Execution Environments"
        CondaEnvExample["Conda Env Example"]:::env
        DockerMetaExample["Docker/Singularity Meta"]:::env
    end
    click CondaEnvExample "https://github.com/umcugenetics/dxnextflowrna/blob/main/modules/nf-core/trimgalore/environment.yml"
    click DockerMetaExample "https://github.com/umcugenetics/dxnextflowrna/blob/main/modules/nf-core/star/align/meta.yml"

    %% Pipeline Steps (External Tools)
    subgraph "Pipeline Steps"
        FastQC["FastQC"]:::tool
        MultiQC1["MultiQC (Post-QC)"]:::tool
        TrimGalore["TrimGalore"]:::tool
        SortMeRNA["SortMeRNA"]:::tool
        STAR["STAR Align"]:::tool
        SAMtools["SAMtools"]:::tool
        UMITools["UMI-tools Dedup"]:::tool
        RSeQC["RSeQC QC"]:::tool
        Preseq["Preseq lcextrap"]:::tool
        MultiQC2["MultiQC (Final)"]:::tool
    end
    click FastQC "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/fastqc/"
    click TrimGalore "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/trimgalore/"
    click SortMeRNA "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/sortmerna/"
    click STAR "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/star/align/"
    click SAMtools "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/samtools/"
    click UMITools "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/umitools/dedup/"
    click RSeQC "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/rseqc/"
    click Preseq "https://github.com/umcugenetics/dxnextflowrna/tree/main/modules/nf-core/preseq/lcextrap/"

    %% Assets & Reports
    subgraph "Assets & Reports"
        AssetsNode["Assets"]:::assets
        MultiQCfg["MultiQC Config"]:::assets
    end
    click AssetsNode "https://github.com/umcugenetics/dxnextflowrna/tree/main/assets/"
    click MultiQCfg "https://github.com/umcugenetics/dxnextflowrna/blob/main/assets/multiqc_config.yml"

    %% CI/CD & Testing
    subgraph "CI/CD & Testing"
        ModulesJSON["modules.json"]:::ci
        NFCoreYML[".nf-core.yml"]:::ci
    end
    click ModulesJSON "https://github.com/umcugenetics/dxnextflowrna/blob/main/modules.json"
    click NFCoreYML "https://github.com/umcugenetics/dxnextflowrna/blob/main/.nf-core.yml"

    %% Documentation & Helpers
    subgraph "Documentation & Helpers"
        Docs["docs/"]:::docs
        InstallScript["install.sh"]:::docs
        RunScript["run_nextflow_rna.sh"]:::docs
    end
    click Docs "https://github.com/umcugenetics/dxnextflowrna/tree/main/docs/"
    click InstallScript "https://github.com/umcugenetics/dxnextflowrna/blob/main/install.sh"
    click RunScript "https://github.com/umcugenetics/dxnextflowrna/blob/main/run_nextflow_rna.sh"

    %% Data Flow
    Input --> NextflowEngine
    NextflowEngine --> CustomWorkflow
    NextflowEngine --> CoreConfig
    NextflowEngine --> ParamsConfig
    NextflowEngine --> BaseConfig
    NextflowEngine --> ModulesConfig
    NextflowEngine --> TestConfig
    NextflowEngine --> TestFullConfig
    NextflowEngine --> ModulesRegistry
    NextflowEngine --> SubLocal
    NextflowEngine --> SubNFCore
    CustomWorkflow --> ModulesRegistry

    ModulesRegistry --> FastQC
    FastQC --> MultiQC1
    MultiQC1 --> TrimGalore
    TrimGalore --> SortMeRNA
    SortMeRNA --> STAR
    STAR --> SAMtools
    SAMtools --> UMITools
    UMITools --> RSeQC
    RSeQC --> Preseq
    Preseq --> MultiQC2

    FastQC --> CondaEnvExample
    TrimGalore --> CondaEnvExample
    STAR --> DockerMetaExample

    %% Grouping flows
    SubLocal --> ModulesRegistry
    SubNFCore --> ModulesRegistry

    %% Styles
    classDef orchestration fill:#ADD8E6,stroke:#000;
    classDef modules fill:#90EE90,stroke:#000;
    classDef tool fill:#FFA500,stroke:#000;
    classDef env fill:#FFFACD,stroke:#000;
    classDef assets fill:#E0FFFF,stroke:#000;
    classDef ci fill:#D3D3D3,stroke:#000;
    classDef docs fill:#FFE4E1,stroke:#000;
    classDef external fill:#F0F8FF,stroke:#000;
```
