# stamlab/stampipes architecture

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

- Interactive diagram: https://gitdiagram.com/stamlab/stampipes
- Repository: https://github.com/stamlab/stampipes

## Overview

##### Project Type and Purpose
This is a specialized bioinformatics pipeline system for processing Illumina sequencing data. It's a complex data processing pipeline that includes multiple analysis workflows and tools.

##### Main Components

a. Input Processing Layer:
- BCL2FASTQ conversion (from raw sequencing data)
- FastQC quality control
- Adapter trimming and barcode processing

b. Alignment Layer:
- Multiple aligners (BWA, TopHat, STAR)
- RNA-seq specific processing
- DNA-seq specific processing

c. Post-Processing Layer:
- Duplicate marking
- Quality metrics collection
- Peak calling
- Density calculations

d. Analysis Layer:
- RNA expression analysis (Cufflinks)
- Alternative coding sequence analysis
- SPOT score calculation
- Motif analysis

e. Infrastructure Components:
- LIMS API integration
- Reference genome management
- Configuration management
- Results aggregation

**[Input Data Layer]**

- ▼
**[Data QC & Preprocessing]──────[Configuration Management]**

- ▼                               ▼
**[Alignment Layer]───────────────[Reference Genomes]**

- ▼
**[Post-Processing Layer]**

- ▼
**[Analysis Layer]**

- ▼
**[Results & Reporting]────────[LIMS Integration]**

##### Special Features to Highlight

- Modular design (shown by the processes/ directory structure)
- Multiple workflow support (RNA-seq, DNA-seq, etc.)
- Pipeline orchestration using Nextflow
- Container support (Dockerfile and container definitions)
- Test data integration
- Version control and environment management

##### Technical Details

- Module dependencies (from README)
- Key file formats (FASTQ, BAM, CRAM, etc.)
- Major tools and their versions
- Configuration requirements (environment variables)

##### Infrastructure Notes

- How the LIMS API integrates
- Where environment variables are used
- Points where external tools are called
- Data storage and movement patterns

Remember to indicate both the linear flow of data processing and the various entry points where different types of analysis can begin, as this system supports multiple types of sequencing data analysis workflows.

This design should help users understand both the high-level architecture and the specific implementation details of this complex bioinformatics pipeline system.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        BCL["BCL2FASTQ Processing"]:::input
        QC["Quality Control"]:::qc
        AP["Adapter Processing"]:::input
        UMI["UMI Processing"]:::input
    end

    subgraph Alignment
        BWA["BWA Alignment"]:::align
        TopHat["TopHat Alignment"]:::align
        STAR["STAR Alignment"]:::align
    end

    subgraph Processing
        DNA["DNA-seq Processing"]:::process
        RNA["RNA-seq Processing"]:::process
    end

    subgraph PostProcess
        DM["Duplicate Marking"]:::post
        QM["Quality Metrics"]:::post
        PC["Peak Calling"]:::post
        DC["Density Calculations"]:::post
    end

    subgraph Analysis
        SPOT["SPOT Analysis"]:::analysis
        ACA["Alternative Coding Analysis"]:::analysis
        REA["RNA Expression Analysis"]:::analysis
    end

    subgraph Infrastructure
        LIMS["LIMS Integration"]:::infra
        RGM["Reference Genome Management"]:::infra
        CM["Configuration Management"]:::infra
        RA["Results Aggregation"]:::infra
    end

    BCL --> QC
    QC --> AP
    AP --> UMI
    UMI --> BWA & TopHat & STAR
    BWA --> DNA
    TopHat & STAR --> RNA
    DNA & RNA --> DM
    DM --> QM
    QM --> PC
    PC --> DC
    DC --> SPOT & ACA & REA
    SPOT & ACA & REA --> RA
    RA --> LIMS
    RGM -.-> BWA & TopHat & STAR
    CM -.-> BCL & QC & AP

    classDef input fill:#3498db
    classDef qc fill:#e67e22
    classDef align fill:#2ecc71
    classDef process fill:#95a5a6
    classDef post fill:#9b59b6
    classDef analysis fill:#f1c40f
    classDef infra fill:#7f8c8d

    click BCL "https://github.com/stamlab/stampipes/blob/main/modules/bcl2fastq.nf"
    click QC "https://github.com/stamlab/stampipes/blob/main/modules/fastqc.nf"
    click AP "https://github.com/stamlab/stampipes/blob/main/modules/adapter_trimming.nf"
    click BWA "https://github.com/stamlab/stampipes/tree/main/processes/bwa/"
    click TopHat "https://github.com/stamlab/stampipes/tree/main/processes/tophat/"
    click STAR "https://github.com/stamlab/stampipes/tree/main/processes/rna-star/"
    click DM "https://github.com/stamlab/stampipes/tree/main/makefiles/picard/"
    click DC "https://github.com/stamlab/stampipes/tree/main/makefiles/densities/"
    click SPOT "https://github.com/stamlab/stampipes/tree/main/makefiles/SPOT/"
    click ACA "https://github.com/stamlab/stampipes/tree/main/processes/altcode/"
    click REA "https://github.com/stamlab/stampipes/tree/main/processes/rna-star/aggregation/"
    click LIMS "https://github.com/stamlab/stampipes/tree/main/scripts/lims/"
    click RGM "https://github.com/stamlab/stampipes/tree/main/processes/build_references/"
    click CM "https://github.com/stamlab/stampipes/tree/main/config/"
    click RA "https://github.com/stamlab/stampipes/tree/main/scripts/bwa/aggregate/"
    click RNA "https://github.com/stamlab/stampipes/tree/main/processes/rna-star/"
    click DNA "https://github.com/stamlab/stampipes/tree/main/processes/dna-bwa/"
    click UMI "https://github.com/stamlab/stampipes/blob/main/modules/umt.nf"
    click QM "https://github.com/stamlab/stampipes/tree/main/scripts/tophat/aggregate/"
    click PC "https://github.com/stamlab/stampipes/tree/main/scripts/bwa/aggregate/basic"
```
