A Snakemake workflow for comprehensive genomic variant annotation using multiple data sources including regulatory elements, conservation scores, pathogenicity predictions, and population genetics data.
This pipeline processes genomic variants in LD (Linkage Disequilibrium) blocks and annotates them with:
- Cell-type specific regulatory elements from single-cell atlas data
- Conservation scores from Zoonomia project (RoCCs and UCEs)
- Regulatory information from RegulomeDB
- Pathogenicity predictions from AlphaMissense
- ENCODE cCRE (candidate Cis-Regulatory Elements)
- Population allele frequencies from 1000 Genomes Project
- bedtools
- bgzip
- DuckDB
- uv (for managing Python environments)
- Python packages (this will be handled by uv):
- Snakemake
- polars
- pandas
- yaml
This pipeline requires two conda/mamba environments that can be automatically created using the provided requirements files:
Create the main environment for running the Snakemake workflow:
uv syncsource .venv/bin/activateThe pipeline requires the following input datasets configured in config.yaml:
-
LD Blocks: Pre-defined linkage disequilibrium blocks file
- Estimates can be downloaded here
-
Regulatory Elements:
- RoCC (Regions of Conserved Constraint) from Zoonomia: https://zoonomiaproject.org/
- UCE (Ultra-Conserved Elements) from Zoonomia: https://zoonomiaproject.org/
- Cell-type specific regulatory regions: Single-cell atlas data from Zhang et al. 2021
- Download:
bash wget https://cgl.gi.ucsc.edu/data/cactus/zoonomia-2021-track-hub/hg38/RoCCs.bed.gz wget https://cgl.gi.ucsc.edu/data/cactus/zoonomia-2021-track-hub/hg38/zooUCEs.bed.gz wget https://cgl.gi.ucsc.edu/data/cactus/zoonomia-2021-track-hub/hg38/UNICORNs.bed.gz
-
Regulatory Databases:
- RegulomeDB: https://regulomedb.org/regulome-help/ - Download bulk data
bash wget https://www.encodeproject.org/files/ENCFF250UJY/@@download/ENCFF250UJY.tsv ln -s ENCFF250UJY.tsv regulomedb.tsv- dbSNP: https://www.ncbi.nlm.nih.gov/snp/ - NCBI dbSNP database
-
Pathogenicity Scores:
- AlphaMissense: https://github.com/google-deepmind/alphamissense - Download predictions
-
Ancestry stratified allele frequencies:
- 1000 Genomes Project: https://www.internationalgenome.org/data/ - Allele frequency data
-
ENCODE Data:
- cCREs (candidate Cis-Regulatory Elements): https://screen.encodeproject.org/ - ENCODE SCREEN database
bash wget https://downloads.wenglab.org/Registry-V4/GRCh38-cCREs.bed
🚀 Get started quickly with our automated download script
You can easily download zoonmia/catlas/ENCODE/regulome/AlphaMissense data using our automated script:
# Execute the download script directly
curl -sSL https://raw.githubusercontent.com/weinstockj/SNP_annotations/refs/heads/master/download_annotations_script.sh | bash
# Or download first, review, then execute
wget https://raw.githubusercontent.com/weinstockj/SNP_annotations/refs/heads/master/download_annotations_script.sh
chmod +x download_annotations_script.sh
./download_annotations_script.shThis script will automatically download all the required annotation files mentioned in the Input Data Sources section below, saving you time and ensuring you have the correct versions.
Note that you will still need to separately download the 1000 Genomes allele frequency data and the dbSNP database, as these are large datasets that require manual download from their respective sources.
See here for a script to download the dbSNP VCF and then convert to Parquet format, which is required for the pipeline to help us merge in different sources.
See here for a script to download the high depth 1000 Genomes allele frequency data, which is required for the pipeline.
After downloading the required data, you need to configure the pipeline settings:
Edit config.yaml to specify paths to your input data:
LD_blocks_file: "path/to/LD_blocks.bed"
RoCC: "path/to/RoCCs.bed.gz"
UCE: "path/to/zooUCEs.bed.gz"
ADULT_CELL_TYPE_DIR: "path/to/cell_type_beds"
REGULOME_DB_PATH: "path/to/regulomedb.tsv"
# ... (see config.yaml for full configuration)# Run with cluster execution (SLURM)
source .venv/bin/activate && run_cluster.sh
# Or run locally
source .venv/bin/activate && snakemake -p -j <num_cores> {OUTPUT_DIR}/all_variants_annotated_complete.parquet: Complete annotated variant dataset{OUTPUT_DIR}/all_variants.bed: Combined BED file of all variants{OUTPUT_DIR}/{BLOCK}/variant_list_ccre_annotated_complete.parquet: Per-block annotated variants
- Converts variant lists to BED format
- Uses bedtools to annotate variants with:
- Cell-type specific regulatory elements
- RoCC conservation scores
- UCE ultra-conserved elements
convert_regulome: Converts RegulomeDB TSV to Parquet formatsetid_regulome: Adds variant IDs using dbSNP referenceconvert_alpha: Processes AlphaMissense pathogenicity scores
- Merges variants with:
- 1000 Genomes allele frequencies
- RegulomeDB regulatory annotations
- AlphaMissense pathogenicity scores
- ENCODE cCRE elements
collate_annotations: Combines all per-block annotationsmega_bed: Creates unified BED file of all variants
add_annotations.py: Main annotation script that merges variant data with multiple annotation sourcescollate_annotations.py: Combines multiple parquet files into a single datasetutils.py: Utility functions for data processing and merging operations
read_cCRE(): Reads and processes ENCODE cCRE dataread_bed(): Parses BED files with proper column typingmerge_regulomedb(): Joins RegulomeDB annotationsmerge_AlphaMissense(): Adds pathogenicity predictionsmerge_1KG(): Incorporates population allele frequencies
Each variant is annotated with:
- Cell-type specific accessibility (multiple cell types)
- RoCC conservation scores
- UCE ultra-conserved element overlap
- ChIP-seq evidence (
ChIP) - Chromatin accessibility (
Chromatin_accessibility) - QTL associations (
QTL) - PWM motif matches (
PWM)
- AlphaMissense pathogenicity score (
am_pathogenicity)
- Various cCRE types:
pELS,CA-CTCF,CA,CA-TF,dELS,TF,CA-H3K4me3,PLS
- Allele frequencies across 1000 Genomes populations (multiple
AF_*columns)
- Memory: 3-18GB depending on the rule
- Time: 1-8 hours per rule
- Storage: Varies based on input data size
stdout.log: Standard output from Snakemake executionstderr.log: Error messages and warnings- Individual rule logs in
logs/directory
If you use this pipeline in your research, please cite the relevant data sources:
- RegulomeDB
- AlphaMissense
- ENCODE Project
- Zoonomia Consortium
- 1000 Genomes Project
For questions or issues, please contact Josh Weinstock.