#!/usr/bin/env bash # Fetch the public demo slice: a real GIAB genome and real ClinVar labels, chr22 only. # Provenance, licences and citations: docs/data.md set -euo pipefail OUT_DIR=${OUT_DIR:-data} CLINVAR_URL=${CLINVAR_URL:-https://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/clinvar.vcf.gz} GIAB_URL=${GIAB_URL:-https://ftp-trace.ncbi.nlm.nih.gov/ReferenceSamples/giab/release/AshkenazimTrio/HG002_NA24385_son/NISTv4.2.1/GRCh38/HG002_GRCh38_1_22_v4.2.1_benchmark.vcf.gz} for tool in bcftools tabix; do command -v "$tool" >/dev/null || { echo "$tool is required (brew install bcftools, or apt install bcftools tabix)" >&2 exit 1 } done mkdir -p "$OUT_DIR" # Both sources are indexed, so bcftools streams one chromosome instead of downloading a whole # genome. ClinVar names contigs "22"; GIAB names them "chr22". echo "==> GIAB HG002 (NA24385) v4.2.1 benchmark, chr22 -> $OUT_DIR/example.vcf.gz" bcftools view -r chr22 "$GIAB_URL" -Oz -o "$OUT_DIR/example.vcf.gz" tabix -f -p vcf "$OUT_DIR/example.vcf.gz" echo "==> ClinVar GRCh38, chr22 -> $OUT_DIR/clinvar.chr22.vcf.gz" bcftools view -r 22 "$CLINVAR_URL" -Oz -o "$OUT_DIR/clinvar.chr22.vcf.gz" tabix -f -p vcf "$OUT_DIR/clinvar.chr22.vcf.gz" echo echo "Fetched:" ls -lh "$OUT_DIR/example.vcf.gz" "$OUT_DIR/clinvar.chr22.vcf.gz" cat <<'NEXT' Next: make pipeline VCF=data/example.vcf.gz # annotate the GIAB sample (needs a VEP cache) make annotate JOB= VCF=data/example.vcf.gz NEXT