- 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 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01814GKVzZVL3FuF3DeiZXhv
35 lines
1.6 KiB
Bash
Executable File
35 lines
1.6 KiB
Bash
Executable File
#!/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)"
|