# globalpneumoseq/gps-pipeline architecture

> Architecture diagram of the GitHub repository globalpneumoseq/gps-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/globalpneumoseq/gps-pipeline
- Repository: https://github.com/globalpneumoseq/gps-pipeline

## Overview

GPS Pipeline processes paired-end pneumococcal FASTQ reads into QC results and, for samples passing QC, typing and antimicrobial-resistance results. The README documents preprocessing, an initial read-bases assessment, then assembly, mapping and taxonomy assessment; passing samples receive serotype, MLST, GPSC lineage and AMR analyses, with annotation optional. The graph follows those documented stages and includes the reporting layer. Source excerpts were limited to three reporting/analysis scripts, so edges between pipeline modules are based on the README rather than inspected workflow calls.

Main entry points: [`workflows/pipeline.nf`](https://github.com/globalpneumoseq/gps-pipeline/blob/master/workflows/pipeline.nf) (Analysis workflow), [`modules/overall_qc.nf`](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/overall_qc.nf) (Overall QC), [`modules/amr.nf`](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/amr.nf) (AMR analysis), [`modules/preprocess.nf`](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/preprocess.nf) (Read preprocessing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Pipeline control"]
  node_workflow["Analysis workflow<br/>[pipeline.nf]"]
end

subgraph group_qc["Quality assessment"]
  node_preprocess["Read preprocessing<br/>[preprocess.nf]"]
  node_readqc["Read QC<br/>[overall_qc.nf]"]
  node_overallqc["Overall QC<br/>[overall_qc.nf]"]
end

subgraph group_analysis["Genomic analysis"]
  node_assembly["Assembly<br/>[assembly.nf]"]
  node_mapping["Reference mapping<br/>[mapping.nf]"]
  node_taxonomy["Taxonomy assessment<br/>[taxonomy.nf]"]
  node_serotype["Serotyping<br/>[serotype.nf]"]
  node_mlst["MLST typing<br/>[mlst.nf]"]
  node_lineage["GPSC lineage<br/>[lineage.nf]"]
  node_amr["AMR analysis<br/>[amr.nf]"]
  node_pbp["PBP resistance"]
  node_otheramr["Other resistance"]
  node_annotation["Genome annotation<br/>[annotation.nf]"]
end

subgraph group_results["Results and reporting"]
  node_report["Sample reports<br/>[output.nf]"]
  node_overallreport["Combined report"]
end

node_user(("FASTQ provider"))

node_user -->|"provides reads"| node_workflow
node_workflow -->|"runs"| node_preprocess
node_preprocess -->|"assesses bases"| node_readqc
node_workflow -->|"assesses"| node_assembly
node_workflow -->|"assesses"| node_mapping
node_workflow -->|"assesses"| node_taxonomy
node_workflow -->|"gates analysis"| node_overallqc
node_overallqc -->|"enables typing"| node_serotype
node_overallqc -->|"enables typing"| node_mlst
node_overallqc -->|"enables typing"| node_lineage
node_overallqc -->|"enables analysis"| node_amr
node_amr -.->|"assesses PBP"| node_pbp
node_amr -.->|"parses resistance"| node_otheramr
node_workflow -->|"optionally annotates"| node_annotation
node_workflow -.->|"produces results"| node_report
node_report -.->|"aggregates reports"| node_overallreport

click node_workflow "https://github.com/globalpneumoseq/gps-pipeline/blob/master/workflows/pipeline.nf"
click node_preprocess "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/preprocess.nf"
click node_readqc "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/overall_qc.nf"
click node_assembly "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/assembly.nf"
click node_mapping "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/mapping.nf"
click node_taxonomy "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/taxonomy.nf"
click node_overallqc "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/overall_qc.nf"
click node_serotype "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/serotype.nf"
click node_mlst "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/mlst.nf"
click node_lineage "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/lineage.nf"
click node_amr "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/amr.nf"
click node_pbp "https://github.com/globalpneumoseq/gps-pipeline/blob/master/bin/parse_pbp_resistance.sh"
click node_otheramr "https://github.com/globalpneumoseq/gps-pipeline/blob/master/bin/parse_other_resistance.py"
click node_annotation "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/annotation.nf"
click node_report "https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/output.nf"
click node_overallreport "https://github.com/globalpneumoseq/gps-pipeline/blob/master/bin/generate_overall_report.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_workflow toneBlue
class node_preprocess,node_readqc,node_overallqc toneAmber
class node_assembly,node_mapping,node_taxonomy,node_serotype,node_mlst,node_lineage,node_amr,node_pbp,node_otheramr,node_annotation toneMint
class node_report,node_overallreport toneRose
class node_user toneIndigo
```

## Components

### Pipeline control

- [Analysis workflow](https://github.com/globalpneumoseq/gps-pipeline/blob/master/workflows/pipeline.nf): `workflows/pipeline.nf`

### Quality assessment

- [Read preprocessing](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/preprocess.nf): `modules/preprocess.nf`
- [Read QC](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/overall_qc.nf): `modules/overall_qc.nf`
- [Overall QC](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/overall_qc.nf): `modules/overall_qc.nf`

### Genomic analysis

- [Assembly](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/assembly.nf): `modules/assembly.nf`
- [Reference mapping](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/mapping.nf): `modules/mapping.nf`
- [Taxonomy assessment](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/taxonomy.nf): `modules/taxonomy.nf`
- [Serotyping](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/serotype.nf): `modules/serotype.nf`
- [MLST typing](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/mlst.nf): `modules/mlst.nf`
- [GPSC lineage](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/lineage.nf): `modules/lineage.nf`
- [AMR analysis](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/amr.nf): `modules/amr.nf`
- [PBP resistance](https://github.com/globalpneumoseq/gps-pipeline/blob/master/bin/parse_pbp_resistance.sh): `bin/parse_pbp_resistance.sh`
- [Other resistance](https://github.com/globalpneumoseq/gps-pipeline/blob/master/bin/parse_other_resistance.py): `bin/parse_other_resistance.py`
- [Genome annotation](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/annotation.nf): `modules/annotation.nf`

### Results and reporting

- [Sample reports](https://github.com/globalpneumoseq/gps-pipeline/blob/master/modules/output.nf): `modules/output.nf`
- [Combined report](https://github.com/globalpneumoseq/gps-pipeline/blob/master/bin/generate_overall_report.py): `bin/generate_overall_report.py`

### Other components

- **FASTQ provider**

## Connections

- FASTQ provider → Analysis workflow: provides reads (evidence: `README.md`)
- Analysis workflow → Read preprocessing: runs (evidence: `README.md`)
- Read preprocessing → Read QC: assesses bases (evidence: `README.md`)
- Analysis workflow → Assembly: assesses (evidence: `README.md`)
- Analysis workflow → Reference mapping: assesses (evidence: `README.md`)
- Analysis workflow → Taxonomy assessment: assesses (evidence: `README.md`)
- Analysis workflow → Overall QC: gates analysis (evidence: `README.md`)
- Overall QC → Serotyping: enables typing (evidence: `README.md`)
- Overall QC → MLST typing: enables typing (evidence: `README.md`)
- Overall QC → GPSC lineage: enables typing (evidence: `README.md`)
- Overall QC → AMR analysis: enables analysis (evidence: `README.md`)
- AMR analysis → PBP resistance: assesses PBP
- AMR analysis → Other resistance: parses resistance
- Analysis workflow → Genome annotation: optionally annotates (evidence: `README.md`)
- Analysis workflow → Sample reports: produces results
- Sample reports → Combined report: aggregates reports
