P0: project setup (packaging, CI, licences, data/oracle scripts)

- pyproject (uv/hatch, ruff, mypy strict, pytest markers), MIT LICENSE,
  THIRD_PARTY_NOTICES with verbatim BSD-2 (BeadArrayFiles) and MIT (gtc2vcf)
- CI workflow for Gitea/GitHub Actions: lint, type check, unit tests
- fetch_data.sh p0 now fetches the GSA v4 PGx demo IDATs (the GDA "Demo 36"
  bundle is a GenomeStudio project), unpacks archives, fixes pipefail bug
- make_oracle_gtcs.sh builds bcftools + gtc2vcf and writes oracle GTCs
- plan §17: corrected P0 dataset table
This commit is contained in:
kemal committed 2026-09-27 16:56:39 +01:00
1 parent 5695119e9c
commit 0a421dffc9
8 files changed
+269 -27

No files matched your search

+30 -16
View File
@@ -18,28 +18,42 @@ get() { # get <url> <dest-dir>
grep -q " $f\$" "$sums" || sha256sum "$f" >> "$sums"
}
unpack() { # unzip/untar every archive under <dir> next to itself (idempotent)
find "$1" -name '*.zip' -o -name '*.tar.gz' | sort | while read -r a; do
out="${a%.zip}"; out="${out%.tar.gz}"
[[ -d "$out" ]] && continue
mkdir -p "$out"
case "$a" in *.zip) unzip -q -o "$a" -d "$out";; *.tar.gz) tar -xzf "$a" -C "$out";; esac
done
}
GDA=https://webdata.illumina.com/downloads/productfiles/global-diversity-array
G1K=https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502/supporting/hd_genotype_chip
case "$tier" in
p0)
d=data/p0/gda_demo36; mkdir -p "$d"
get "$GDA/infinium-global-diversity-array-8-v1-0-D1-demo-data-36.zip" "$d"
get "https://support.illumina.com/content/dam/illumina-support/documents/downloads/productfiles/global-diversity-array/infinium-global-diversity-array-8-v1-0_D1_SampleSheet_Demo_36.csv" "$d"
# GSA v4 PGx demo: 36 samples, real IDATs + BPM/CSV/EGT (primary small fixture)
SUP=https://support.illumina.com/content/dam/illumina-support/documents/documentation/chemistry_documentation/infinium_assays/infinium-gsa-pgx
d=data/p0/gsa_v4_pgx; mkdir -p "$d"
for f in idats_Demo_36.zip GSA-PGx-48v4-0_20079540_E2_bpm.zip GSA-PGx-48v4-0_20079540_E2_csv.zip \
GSA-PGx-48v4-0_20079540_E2_ClusterFile.zip SampleSheetTemplate_GSAv4PGx_2beadchips.csv; do
get "$SUP/$f" "$d"
done
# GDA v1 manifest/cluster files (note: the "Demo 36" bundle is a GenomeStudio project, not IDATs)
d=data/p0/gda_v1; mkdir -p "$d"
get "$GDA/infinium-global-diversity-array-8-v1-0-D1-manifest-file-bpm.zip" "$d"
# CSV manifest and EGT: file names can change; if these fail, download manually from
# https://support.illumina.com/array/array_kits/infinium-global-diversity-array/product-files.html
get "$GDA/infinium-global-diversity-array-8-v1-0-D1-manifest-file-csv.zip" "$d" || echo "!! fetch CSV manifest manually"
get "$GDA/infinium-global-diversity-array-8-v1-0-D1-cluster-file.zip" "$d" || echo "!! fetch EGT manually"
if command -v Rscript >/dev/null; then
Rscript -e 'if(!requireNamespace("BiocManager",quietly=TRUE)) install.packages("BiocManager",repos="https://cloud.r-project.org"); BiocManager::install(c("IlluminaDataTestFiles","hapmap370k"),ask=FALSE,update=FALSE)'
Rscript -e 'cat(system.file("extdata",package="IlluminaDataTestFiles"),"\n")' > data/p0/bioc_fixture_path.txt
else
echo "!! R not found: install IlluminaDataTestFiles + hapmap370k from Bioconductor for parser fixtures"
fi
echo "NOTE: GSA v4 PGx demo (36 samples) + product files: download manually from"
echo " https://support.illumina.com/downloads/infinium-gsa-v4-pgx-demo-data-set-iscan.html"
echo " https://support.illumina.com/array/array_kits/infinium-global-screening-array-v4-pgx/product-files.html"
get "$GDA/infinium-global-diversity-array-8-v1-0-D1-manifest-file-csv.zip" "$d"
get "$GDA/infinium-global-diversity-array-8-v1-0-D1-cluster-file.zip" "$d"
get "https://support.illumina.com/content/dam/illumina-support/documents/downloads/productfiles/global-diversity-array/infinium-global-diversity-array-8-v1-0_D1_SampleSheet_Demo_36.csv" "$d"
# Bioconductor IDAT fixtures (Artistic-2.0, redistributable) — fetched as source tarballs, no R needed
d=data/p0/bioc; mkdir -p "$d"
for pkg in IlluminaDataTestFiles hapmap370k; do
url=$(curl -sL "https://bioconductor.org/packages/release/data/experiment/html/$pkg.html" \
| grep -oE "\.\./src/contrib/${pkg}_[0-9.]+\.tar\.gz" | head -1 || true)
[[ -n "$url" ]] && get "https://bioconductor.org/packages/release/data/experiment/${url#../}" "$d" \
|| echo "!! could not resolve $pkg tarball"
done
unpack data/p0
;;
p1)
d=data/p1/1kg_omni_broad; mkdir -p "$d"
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Build bcftools + gtc2vcf plugins (MIT) under refs/tools and generate oracle GTC files from the P0 GSA demo IDATs.
# Usage: bash scripts/make_oracle_gtcs.sh [chip-folder ...] (default: every chip in the demo set)
set -euo pipefail
cd "$(dirname "$0")/.."
V=1.22
T=refs/tools
B=$T/bcftools-$V
if [[ ! -x $B/bcftools || ! -f $B/plugins/idat2gtc.so ]]; then
[[ -d refs/gtc2vcf ]] || bash scripts/bootstrap_refs.sh
mkdir -p $T
[[ -f $T/bcftools.tar.bz2 ]] || curl -sL -o $T/bcftools.tar.bz2 \
"https://github.com/samtools/bcftools/releases/download/$V/bcftools-$V.tar.bz2"
tar -xjf $T/bcftools.tar.bz2 -C $T
rm -f $B/plugins/{idat2gtc,gtc2vcf,affy2vcf}.{c,h}
cp refs/gtc2vcf/{idat2gtc,gtc2vcf,affy2vcf}.c refs/gtc2vcf/*.h $B/plugins/
(cd $B/htslib-$V && ./configure --disable-libcurl --disable-bz2 --disable-lzma --disable-ref-cache >/dev/null)
(cd $B && ./configure --without-gsl >/dev/null && make -j"$(nproc)" >/dev/null)
fi
export BCFTOOLS_PLUGINS=$B/plugins
D=data/p0/gsa_v4_pgx
IDATS=$D/idats_Demo_36/idats_Demo_36
OUT=data/p0/oracle/gsa_gtc_gtc2vcf
mkdir -p "$OUT"
chips=("$@")
[[ ${#chips[@]} -eq 0 ]] && mapfile -t chips < <(find "$IDATS" -mindepth 1 -maxdepth 1 -type d | sort)
for chip in "${chips[@]}"; do
$B/bcftools +idat2gtc \
--bpm $D/GSA-PGx-48v4-0_20079540_E2_bpm/GSA-PGx-48v4-0_20079540_E2.bpm \
--egt $D/GSA-PGx-48v4-0_20079540_E2_ClusterFile/GSA-PGx-48v4-0_20079540_E2_ClusterFile.egt \
--idats "$chip" --output "$OUT" 2>&1 | grep -E "^(Call rate|Gender|Writing)" || true
done
$B/bcftools +idat2gtc --version 2>&1 | head -2 || true
echo "oracle GTCs in $OUT: $(ls "$OUT"/*.gtc | wc -l)"