# zhaoqing-wang/celljanus architecture

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

- Interactive diagram: https://gitdiagram.com/zhaoqing-wang/celljanus
- Repository: https://github.com/zhaoqing-wang/celljanus

## Overview

CellJanus deconvolves host and microbial signals from FASTQ, with bulk and single-cell workflows. The bulk route runs quality control, host alignment, unmapped-read extraction, microbial classification and abundance estimation, then produces summaries and visualizations. The scRNA-seq route tracks barcodes and UMIs to create cells-by-species results. Reference downloads support setup; the README also describes optional 16S cross-validation. The graph follows documented orchestration and sampled module behavior; some pipeline wiring and the 16S implementation were not sampled, so uncertain links are omitted.

Main entry points: [`celljanus/pipeline.py`](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/pipeline.py) (Pipeline), [`celljanus/classify.py`](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/classify.py) (Taxonomic analysis), [`celljanus/cli.py`](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/cli.py) (CLI), [`celljanus/align.py`](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/align.py) (Host alignment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_cli["CLI<br/>[cli.py]"]
  node_pipeline["Pipeline<br/>[pipeline.py]"]
end

subgraph group_bulk["Bulk workflow"]
  node_qc["Read QC<br/>[qc.py]"]
  node_align["Host alignment<br/>[align.py]"]
  node_extract["Unmapped reads<br/>[extract.py]"]
  node_classify["Taxonomic analysis<br/>[classify.py]"]
  node_fastp["fastp"]
  node_bowtie["Bowtie2"]
  node_samtools["samtools"]
  node_kraken["Kraken2"]
  node_bracken["Bracken"]
  node_visualize["Visualizations<br/>[visualize.py]"]
end

subgraph group_singlecell["Single-cell workflow"]
  node_scrna["Barcode analysis<br/>[scrnaseq.py]"]
  node_sixteen["16S validation"]
end

subgraph group_refs["References and results"]
  node_download["Reference download<br/>[download.py]"]
  node_hostref[("Host genome index")]
  node_microberef[("Kraken2 database")]
  node_results["Analysis outputs"]
end

node_user(("Researcher"))

node_user -->|"runs"| node_cli
node_cli -->|"starts bulk"| node_pipeline
node_pipeline -->|"runs QC"| node_qc
node_pipeline -->|"runs alignment"| node_align
node_pipeline -->|"runs extraction"| node_extract
node_pipeline -->|"runs classification"| node_classify
node_pipeline -->|"runs visualization"| node_visualize
node_qc -->|"invokes"| node_fastp
node_align -->|"aligns with"| node_bowtie
node_align -->|"sorts and indexes"| node_samtools
node_extract -->|"extracts with"| node_samtools
node_classify -->|"classifies with"| node_kraken
node_classify -->|"estimates abundance"| node_bracken
node_align -->|"reads index"| node_hostref
node_classify -->|"reads database"| node_microberef
node_cli -->|"starts scRNA-seq"| node_scrna
node_scrna -->|"runs Kraken2"| node_classify
node_scrna -->|"writes cell matrices"| node_results
node_visualize -->|"writes plots"| node_results
node_pipeline -->|"writes reports"| node_results
node_cli -->|"requests references"| node_download
node_download -->|"prepares index"| node_hostref
node_download -->|"downloads database"| node_microberef
node_scrna -.->|"optional validation"| node_sixteen

click node_cli "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/cli.py"
click node_pipeline "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/pipeline.py"
click node_qc "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/qc.py"
click node_align "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/align.py"
click node_extract "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/extract.py"
click node_classify "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/classify.py"
click node_scrna "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/scrnaseq.py"
click node_visualize "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/visualize.py"
click node_sixteen "https://github.com/zhaoqing-wang/celljanus/tree/main/celljanus"
click node_download "https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/download.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_cli,node_pipeline toneBlue
class node_qc,node_align,node_extract,node_classify,node_fastp,node_bowtie,node_samtools,node_kraken,node_bracken,node_visualize toneAmber
class node_scrna,node_sixteen toneMint
class node_download,node_hostref,node_microberef,node_results toneRose
class node_user toneIndigo
```

## Components

### Entry points

- [CLI](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/cli.py): `celljanus/cli.py`
- [Pipeline](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/pipeline.py): `celljanus/pipeline.py`

### Bulk workflow

- [Read QC](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/qc.py): `celljanus/qc.py`
- [Host alignment](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/align.py): `celljanus/align.py`
- [Unmapped reads](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/extract.py): `celljanus/extract.py`
- [Taxonomic analysis](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/classify.py): `celljanus/classify.py`
- **fastp**
- **Bowtie2**
- **samtools**
- **Kraken2**
- **Bracken**
- [Visualizations](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/visualize.py): `celljanus/visualize.py`

### Single-cell workflow

- [Barcode analysis](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/scrnaseq.py): `celljanus/scrnaseq.py`
- [16S validation](https://github.com/zhaoqing-wang/celljanus/tree/main/celljanus): `celljanus`

### References and results

- [Reference download](https://github.com/zhaoqing-wang/celljanus/blob/main/celljanus/download.py): `celljanus/download.py`
- **Host genome index**
- **Kraken2 database**
- **Analysis outputs**

### Other components

- **Researcher**

## Connections

- Researcher → CLI: runs
- CLI → Pipeline: starts bulk
- Pipeline → Read QC: runs QC
- Pipeline → Host alignment: runs alignment
- Pipeline → Unmapped reads: runs extraction
- Pipeline → Taxonomic analysis: runs classification
- Pipeline → Visualizations: runs visualization
- Read QC → fastp: invokes
- Host alignment → Bowtie2: aligns with
- Host alignment → samtools: sorts and indexes
- Unmapped reads → samtools: extracts with
- Taxonomic analysis → Kraken2: classifies with
- Taxonomic analysis → Bracken: estimates abundance
- Host alignment → Host genome index: reads index
- Taxonomic analysis → Kraken2 database: reads database
- CLI → Barcode analysis: starts scRNA-seq
- Barcode analysis → Taxonomic analysis: runs Kraken2
- Barcode analysis → Analysis outputs: writes cell matrices
- Visualizations → Analysis outputs: writes plots
- Pipeline → Analysis outputs: writes reports
- CLI → Reference download: requests references
- Reference download → Host genome index: prepares index
- Reference download → Kraken2 database: downloads database
- Barcode analysis → 16S validation: optional validation
