# encode-dcc/rna-seq-pipeline architecture

> Architecture diagram of the GitHub repository encode-dcc/rna-seq-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/encode-dcc/rna-seq-pipeline
- Repository: https://github.com/encode-dcc/rna-seq-pipeline

## Overview

This repository implements the ENCODE RNA-seq pipeline: FASTQ reads are aligned, then used to produce signal tracks and gene/isoform quantifications, with QC outputs. The WDL workflow and index-building files are present but not excerpted, so their orchestration links are shown as unverified rather than asserted. Source excerpts support the alignment, signal-generation, quantification, and QC behaviors shown.

Main entry points: [`rna-seq-pipeline.wdl`](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/rna-seq-pipeline.wdl) (RNA-seq workflow), [`src/align.py`](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/align.py) (STAR alignment), [`src/rsem_quant.py`](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/rsem_quant.py) (RSEM quantification), [`src/rna_qc.py`](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/rna_qc.py) (RNA QC metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow and references"]
  node_workflow_wdl["RNA-seq workflow"]
  node_index_wdl["Index workflow"]
  node_annotation_wdl["Annotation merge task<br/>[merge_anno.wdl]"]
  node_merge_annotation["Merge annotations"]
end

subgraph group_processing["Read processing"]
  node_align["STAR alignment<br/>[align.py]"]
  node_signals["Signal tracks<br/>[bam_to_signals.py]"]
end

subgraph group_quantification["Quantification"]
  node_rsem["RSEM quantification<br/>[rsem_quant.py]"]
  node_kallisto["Kallisto quantification<br/>[kallisto_quant.py]"]
end

subgraph group_quality["Quality control"]
  node_rna_qc["RNA QC metrics<br/>[rna_qc.py]"]
  node_mad_qc["Replicate QC<br/>[mad_qc.py]"]
  node_md5["Output checksum check<br/>[compare_md5.py]"]
end

node_user(("Pipeline user"))

node_user -.->|"runs workflow"| node_workflow_wdl
node_workflow_wdl -.->|"dispatches alignment"| node_align
node_workflow_wdl -.->|"dispatches tracks"| node_signals
node_workflow_wdl -.->|"dispatches quantification"| node_rsem
node_workflow_wdl -.->|"dispatches quantification"| node_kallisto
node_workflow_wdl -.->|"dispatches QC"| node_rna_qc
node_index_wdl -.->|"invokes merge task"| node_annotation_wdl
node_annotation_wdl -.->|"runs annotation merge"| node_merge_annotation
node_align -.->|"produces BAM input"| node_signals
node_align -.->|"produces annotation BAM"| node_rsem
node_align -.->|"produces transcriptome BAM"| node_rna_qc
node_kallisto -->|"reuses FASTQ merger"| node_align
node_rsem -->|"reuses archive helper"| node_align
node_mad_qc -->|"imports QC records"| node_rna_qc

click node_workflow_wdl "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/rna-seq-pipeline.wdl"
click node_index_wdl "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/make_index_wdl/build_genome_index.wdl"
click node_annotation_wdl "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/make_index_wdl/merge_anno.wdl"
click node_merge_annotation "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/merge_annotation.py"
click node_align "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/align.py"
click node_signals "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/bam_to_signals.py"
click node_rsem "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/rsem_quant.py"
click node_kallisto "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/kallisto_quant.py"
click node_rna_qc "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/rna_qc.py"
click node_mad_qc "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/mad_qc.py"
click node_md5 "https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/compare_md5.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_workflow_wdl,node_index_wdl,node_annotation_wdl,node_merge_annotation,node_user toneBlue
class node_align,node_signals toneAmber
class node_rsem,node_kallisto toneMint
class node_rna_qc,node_mad_qc,node_md5 toneRose
```

## Components

### Workflow and references

- [RNA-seq workflow](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/rna-seq-pipeline.wdl): `rna-seq-pipeline.wdl`
- [Index workflow](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/make_index_wdl/build_genome_index.wdl): `make_index_wdl/build_genome_index.wdl`
- [Annotation merge task](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/make_index_wdl/merge_anno.wdl): `make_index_wdl/merge_anno.wdl`
- [Merge annotations](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/merge_annotation.py): `src/merge_annotation.py`

### Read processing

- [STAR alignment](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/align.py): `src/align.py`
- [Signal tracks](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/bam_to_signals.py): `src/bam_to_signals.py`

### Quantification

- [RSEM quantification](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/rsem_quant.py): `src/rsem_quant.py`
- [Kallisto quantification](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/kallisto_quant.py): `src/kallisto_quant.py`

### Quality control

- [RNA QC metrics](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/rna_qc.py): `src/rna_qc.py`
- [Replicate QC](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/mad_qc.py): `src/mad_qc.py`
- [Output checksum check](https://github.com/encode-dcc/rna-seq-pipeline/blob/dev/src/compare_md5.py): `src/compare_md5.py`

### Other components

- **Pipeline user**

## Connections

- Pipeline user → RNA-seq workflow: runs workflow
- RNA-seq workflow → STAR alignment: dispatches alignment
- RNA-seq workflow → Signal tracks: dispatches tracks
- RNA-seq workflow → RSEM quantification: dispatches quantification
- RNA-seq workflow → Kallisto quantification: dispatches quantification
- RNA-seq workflow → RNA QC metrics: dispatches QC
- Index workflow → Annotation merge task: invokes merge task
- Annotation merge task → Merge annotations: runs annotation merge
- STAR alignment → Signal tracks: produces BAM input
- STAR alignment → RSEM quantification: produces annotation BAM (evidence: `src/rsem_quant.py`)
- STAR alignment → RNA QC metrics: produces transcriptome BAM
- Kallisto quantification → STAR alignment: reuses FASTQ merger (evidence: `src/kallisto_quant.py`)
- RSEM quantification → STAR alignment: reuses archive helper (evidence: `src/rsem_quant.py`)
- Replicate QC → RNA QC metrics: imports QC records (evidence: `src/mad_qc.py`)
