# kircherlab/cadd-scripts architecture

> Architecture diagram of the GitHub repository kircherlab/cadd-scripts, 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/kircherlab/cadd-scripts
- Repository: https://github.com/kircherlab/cadd-scripts

## Overview

CADD is an offline genome-variant scoring tool for SNVs and short InDels on GRCh37 and GRCh38. The principal workflow accepts a VCF, prepares variants and annotations, derives model features, predicts deleteriousness, and emits tabular C-scores; users can request annotated output or use pre-scored files. The README documents the command-line and workflow entry points, while sampled scripts support variant normalization, annotation, feature transformation, and score post-processing. The Snakefile’s rules were not sampled, so its internal dispatch links are shown only at the documented workflow level.

Main entry points: [`Snakefile`](https://github.com/kircherlab/cadd-scripts/blob/master/Snakefile) (Workflow engine), [`CADD.sh`](https://github.com/kircherlab/cadd-scripts/blob/master/CADD.sh) (CLI wrapper), [`src/scripts/extract_scored.py`](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/extract_scored.py) (Pre-score extraction), [`src/scripts/VCF2vepVCF.py`](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/VCF2vepVCF.py) (Variant normalization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Workflow entry"]
  node_cadd["CLI wrapper<br/>[CADD.sh]"]
  node_workflow["Workflow engine"]
end

subgraph group_variant["Variant preparation"]
  node_normalize["Variant normalization<br/>[VCF2vepVCF.py]"]
  node_vep["VEP consequence annotation<br/>[vep.yml]"]
  node_vep_enrich["VEP VCF enrichment<br/>[annotateVEPvcf.py]"]
end

subgraph group_features["Features and models"]
  node_annotation_lib["Genomic annotations<br/>[Annotations.py]"]
  node_annotation_data[("Genome annotation tracks")]
  node_tracks["Track definitions<br/>[tracks.py]"]
  node_transform["Feature transformation"]
  node_regulatory["Regulatory sequence model<br/>[predictVariants.py]"]
  node_splice["Splice prediction<br/>[MMSplice.py]"]
  node_esm["Protein language scores<br/>[esm_lib.py]"]
end

subgraph group_scoring["Scoring and output"]
  node_models[("CADD prediction models")]
  node_predict["CADD score prediction<br/>[predictSKmodel.py]"]
  node_select["Variant score selection"]
  node_phred["PHRED conversion"]
  node_prescored[("Pre-scored variants")]
  node_extract["Pre-score extraction<br/>[extract_scored.py]"]
end

node_user(("CADD user"))
node_input["VCF input"]
node_output["CADD result table"]

node_user -->|"invokes"| node_cadd
node_input -->|"provides VCF"| node_cadd
node_cadd -->|"starts workflow"| node_workflow
node_workflow -->|"runs preparation"| node_normalize
node_normalize -->|"prepares variants"| node_vep
node_vep -->|"annotates consequences"| node_vep_enrich
node_vep_enrich -->|"loads annotations"| node_annotation_lib
node_annotation_lib -->|"queries tracks"| node_annotation_data
node_workflow -->|"runs feature processing"| node_transform
node_tracks -->|"defines features"| node_transform
node_workflow -.->|"runs optional prediction"| node_regulatory
node_workflow -.->|"runs optional prediction"| node_splice
node_workflow -.->|"runs optional scoring"| node_esm
node_workflow -->|"runs scoring"| node_predict
node_models -->|"provides models"| node_predict
node_workflow -->|"selects variant scores"| node_select
node_workflow -->|"converts scores"| node_phred
node_workflow -->|"uses pre-scored data"| node_extract
node_prescored -->|"provides scores"| node_extract
node_phred -->|"writes scores"| node_output
node_extract -->|"writes scores"| node_output

click node_cadd "https://github.com/kircherlab/cadd-scripts/blob/master/CADD.sh"
click node_workflow "https://github.com/kircherlab/cadd-scripts/blob/master/Snakefile"
click node_normalize "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/VCF2vepVCF.py"
click node_vep "https://github.com/kircherlab/cadd-scripts/blob/master/envs/vep.yml"
click node_vep_enrich "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/annotateVEPvcf.py"
click node_annotation_lib "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/Annotations.py"
click node_annotation_data "https://github.com/kircherlab/cadd-scripts/tree/master/data/annotations"
click node_tracks "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/tracks.py"
click node_transform "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/trackTransformation.py"
click node_regulatory "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/tools/regulatorySequence/predictVariants.py"
click node_splice "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/tools/MMSplice.py"
click node_esm "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/tools/esmScore/esm_lib.py"
click node_models "https://github.com/kircherlab/cadd-scripts/tree/master/data/models"
click node_predict "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/predictSKmodel.py"
click node_select "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/max_line_hierarchy.py"
click node_phred "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/appendPHREDscore.py"
click node_prescored "https://github.com/kircherlab/cadd-scripts/tree/master/data/prescored"
click node_extract "https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/extract_scored.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_cadd,node_workflow,node_user toneBlue
class node_normalize,node_vep,node_vep_enrich toneAmber
class node_annotation_lib,node_annotation_data,node_tracks,node_transform,node_regulatory,node_splice,node_esm toneMint
class node_models,node_predict,node_select,node_phred,node_prescored,node_extract toneRose
class node_input,node_output toneIndigo
```

## Components

### Workflow entry

- [CLI wrapper](https://github.com/kircherlab/cadd-scripts/blob/master/CADD.sh): `CADD.sh`
- [Workflow engine](https://github.com/kircherlab/cadd-scripts/blob/master/Snakefile): `Snakefile`

### Variant preparation

- [Variant normalization](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/VCF2vepVCF.py): `src/scripts/VCF2vepVCF.py`
- [VEP consequence annotation](https://github.com/kircherlab/cadd-scripts/blob/master/envs/vep.yml): `envs/vep.yml`
- [VEP VCF enrichment](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/annotateVEPvcf.py): `src/scripts/annotateVEPvcf.py`

### Features and models

- [Genomic annotations](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/Annotations.py): `src/scripts/lib/Annotations.py`
- [Genome annotation tracks](https://github.com/kircherlab/cadd-scripts/tree/master/data/annotations): `data/annotations`
- [Track definitions](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/tracks.py): `src/scripts/lib/tracks.py`
- [Feature transformation](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/trackTransformation.py): `src/scripts/trackTransformation.py`
- [Regulatory sequence model](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/tools/regulatorySequence/predictVariants.py): `src/scripts/lib/tools/regulatorySequence/predictVariants.py`
- [Splice prediction](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/tools/MMSplice.py): `src/scripts/lib/tools/MMSplice.py`
- [Protein language scores](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/lib/tools/esmScore/esm_lib.py): `src/scripts/lib/tools/esmScore/esm_lib.py`

### Scoring and output

- [CADD prediction models](https://github.com/kircherlab/cadd-scripts/tree/master/data/models): `data/models`
- [CADD score prediction](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/predictSKmodel.py): `src/scripts/predictSKmodel.py`
- [Variant score selection](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/max_line_hierarchy.py): `src/scripts/max_line_hierarchy.py`
- [PHRED conversion](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/appendPHREDscore.py): `src/scripts/appendPHREDscore.py`
- [Pre-scored variants](https://github.com/kircherlab/cadd-scripts/tree/master/data/prescored): `data/prescored`
- [Pre-score extraction](https://github.com/kircherlab/cadd-scripts/blob/master/src/scripts/extract_scored.py): `src/scripts/extract_scored.py`

### Other components

- **CADD user**
- **VCF input**
- **CADD result table**

## Connections

- CADD user → CLI wrapper: invokes
- VCF input → CLI wrapper: provides VCF
- CLI wrapper → Workflow engine: starts workflow
- Workflow engine → Variant normalization: runs preparation
- Variant normalization → VEP consequence annotation: prepares variants
- VEP consequence annotation → VEP VCF enrichment: annotates consequences
- VEP VCF enrichment → Genomic annotations: loads annotations
- Genomic annotations → Genome annotation tracks: queries tracks
- Workflow engine → Feature transformation: runs feature processing
- Track definitions → Feature transformation: defines features
- Workflow engine → Regulatory sequence model: runs optional prediction
- Workflow engine → Splice prediction: runs optional prediction
- Workflow engine → Protein language scores: runs optional scoring
- Workflow engine → CADD score prediction: runs scoring
- CADD prediction models → CADD score prediction: provides models
- Workflow engine → Variant score selection: selects variant scores
- Workflow engine → PHRED conversion: converts scores
- Workflow engine → Pre-score extraction: uses pre-scored data
- Pre-scored variants → Pre-score extraction: provides scores
- PHRED conversion → CADD result table: writes scores
- Pre-score extraction → CADD result table: writes scores
