# roche-axelios/xoos architecture

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

- Interactive diagram: https://gitdiagram.com/roche-axelios/xoos
- Repository: https://github.com/roche-axelios/xoos

## Overview

XOOS is a bioinformatics secondary-analysis suite for SBX sequencing data. The documented user workflow runs demultiplexing and adapter trimming, read collapsing and alignment metrics, then variant and copy-number analysis; supported profiles also include repeat expansions and cfDNA reporting. The graph preserves those domain stages and the demultiplexing and alignment-metrics internals visible in excerpts. Most caller internals and the full pipeline wiring were not sampled, so broad workflow links rely on the README rather than implying inspected implementation details.

Main entry points: [`small_variant_caller/src`](https://github.com/roche-axelios/xoos/tree/main/small_variant_caller/src) (Small variant calling), [`demux/src/core/demux-and-trim-pipeline.cpp`](https://github.com/roche-axelios/xoos/blob/main/demux/src/core/demux-and-trim-pipeline.cpp) (Demux and trim), [`alignment_metrics/apps/alignment-metrics.cpp`](https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/apps/alignment-metrics.cpp) (Metrics CLI), [`alignment_metrics/src/metrics-worker.cpp`](https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/metrics-worker.cpp) (Alignment worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Pipeline orchestration"]
  node_launcher["Pipeline launcher<br/>[cli.py]"]
end

subgraph group_read_processing["Read processing"]
  node_demux_cli["Demux CLI<br/>[demux.cpp]"]
  node_demux_pipeline["Demux and trim"]
  node_flow_manager["Flow manager<br/>[flow-manager.cpp]"]
  node_strand_index["Strand index build"]
  node_read_collapser["Read collapsing<br/>[clustering.cpp]"]
end

subgraph group_metrics["Alignment metrics"]
  node_alignment_metrics_cli["Metrics CLI"]
  node_metrics_runner["Metrics runner"]
  node_metrics_worker["Alignment worker<br/>[metrics-worker.cpp]"]
  node_pileup["Alignment pileups<br/>[pileup.cpp]"]
  node_coverage_metrics["Coverage metrics"]
  node_accuracy_metrics["Accuracy metrics"]
end

subgraph group_variant_analysis["Variant analysis"]
  node_small_variants["Small variant calling"]
  node_read_phasing["Read-based phasing<br/>[phase-engine.cpp]"]
  node_pangenome["Pangenome consensus"]
  node_repeat_expansions["Repeat expansions"]
end

subgraph group_copy_number["Copy number analysis"]
  node_copy_number["Copy-number calling"]
  node_coverage_calc["Coverage calculation"]
  node_purity_ploidy["Purity-ploidy search"]
end

node_user(("Research user"))
node_analysis_results["Analysis results"]

node_user -->|"launches"| node_launcher
node_user -->|"runs tool"| node_demux_cli
node_launcher -.->|"orchestrates"| node_demux_pipeline
node_demux_cli -.->|"starts"| node_demux_pipeline
node_demux_pipeline -->|"initializes"| node_flow_manager
node_flow_manager -.->|"writes reads and metrics"| node_analysis_results
node_strand_index -.->|"supports indexing"| node_demux_pipeline
node_demux_pipeline -->|"produces reads for"| node_read_collapser
node_read_collapser -->|"feeds analysis"| node_alignment_metrics_cli
node_alignment_metrics_cli -.->|"starts"| node_metrics_runner
node_metrics_runner -.->|"dispatches regions"| node_metrics_worker
node_metrics_worker -->|"updates"| node_pileup
node_metrics_worker -->|"aggregates coverage"| node_coverage_metrics
node_metrics_worker -.->|"computes accuracy"| node_accuracy_metrics
node_alignment_metrics_cli -->|"precedes calling"| node_small_variants
node_small_variants -.->|"phases reads"| node_read_phasing
node_small_variants -.->|"supports consensus"| node_pangenome
node_small_variants -->|"supports profile"| node_repeat_expansions
node_alignment_metrics_cli -->|"precedes calling"| node_copy_number
node_copy_number -.->|"calculates coverage"| node_coverage_calc
node_copy_number -.->|"searches purity and ploidy"| node_purity_ploidy
node_small_variants -->|"reports variants"| node_analysis_results
node_copy_number -->|"reports copy number"| node_analysis_results
node_pangenome -.->|"reports consensus"| node_analysis_results
node_repeat_expansions -->|"reports expansions"| node_analysis_results

click node_launcher "https://github.com/roche-axelios/xoos/blob/main/pipeline_launcher/src/pipeline_launcher/cli.py"
click node_demux_cli "https://github.com/roche-axelios/xoos/blob/main/demux/apps/demux.cpp"
click node_demux_pipeline "https://github.com/roche-axelios/xoos/blob/main/demux/src/core/demux-and-trim-pipeline.cpp"
click node_flow_manager "https://github.com/roche-axelios/xoos/blob/main/demux/src/task/flow-manager.cpp"
click node_strand_index "https://github.com/roche-axelios/xoos/blob/main/demux/src/demux-strand-index/demux-strand-build-pipeline.cpp"
click node_read_collapser "https://github.com/roche-axelios/xoos/blob/main/read_collapser/src/clustering/clustering.cpp"
click node_alignment_metrics_cli "https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/apps/alignment-metrics.cpp"
click node_metrics_runner "https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/run-alignment-metrics.cpp"
click node_metrics_worker "https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/metrics-worker.cpp"
click node_pileup "https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/core/pileup.cpp"
click node_coverage_metrics "https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/metrics/coverage-metrics/coverage-histograms.cpp"
click node_accuracy_metrics "https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/metrics/accuracy-metrics/accuracy-metrics.cpp"
click node_small_variants "https://github.com/roche-axelios/xoos/tree/main/small_variant_caller/src"
click node_read_phasing "https://github.com/roche-axelios/xoos/blob/main/small_variant_caller/src/phaser/phase-engine.cpp"
click node_pangenome "https://github.com/roche-axelios/xoos/blob/main/pangenome_consensus_caller/src/pangenome-consensus-caller-core.cpp"
click node_repeat_expansions "https://github.com/roche-axelios/xoos/tree/main/small_variant_caller/src"
click node_copy_number "https://github.com/roche-axelios/xoos/tree/main/copy_number_caller/src"
click node_coverage_calc "https://github.com/roche-axelios/xoos/blob/main/copy_number_caller/src/coverage/calculate-coverage.cpp"
click node_purity_ploidy "https://github.com/roche-axelios/xoos/blob/main/copy_number_caller/src/purity-ploidy-search/purity-ploidy-search.cpp"

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_launcher,node_user toneBlue
class node_demux_cli,node_demux_pipeline,node_flow_manager,node_strand_index,node_read_collapser toneAmber
class node_alignment_metrics_cli,node_metrics_runner,node_metrics_worker,node_pileup,node_coverage_metrics,node_accuracy_metrics toneMint
class node_small_variants,node_read_phasing,node_pangenome,node_repeat_expansions toneRose
class node_copy_number,node_coverage_calc,node_purity_ploidy,node_analysis_results toneIndigo
```

## Components

### Pipeline orchestration

- [Pipeline launcher](https://github.com/roche-axelios/xoos/blob/main/pipeline_launcher/src/pipeline_launcher/cli.py): `pipeline_launcher/src/pipeline_launcher/cli.py`

### Read processing

- [Demux CLI](https://github.com/roche-axelios/xoos/blob/main/demux/apps/demux.cpp): `demux/apps/demux.cpp`
- [Demux and trim](https://github.com/roche-axelios/xoos/blob/main/demux/src/core/demux-and-trim-pipeline.cpp): `demux/src/core/demux-and-trim-pipeline.cpp`
- [Flow manager](https://github.com/roche-axelios/xoos/blob/main/demux/src/task/flow-manager.cpp): `demux/src/task/flow-manager.cpp`
- [Strand index build](https://github.com/roche-axelios/xoos/blob/main/demux/src/demux-strand-index/demux-strand-build-pipeline.cpp): `demux/src/demux-strand-index/demux-strand-build-pipeline.cpp`
- [Read collapsing](https://github.com/roche-axelios/xoos/blob/main/read_collapser/src/clustering/clustering.cpp): `read_collapser/src/clustering/clustering.cpp`

### Alignment metrics

- [Metrics CLI](https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/apps/alignment-metrics.cpp): `alignment_metrics/apps/alignment-metrics.cpp`
- [Metrics runner](https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/run-alignment-metrics.cpp): `alignment_metrics/src/run-alignment-metrics.cpp`
- [Alignment worker](https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/metrics-worker.cpp): `alignment_metrics/src/metrics-worker.cpp`
- [Alignment pileups](https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/core/pileup.cpp): `alignment_metrics/src/core/pileup.cpp`
- [Coverage metrics](https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/metrics/coverage-metrics/coverage-histograms.cpp): `alignment_metrics/src/metrics/coverage-metrics/coverage-histograms.cpp`
- [Accuracy metrics](https://github.com/roche-axelios/xoos/blob/main/alignment_metrics/src/metrics/accuracy-metrics/accuracy-metrics.cpp): `alignment_metrics/src/metrics/accuracy-metrics/accuracy-metrics.cpp`

### Variant analysis

- [Small variant calling](https://github.com/roche-axelios/xoos/tree/main/small_variant_caller/src): `small_variant_caller/src`
- [Read-based phasing](https://github.com/roche-axelios/xoos/blob/main/small_variant_caller/src/phaser/phase-engine.cpp): `small_variant_caller/src/phaser/phase-engine.cpp`
- [Pangenome consensus](https://github.com/roche-axelios/xoos/blob/main/pangenome_consensus_caller/src/pangenome-consensus-caller-core.cpp): `pangenome_consensus_caller/src/pangenome-consensus-caller-core.cpp`
- [Repeat expansions](https://github.com/roche-axelios/xoos/tree/main/small_variant_caller/src): `small_variant_caller/src`

### Copy number analysis

- [Copy-number calling](https://github.com/roche-axelios/xoos/tree/main/copy_number_caller/src): `copy_number_caller/src`
- [Coverage calculation](https://github.com/roche-axelios/xoos/blob/main/copy_number_caller/src/coverage/calculate-coverage.cpp): `copy_number_caller/src/coverage/calculate-coverage.cpp`
- [Purity-ploidy search](https://github.com/roche-axelios/xoos/blob/main/copy_number_caller/src/purity-ploidy-search/purity-ploidy-search.cpp): `copy_number_caller/src/purity-ploidy-search/purity-ploidy-search.cpp`

### Other components

- **Research user**
- **Analysis results**

## Connections

- Research user → Pipeline launcher: launches
- Research user → Demux CLI: runs tool
- Pipeline launcher → Demux and trim: orchestrates
- Demux CLI → Demux and trim: starts
- Demux and trim → Flow manager: initializes (evidence: `demux/src/core/demux-and-trim-pipeline.cpp`)
- Flow manager → Analysis results: writes reads and metrics
- Strand index build → Demux and trim: supports indexing
- Demux and trim → Read collapsing: produces reads for
- Read collapsing → Metrics CLI: feeds analysis
- Metrics CLI → Metrics runner: starts
- Metrics runner → Alignment worker: dispatches regions
- Alignment worker → Alignment pileups: updates (evidence: `alignment_metrics/src/metrics-worker.cpp`)
- Alignment worker → Coverage metrics: aggregates coverage
- Alignment worker → Accuracy metrics: computes accuracy
- Metrics CLI → Small variant calling: precedes calling
- Small variant calling → Read-based phasing: phases reads (evidence: `small_variant_caller/src/phaser/phase-engine.cpp`)
- Small variant calling → Pangenome consensus: supports consensus
- Small variant calling → Repeat expansions: supports profile
- Metrics CLI → Copy-number calling: precedes calling
- Copy-number calling → Coverage calculation: calculates coverage (evidence: `copy_number_caller/src/coverage/calculate-coverage.cpp`)
- Copy-number calling → Purity-ploidy search: searches purity and ploidy (evidence: `copy_number_caller/src/purity-ploidy-search/purity-ploidy-search.cpp`)
- Small variant calling → Analysis results: reports variants
- Copy-number calling → Analysis results: reports copy number
- Pangenome consensus → Analysis results: reports consensus
- Repeat expansions → Analysis results: reports expansions
