# antoglz/mirdex-nf architecture

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

- Interactive diagram: https://gitdiagram.com/antoglz/mirdex-nf
- Repository: https://github.com/antoglz/mirdex-nf

## Overview

miRdeX-nf is a Nextflow small-RNA sequencing pipeline for independent multi-project, comparison, and species analyses. Users supply a samplesheet containing FASTQ, SRA, or counts-matrix inputs; the workflow validates inputs, preprocesses reads, quantifies sRNAs, performs differential expression, and annotates miRNAs/isomiRs, with optional global event summaries. The graph preserves the README’s major stages, but source excerpts do not show the main workflow’s wiring, so relationships between most stages are documented, dashed links rather than asserted calls.

Main entry points: [`workflows/mirdex/main.nf`](https://github.com/antoglz/mirdex-nf/blob/main/workflows/mirdex/main.nf) (Input modes), [`subworkflows/local/quantification/main.nf`](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/quantification/main.nf) (sRNA quantification), [`modules/nf-core/fastp/main.nf`](https://github.com/antoglz/mirdex-nf/blob/main/modules/nf-core/fastp/main.nf) (Read preprocessing), [`subworkflows/local/complete_blastn/main.nf`](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/complete_blastn/main.nf) (Reference alignment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Inputs and validation"]
  node_pipeline["Pipeline entry<br/>[main.nf]"]
  node_input_modes["Input modes<br/>[main.nf]"]
  node_library_validation["Library validation"]
  node_matrix_validation["Matrix validation"]
end

subgraph group_reads["Read processing"]
  node_sra_download["SRA download<br/>[main.nf]"]
  node_read_preprocessing["Read preprocessing<br/>[main.nf]"]
  node_read_qc["Read QC<br/>[main.nf]"]
  node_filter_align["Read filtering<br/>[main.nf]"]
end

subgraph group_analysis["Quantification and expression"]
  node_quantification["sRNA quantification<br/>[main.nf]"]
  node_count_matrix["Count matrices"]
  node_differential_expression["Differential expression<br/>[main.nf]"]
end

subgraph group_annotation["miRNA annotation"]
  node_database_prep["miRNA databases<br/>[main.nf]"]
  node_blast_annotation["Reference alignment<br/>[main.nf]"]
  node_isomir_identification["isomiR identification<br/>[main.nf]"]
  node_isomir_classification["isomiR classification"]
  node_abundance_filter["Abundance filtering<br/>[main.nf]"]
  node_dea_annotation["DE result annotation"]
end

subgraph group_summaries["Cross-event summaries"]
  node_event_matrix["Event matrices"]
  node_mintplates["Sequence license plates<br/>[mintplates.py]"]
end

node_user(("Researcher"))

node_user -.->|"runs"| node_pipeline
node_pipeline -.->|"dispatches"| node_input_modes
node_input_modes -.->|"validates reads"| node_library_validation
node_input_modes -.->|"validates counts"| node_matrix_validation
node_input_modes -.->|"downloads SRA"| node_sra_download
node_sra_download -.->|"produces reads"| node_read_preprocessing
node_read_preprocessing -.->|"checks quality"| node_read_qc
node_read_preprocessing -.->|"filters reads"| node_filter_align
node_input_modes -.->|"processes inputs"| node_quantification
node_filter_align -.->|"supplies aligned reads"| node_quantification
node_quantification -.->|"generates counts"| node_count_matrix
node_count_matrix -.->|"analyzes counts"| node_differential_expression
node_database_prep -.->|"provides references"| node_blast_annotation
node_quantification -.->|"aligns sRNAs"| node_blast_annotation
node_blast_annotation -.->|"classifies alignments"| node_isomir_identification
node_isomir_identification -.->|"classifies variants"| node_isomir_classification
node_isomir_classification -.->|"filters variants"| node_abundance_filter
node_differential_expression -.->|"annotates results"| node_dea_annotation
node_dea_annotation -.->|"summarizes events"| node_event_matrix

click node_pipeline "https://github.com/antoglz/mirdex-nf/blob/main/main.nf"
click node_input_modes "https://github.com/antoglz/mirdex-nf/blob/main/workflows/mirdex/main.nf"
click node_library_validation "https://github.com/antoglz/mirdex-nf/blob/main/bin/02-Validate_libraries.py"
click node_matrix_validation "https://github.com/antoglz/mirdex-nf/blob/main/bin/02-Validate_counts_matrix.py"
click node_sra_download "https://github.com/antoglz/mirdex-nf/blob/main/modules/nf-core/sratools/prefetch/main.nf"
click node_read_preprocessing "https://github.com/antoglz/mirdex-nf/blob/main/modules/nf-core/fastp/main.nf"
click node_read_qc "https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/qualitycontrol/main.nf"
click node_filter_align "https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/filtering/main.nf"
click node_quantification "https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/quantification/main.nf"
click node_count_matrix "https://github.com/antoglz/mirdex-nf/blob/main/bin/03-Create_counts_matrix.py"
click node_differential_expression "https://github.com/antoglz/mirdex-nf/blob/main/modules/local/diffexpanalysis/main.nf"
click node_database_prep "https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/prepare_mirna_databases/main.nf"
click node_blast_annotation "https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/complete_blastn/main.nf"
click node_isomir_identification "https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/isomirs_identification/main.nf"
click node_isomir_classification "https://github.com/antoglz/mirdex-nf/blob/main/bin/05-IsomiRs_classification.py"
click node_abundance_filter "https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/filter_nontemplated_isomirs/main.nf"
click node_dea_annotation "https://github.com/antoglz/mirdex-nf/blob/main/bin/06-Annotate_dea_results.r"
click node_event_matrix "https://github.com/antoglz/mirdex-nf/blob/main/bin/07-miRNA_event_matrix_builder.py"
click node_mintplates "https://github.com/antoglz/mirdex-nf/blob/main/bin/mintplates.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_pipeline,node_input_modes,node_library_validation,node_matrix_validation toneBlue
class node_sra_download,node_read_preprocessing,node_read_qc,node_filter_align toneAmber
class node_quantification,node_count_matrix,node_differential_expression toneMint
class node_database_prep,node_blast_annotation,node_isomir_identification,node_isomir_classification,node_abundance_filter,node_dea_annotation toneRose
class node_event_matrix,node_mintplates,node_user toneIndigo
```

## Components

### Inputs and validation

- [Pipeline entry](https://github.com/antoglz/mirdex-nf/blob/main/main.nf): `main.nf`
- [Input modes](https://github.com/antoglz/mirdex-nf/blob/main/workflows/mirdex/main.nf): `workflows/mirdex/main.nf`
- [Library validation](https://github.com/antoglz/mirdex-nf/blob/main/bin/02-Validate_libraries.py): `bin/02-Validate_libraries.py`
- [Matrix validation](https://github.com/antoglz/mirdex-nf/blob/main/bin/02-Validate_counts_matrix.py): `bin/02-Validate_counts_matrix.py`

### Read processing

- [SRA download](https://github.com/antoglz/mirdex-nf/blob/main/modules/nf-core/sratools/prefetch/main.nf): `modules/nf-core/sratools/prefetch/main.nf`
- [Read preprocessing](https://github.com/antoglz/mirdex-nf/blob/main/modules/nf-core/fastp/main.nf): `modules/nf-core/fastp/main.nf`
- [Read QC](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/qualitycontrol/main.nf): `subworkflows/local/qualitycontrol/main.nf`
- [Read filtering](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/filtering/main.nf): `subworkflows/local/filtering/main.nf`

### Quantification and expression

- [sRNA quantification](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/quantification/main.nf): `subworkflows/local/quantification/main.nf`
- [Count matrices](https://github.com/antoglz/mirdex-nf/blob/main/bin/03-Create_counts_matrix.py): `bin/03-Create_counts_matrix.py`
- [Differential expression](https://github.com/antoglz/mirdex-nf/blob/main/modules/local/diffexpanalysis/main.nf): `modules/local/diffexpanalysis/main.nf`

### miRNA annotation

- [miRNA databases](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/prepare_mirna_databases/main.nf): `subworkflows/local/prepare_mirna_databases/main.nf`
- [Reference alignment](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/complete_blastn/main.nf): `subworkflows/local/complete_blastn/main.nf`
- [isomiR identification](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/isomirs_identification/main.nf): `subworkflows/local/isomirs_identification/main.nf`
- [isomiR classification](https://github.com/antoglz/mirdex-nf/blob/main/bin/05-IsomiRs_classification.py): `bin/05-IsomiRs_classification.py`
- [Abundance filtering](https://github.com/antoglz/mirdex-nf/blob/main/subworkflows/local/filter_nontemplated_isomirs/main.nf): `subworkflows/local/filter_nontemplated_isomirs/main.nf`
- [DE result annotation](https://github.com/antoglz/mirdex-nf/blob/main/bin/06-Annotate_dea_results.r): `bin/06-Annotate_dea_results.r`

### Cross-event summaries

- [Event matrices](https://github.com/antoglz/mirdex-nf/blob/main/bin/07-miRNA_event_matrix_builder.py): `bin/07-miRNA_event_matrix_builder.py`
- [Sequence license plates](https://github.com/antoglz/mirdex-nf/blob/main/bin/mintplates.py): `bin/mintplates.py`

### Other components

- **Researcher**

## Connections

- Researcher → Pipeline entry: runs (evidence: `README.md`)
- Pipeline entry → Input modes: dispatches
- Input modes → Library validation: validates reads
- Input modes → Matrix validation: validates counts
- Input modes → SRA download: downloads SRA (evidence: `README.md`)
- SRA download → Read preprocessing: produces reads (evidence: `README.md`)
- Read preprocessing → Read QC: checks quality (evidence: `README.md`)
- Read preprocessing → Read filtering: filters reads (evidence: `README.md`)
- Input modes → sRNA quantification: processes inputs (evidence: `README.md`)
- Read filtering → sRNA quantification: supplies aligned reads (evidence: `README.md`)
- sRNA quantification → Count matrices: generates counts (evidence: `README.md`)
- Count matrices → Differential expression: analyzes counts (evidence: `README.md`)
- miRNA databases → Reference alignment: provides references (evidence: `README.md`)
- sRNA quantification → Reference alignment: aligns sRNAs (evidence: `README.md`)
- Reference alignment → isomiR identification: classifies alignments (evidence: `README.md`)
- isomiR identification → isomiR classification: classifies variants
- isomiR classification → Abundance filtering: filters variants (evidence: `README.md`)
- Differential expression → DE result annotation: annotates results (evidence: `README.md`)
- DE result annotation → Event matrices: summarizes events (evidence: `README.md`)
