# ylab-hi/scanneo2 architecture

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

- Interactive diagram: https://gitdiagram.com/ylab-hi/scanneo2
- Repository: https://github.com/ylab-hi/scanneo2

## Overview

ScanNeo2 is a Snakemake workflow that turns RNA-sequencing and variant inputs into predicted neoantigens. Users configure and launch the workflow; documented event sources include SNVs, indels, canonical and exitron splicing, and gene fusions, with custom variants also supported. Prioritization reconstructs variant effects, predicts MHC binding, and adds immunogenicity and similarity scores. The README establishes the product workflow and source capabilities; prioritization connections are supported by excerpts, while unsampled workflow-rule connections are shown as unverified.

Main entry points: [`workflow/Snakefile`](https://github.com/ylab-hi/scanneo2/blob/main/workflow/Snakefile) (Workflow orchestration), [`workflow/scripts/prioritization/compile.py`](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/compile.py) (Prioritization entry), [`workflow/scripts/prioritization/effects.py`](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/effects.py) (Variant effects), [`workflow/rules/hlatyping_prep.smk`](https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/hlatyping_prep.smk) (HLA preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow stages"]
  node_config["Workflow configuration<br/>[config.yaml]"]
  node_snakemake["Workflow orchestration"]
  node_rna["RNA processing<br/>[preproc.smk]"]
  node_align["Read alignment<br/>[align.smk]"]
  node_quant["Expression quantification<br/>[quantification.smk]"]
  node_variant_sources["Variant event sources"]
end

subgraph group_genotyping["HLA genotyping"]
  node_hla_prep["HLA preparation<br/>[hlatyping_prep.smk]"]
  node_hla_i["MHC-I typing<br/>[hlatyping_mhcI.smk]"]
  node_hla_ii["MHC-II typing"]
end

subgraph group_prioritization["Prioritization"]
  node_prioritize["Prioritization entry<br/>[compile.py]"]
  node_variant_effects["Variant effects<br/>[effects.py]"]
  node_variant_processing["Variant processing<br/>[variants.py]"]
  node_fusion_processing["Fusion processing<br/>[fusions.py]"]
  node_protein_processing["Protein input processing<br/>[proteins.py]"]
  node_reference_data["Reference data<br/>[reference.py]"]
  node_prediction["MHC binding prediction<br/>[prediction.py]"]
  node_filtering["Immunogenicity and similarity<br/>[filtering.py]"]
end

subgraph group_outputs["Results and reporting"]
  node_effects_output["Variant effects tables<br/>[effects.py]"]
  node_epitope_output["Neoepitope tables<br/>[prediction.py]"]
  node_report["Reporting<br/>[report.py]"]
  node_summary["Summary<br/>[summarize.py]"]
end

node_user(("Researcher"))

node_user -->|"sets options"| node_config
node_user -->|"launches workflow"| node_snakemake
node_config -.->|"configures"| node_snakemake
node_snakemake -.->|"dispatches"| node_rna
node_snakemake -.->|"dispatches"| node_align
node_snakemake -.->|"dispatches"| node_quant
node_snakemake -.->|"dispatches"| node_variant_sources
node_snakemake -.->|"dispatches"| node_hla_prep
node_snakemake -.->|"dispatches"| node_prioritize
node_rna -.->|"supplies reads"| node_align
node_align -.->|"supplies alignments"| node_quant
node_hla_prep -.->|"prepares typing"| node_hla_i
node_hla_prep -.->|"prepares typing"| node_hla_ii
node_variant_sources -.->|"provides event inputs"| node_prioritize
node_hla_i -.->|"provides alleles"| node_prioritize
node_hla_ii -.->|"provides alleles"| node_prioritize
node_quant -.->|"provides expression"| node_prioritize
node_prioritize -->|"processes variants"| node_variant_processing
node_prioritize -->|"processes fusions"| node_fusion_processing
node_prioritize -->|"processes custom proteins"| node_protein_processing
node_variant_processing -->|"registers effects"| node_variant_effects
node_fusion_processing -->|"registers effects"| node_variant_effects
node_protein_processing -->|"registers effects"| node_variant_effects
node_variant_processing -->|"loads annotation"| node_reference_data
node_fusion_processing -->|"loads reference"| node_reference_data
node_variant_effects -->|"uses annotation and counts"| node_reference_data
node_variant_effects -->|"writes"| node_effects_output
node_prioritize -->|"starts prediction"| node_prediction
node_prediction -->|"writes"| node_epitope_output
node_prioritize -->|"scores epitopes"| node_filtering
node_snakemake -.->|"runs reporting"| node_report
node_snakemake -.->|"runs summary"| node_summary

click node_config "https://github.com/ylab-hi/scanneo2/blob/main/config/config.yaml"
click node_snakemake "https://github.com/ylab-hi/scanneo2/blob/main/workflow/Snakefile"
click node_rna "https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/preproc.smk"
click node_align "https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/align.smk"
click node_quant "https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/quantification.smk"
click node_variant_sources "https://github.com/ylab-hi/scanneo2/tree/main/workflow/rules"
click node_hla_prep "https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/hlatyping_prep.smk"
click node_hla_i "https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/hlatyping_mhcI.smk"
click node_hla_ii "https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/hlatyping_mhcII.smk"
click node_prioritize "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/compile.py"
click node_variant_effects "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/effects.py"
click node_variant_processing "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/variants.py"
click node_fusion_processing "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/fusions.py"
click node_protein_processing "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/proteins.py"
click node_reference_data "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/reference.py"
click node_prediction "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/prediction.py"
click node_filtering "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/filtering.py"
click node_effects_output "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/effects.py"
click node_epitope_output "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/prediction.py"
click node_report "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/report.py"
click node_summary "https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/summarize.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_config,node_snakemake,node_rna,node_align,node_quant,node_variant_sources toneBlue
class node_hla_prep,node_hla_i,node_hla_ii toneAmber
class node_prioritize,node_variant_effects,node_variant_processing,node_fusion_processing,node_protein_processing,node_reference_data,node_prediction,node_filtering toneMint
class node_effects_output,node_epitope_output,node_report,node_summary toneRose
class node_user toneIndigo
```

## Components

### Workflow stages

- [Workflow configuration](https://github.com/ylab-hi/scanneo2/blob/main/config/config.yaml): `config/config.yaml`
- [Workflow orchestration](https://github.com/ylab-hi/scanneo2/blob/main/workflow/Snakefile): `workflow/Snakefile`
- [RNA processing](https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/preproc.smk): `workflow/rules/preproc.smk`
- [Read alignment](https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/align.smk): `workflow/rules/align.smk`
- [Expression quantification](https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/quantification.smk): `workflow/rules/quantification.smk`
- [Variant event sources](https://github.com/ylab-hi/scanneo2/tree/main/workflow/rules): `workflow/rules`

### HLA genotyping

- [HLA preparation](https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/hlatyping_prep.smk): `workflow/rules/hlatyping_prep.smk`
- [MHC-I typing](https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/hlatyping_mhcI.smk): `workflow/rules/hlatyping_mhcI.smk`
- [MHC-II typing](https://github.com/ylab-hi/scanneo2/blob/main/workflow/rules/hlatyping_mhcII.smk): `workflow/rules/hlatyping_mhcII.smk`

### Prioritization

- [Prioritization entry](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/compile.py): `workflow/scripts/prioritization/compile.py`
- [Variant effects](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/effects.py): `workflow/scripts/prioritization/effects.py`
- [Variant processing](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/variants.py): `workflow/scripts/prioritization/variants.py`
- [Fusion processing](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/fusions.py): `workflow/scripts/prioritization/fusions.py`
- [Protein input processing](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/proteins.py): `workflow/scripts/prioritization/proteins.py`
- [Reference data](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/reference.py): `workflow/scripts/prioritization/reference.py`
- [MHC binding prediction](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/prediction.py): `workflow/scripts/prioritization/prediction.py`
- [Immunogenicity and similarity](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/filtering.py): `workflow/scripts/prioritization/filtering.py`

### Results and reporting

- [Variant effects tables](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/effects.py): `workflow/scripts/prioritization/effects.py`
- [Neoepitope tables](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/prioritization/prediction.py): `workflow/scripts/prioritization/prediction.py`
- [Reporting](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/report.py): `workflow/scripts/report.py`
- [Summary](https://github.com/ylab-hi/scanneo2/blob/main/workflow/scripts/summarize.py): `workflow/scripts/summarize.py`

### Other components

- **Researcher**

## Connections

- Researcher → Workflow configuration: sets options (evidence: `README.md`)
- Researcher → Workflow orchestration: launches workflow (evidence: `README.md`)
- Workflow configuration → Workflow orchestration: configures
- Workflow orchestration → RNA processing: dispatches
- Workflow orchestration → Read alignment: dispatches
- Workflow orchestration → Expression quantification: dispatches
- Workflow orchestration → Variant event sources: dispatches
- Workflow orchestration → HLA preparation: dispatches
- Workflow orchestration → Prioritization entry: dispatches
- RNA processing → Read alignment: supplies reads
- Read alignment → Expression quantification: supplies alignments
- HLA preparation → MHC-I typing: prepares typing
- HLA preparation → MHC-II typing: prepares typing
- Variant event sources → Prioritization entry: provides event inputs
- MHC-I typing → Prioritization entry: provides alleles
- MHC-II typing → Prioritization entry: provides alleles
- Expression quantification → Prioritization entry: provides expression
- Prioritization entry → Variant processing: processes variants (evidence: `workflow/scripts/prioritization/compile.py`)
- Prioritization entry → Fusion processing: processes fusions (evidence: `workflow/scripts/prioritization/compile.py`)
- Prioritization entry → Protein input processing: processes custom proteins (evidence: `workflow/scripts/prioritization/compile.py`)
- Variant processing → Variant effects: registers effects (evidence: `workflow/scripts/prioritization/variants.py`)
- Fusion processing → Variant effects: registers effects (evidence: `workflow/scripts/prioritization/fusions.py`)
- Protein input processing → Variant effects: registers effects (evidence: `workflow/scripts/prioritization/proteins.py`)
- Variant processing → Reference data: loads annotation (evidence: `workflow/scripts/prioritization/variants.py`)
- Fusion processing → Reference data: loads reference (evidence: `workflow/scripts/prioritization/fusions.py`)
- Variant effects → Reference data: uses annotation and counts (evidence: `workflow/scripts/prioritization/effects.py`)
- Variant effects → Variant effects tables: writes (evidence: `workflow/scripts/prioritization/effects.py`)
- Prioritization entry → MHC binding prediction: starts prediction (evidence: `workflow/scripts/prioritization/compile.py`)
- MHC binding prediction → Neoepitope tables: writes (evidence: `workflow/scripts/prioritization/prediction.py`)
- Prioritization entry → Immunogenicity and similarity: scores epitopes (evidence: `workflow/scripts/prioritization/compile.py`)
- Workflow orchestration → Reporting: runs reporting
- Workflow orchestration → Summary: runs summary
