# gaolabtools/scnanogps architecture

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

- Interactive diagram: https://gitdiagram.com/gaolabtools/scnanogps
- Repository: https://github.com/gaolabtools/scnanogps

## Overview

scNanoGPS analyzes single-cell Nanopore reads through quality control, read scanning, barcode assignment, UMI-based consensus curation, and reporting of expression, isoforms, and mutations. The README documents these stages and the wrapper as the convenient entry point; the tree supports separate scripts for the major components. Some stage-to-stage connections below reflect that documented workflow rather than inspected orchestration code, and unsampled implementations are represented only by their existing paths.

Main entry points: [`run_scNanoGPS.py`](https://github.com/gaolabtools/scnanogps/blob/v2.0/run_scNanoGPS.py) (Pipeline wrapper), [`curator.py`](https://github.com/gaolabtools/scnanogps/blob/v2.0/curator.py) (Read curator), [`scanner.py`](https://github.com/gaolabtools/scnanogps/blob/v2.0/scanner.py) (Read scanner), [`assigner.py`](https://github.com/gaolabtools/scnanogps/blob/v2.0/assigner.py) (Barcode assigner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Pipeline stages"]
  node_wrapper["Pipeline wrapper<br/>[run_scNanoGPS.py]"]
  node_qc["Read QC<br/>[prepare_read_qc.py]"]
  node_scanner["Read scanner<br/>[scanner.py]"]
  node_scanner_core["Pattern search<br/>[searching_core.py]"]
  node_assigner["Barcode assigner<br/>[assigner.py]"]
  node_assign_core["Barcode merging<br/>[wrapping.py]"]
end

subgraph group_curation["Read processing"]
  node_curator["Read curator<br/>[curator.py]"]
  node_curator_io["Alignment and UMI<br/>[curator_io.py]"]
end

subgraph group_reports["Cell reports"]
  node_expression["Expression reporter"]
  node_isoform["Isoform reporter"]
  node_snv["SNV reporter<br/>[reporter_SNV.py]"]
  node_summary["Summary reporter"]
end

subgraph group_helpers["Analysis utilities"]
  node_fusion["Fusion finder"]
end

node_user(("Researcher"))
node_reads["Nanopore reads"]
node_reference["Genome reference"]
node_mapping["Minimap2"]
node_consensus["SPOA"]
node_result["Cell profiles"]

node_user -->|"runs"| node_wrapper
node_user -->|"provides"| node_reads
node_wrapper -->|"runs QC"| node_qc
node_wrapper -->|"runs scan"| node_scanner
node_wrapper -->|"runs assignment"| node_assigner
node_wrapper -->|"runs curation"| node_curator
node_wrapper -->|"runs reporting"| node_expression
node_wrapper -->|"runs reporting"| node_isoform
node_wrapper -->|"runs reporting"| node_snv
node_wrapper -->|"runs reporting"| node_summary
node_reads -->|"reads"| node_qc
node_reads -->|"scans"| node_scanner
node_scanner -->|"searches patterns"| node_scanner_core
node_scanner -->|"barcode counts"| node_assigner
node_assigner -->|"merges barcodes"| node_assign_core
node_assigner -->|"barcode list"| node_curator
node_curator -->|"processes alignments"| node_curator_io
node_curator -->|"maps reads"| node_mapping
node_mapping -->|"uses"| node_reference
node_curator -->|"collapses reads"| node_consensus
node_curator -->|"curated reads"| node_expression
node_curator -->|"curated reads"| node_isoform
node_curator -->|"curated reads"| node_snv
node_expression -->|"expression matrix"| node_result
node_isoform -->|"isoform calls"| node_result
node_snv -->|"mutation profiles"| node_result
node_summary -->|"summary"| node_result
node_fusion -.->|"fusion analysis"| node_result

click node_wrapper "https://github.com/gaolabtools/scnanogps/blob/v2.0/run_scNanoGPS.py"
click node_qc "https://github.com/gaolabtools/scnanogps/blob/v2.0/other_utils/prepare_read_qc.py"
click node_scanner "https://github.com/gaolabtools/scnanogps/blob/v2.0/scanner.py"
click node_scanner_core "https://github.com/gaolabtools/scnanogps/blob/v2.0/scanner_core/searching_core.py"
click node_assigner "https://github.com/gaolabtools/scnanogps/blob/v2.0/assigner.py"
click node_assign_core "https://github.com/gaolabtools/scnanogps/blob/v2.0/assigner_core/wrapping.py"
click node_curator "https://github.com/gaolabtools/scnanogps/blob/v2.0/curator.py"
click node_curator_io "https://github.com/gaolabtools/scnanogps/blob/v2.0/curator_core/curator_io.py"
click node_expression "https://github.com/gaolabtools/scnanogps/blob/v2.0/reporter_expression.py"
click node_isoform "https://github.com/gaolabtools/scnanogps/blob/v2.0/reporter_isoform.py"
click node_snv "https://github.com/gaolabtools/scnanogps/blob/v2.0/reporter_SNV.py"
click node_summary "https://github.com/gaolabtools/scnanogps/blob/v2.0/reporter_summary.py"
click node_fusion "https://github.com/gaolabtools/scnanogps/blob/v2.0/other_utils/find_fusion_isoform.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_wrapper,node_qc,node_scanner,node_scanner_core,node_assigner,node_assign_core toneBlue
class node_curator,node_curator_io toneAmber
class node_expression,node_isoform,node_snv,node_summary toneMint
class node_fusion toneRose
class node_user,node_reads,node_reference,node_mapping,node_consensus,node_result toneIndigo
```

## Components

### Pipeline stages

- [Pipeline wrapper](https://github.com/gaolabtools/scnanogps/blob/v2.0/run_scNanoGPS.py): `run_scNanoGPS.py`
- [Read QC](https://github.com/gaolabtools/scnanogps/blob/v2.0/other_utils/prepare_read_qc.py): `other_utils/prepare_read_qc.py`
- [Read scanner](https://github.com/gaolabtools/scnanogps/blob/v2.0/scanner.py): `scanner.py`
- [Pattern search](https://github.com/gaolabtools/scnanogps/blob/v2.0/scanner_core/searching_core.py): `scanner_core/searching_core.py`
- [Barcode assigner](https://github.com/gaolabtools/scnanogps/blob/v2.0/assigner.py): `assigner.py`
- [Barcode merging](https://github.com/gaolabtools/scnanogps/blob/v2.0/assigner_core/wrapping.py): `assigner_core/wrapping.py`

### Read processing

- [Read curator](https://github.com/gaolabtools/scnanogps/blob/v2.0/curator.py): `curator.py`
- [Alignment and UMI](https://github.com/gaolabtools/scnanogps/blob/v2.0/curator_core/curator_io.py): `curator_core/curator_io.py`

### Cell reports

- [Expression reporter](https://github.com/gaolabtools/scnanogps/blob/v2.0/reporter_expression.py): `reporter_expression.py`
- [Isoform reporter](https://github.com/gaolabtools/scnanogps/blob/v2.0/reporter_isoform.py): `reporter_isoform.py`
- [SNV reporter](https://github.com/gaolabtools/scnanogps/blob/v2.0/reporter_SNV.py): `reporter_SNV.py`
- [Summary reporter](https://github.com/gaolabtools/scnanogps/blob/v2.0/reporter_summary.py): `reporter_summary.py`

### Analysis utilities

- [Fusion finder](https://github.com/gaolabtools/scnanogps/blob/v2.0/other_utils/find_fusion_isoform.py): `other_utils/find_fusion_isoform.py`

### Other components

- **Researcher**
- **Nanopore reads**
- **Genome reference**
- **Minimap2**
- **SPOA**
- **Cell profiles**

## Connections

- Researcher → Pipeline wrapper: runs
- Researcher → Nanopore reads: provides
- Pipeline wrapper → Read QC: runs QC
- Pipeline wrapper → Read scanner: runs scan
- Pipeline wrapper → Barcode assigner: runs assignment
- Pipeline wrapper → Read curator: runs curation
- Pipeline wrapper → Expression reporter: runs reporting
- Pipeline wrapper → Isoform reporter: runs reporting
- Pipeline wrapper → SNV reporter: runs reporting
- Pipeline wrapper → Summary reporter: runs reporting
- Nanopore reads → Read QC: reads
- Nanopore reads → Read scanner: scans
- Read scanner → Pattern search: searches patterns
- Read scanner → Barcode assigner: barcode counts
- Barcode assigner → Barcode merging: merges barcodes
- Barcode assigner → Read curator: barcode list
- Read curator → Alignment and UMI: processes alignments
- Read curator → Minimap2: maps reads
- Minimap2 → Genome reference: uses
- Read curator → SPOA: collapses reads
- Read curator → Expression reporter: curated reads
- Read curator → Isoform reporter: curated reads
- Read curator → SNV reporter: curated reads
- Expression reporter → Cell profiles: expression matrix
- Isoform reporter → Cell profiles: isoform calls
- SNV reporter → Cell profiles: mutation profiles
- Summary reporter → Cell profiles: summary
- Fusion finder → Cell profiles: fusion analysis
