This repository contains snakemake workflow files for the analysis of GoE legacy data as part of the GoE PGx pilot and the GDI MAP Stage 1.
These perform the following:
- Filtering variants based on specified genomic regions (selected pharmacogenes).
- Splitting multiallelic sites and left-aligning indels.
- Genotype masking and variant filtering.
- Calculating Allele Frequencies (AF) stratified by Country and Sex.
- Generating a sites-only VCF, compatible with the format expected for GDI MAP Stage 1.
- Additionally, generating star allele and phenotype (drug response) frequencies, stratified in the same groups as the above.
The goal is to allow partners to run the exact same workflow on their local data and produce standardized, comparable outputs.
The pipeline can be run as Docker container, or directly from the code in the GitHub repository.
- Install miniconda.
- Create and activate conda env
conda env create -f env.yml
conda activate pgx_pilotgit clone https://github.com/Genome-of-Europe/pgx_pilot.git
cd pgx_pilot
docker build -t goe/pgx-pipeline:latest .Repository structure:
/analysis_directory/
├── config.yaml # Pipeline configuration
├── data/
│ ├── raw_cohort.vcf.gz # Your input VCF (path set in config.yaml)
│ └── samples.tsv # Metadata (SampleID, Sex, CountryCode)
├── resources/ # Folder for resources
│ ├── targets.bed # BED file with PGx genes
│ └── pypgx_genes.txt # Required for PyPGX workflow
└── results/ # Output directory
The pipeline uses a single configuration file: config.yaml.
Important Settings in config.yaml:
output_prefix: Prefix for final VCF files (e.g.,pgx_pilot).input_vcf: Path to your input VCF file.sample_info: Path to your sample metadata TSV.
The sample metadata file must be a three column TSV file, with or without header, where the columns are:
- sample_id: Sample ID (same as the sample ID in the VCF file)
- sex: one of (M, F, 1, 2, Male, Female, XY, XX). Case-insensitive.
- country_code: the two letter country code (ISO 3166-1 alpha-2 code). Case-insensitive.
QC Thresholds:
The pipeline uses standardized thresholds, as defined in the qc_thresholds section of config.yaml.
This repository contains two specialized workflows.
The primary pipeline for generating standardized frequency data and high-quality internal datasets.
Run Command: using conda
snakemake -s Snakefile -j 8using docker
docker run --rm -v $(pwd):/pipeline goe/pgx-pipeline:latest snakemake -s Snakefile -j 8A specialized workflow for Pharmacogenomics (PGx) calling using the PyPGX tool suite.
Run Command: using conda
snakemake -s Snakefile.pypgx -j 8using docker
docker run --rm -v $(pwd):/pipeline goe/pgx-pipeline:latest snakemake -s Snakefile.pypgx -j 8Results are written to the results/ folder.
-
GoE Pipeline Outputs
results/{output_prefix}.sites.pass.vcf.gz: Submission File for GDI MAP Stage 1. PASS variants only.results/{output_prefix}.sites.all.vcf.gz: For GoE PGx pilot. All variants including those that failed QC.results/intermediate/{output_prefix}.full_sample_data.vcf.gz: The full VCF with all sample genotypes. Keep private.
-
PyPGX Pipeline Outputs
results/pgx/merged_alleles.csv: Aggregated star-allele calls across genes, stratified by Group.results/pgx/merged_phenotypes.csv: Aggregated phenotype predictions, stratified by Group.results/pgx/merged_genotypes.csv: Aggregated genotype calls and frequencies, stratified by Group.
Statistics (AC, AN, AF, etc.) are stratified by Country and Sex based on the input metadata.
- Example:
AF_PT_M(Allele Frequency for Males in the PT cohort).