P5a: QC — control metrics, thresholds, status, contamination, relatedness, locus summary

- qc/controls: canonical control names (QC-002), bkg/offset (QC-003), 13 genotyping metrics (QC-004/005),
  missing/zero-divisor handling (QC-007/008); controls_raw.tsv / controls_qc.tsv (QC-009/011) incl. compat CSVs
- qc/thresholds + profiles: YAML schema, validation codes, precedence, shipped profiles, auto (QC-020..025)
- qc/status: functional PASS/FAIL/NA, control CLEAR/FLAGGED, flags (QC-030..033)
- qc/contamination: BAF regression; bit-compatible with gtc2vcf BAFregress (36/36, K-017), exact mode too
- qc/relatedness: KING-robust, duplicates, Mendelian errors, pedigree from sheet (IN-018)
- qc/locus_summary: OUT-072, bit-identical to BeadArrayFiles except ChiTest (K-018)
- qc/suggest: suggest-thresholds (QC-026)
- pipeline/qc: disk-backed cohort store; CLI qc controls|samples|contamination|relatedness|loci|suggest-thresholds
- genotype: control tables (OUT-070), het_rate, QC columns, cohort QC
- tests: unit + oracle (BAFregress plugin, BeadArrayFiles locus summary)
This commit is contained in:
kemal committed 2026-09-28 08:35:10 +01:00
1 parent d11226ca31
commit a8caa26aa4
28 files changed
+3355 -22

No files matched your search

+3 -3
View File
@@ -9,14 +9,14 @@ cd "$(dirname "$0")/.."
V=1.22
T=refs/tools
B=$T/bcftools-$V
if [[ ! -x $B/bcftools || ! -f $B/plugins/idat2gtc.so ]]; then
if [[ ! -x $B/bcftools || ! -f $B/plugins/idat2gtc.so || ! -f $B/plugins/BAFregress.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/
rm -f $B/plugins/{idat2gtc,gtc2vcf,affy2vcf,BAFregress}.{c,h}
cp refs/gtc2vcf/{idat2gtc,gtc2vcf,affy2vcf,BAFregress}.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)" CFLAGS="-g -O2 -ffp-contract=off" >/dev/null)
fi
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Oracle outputs for phase P5 (QC) on the P0 GSA demo data:
# * BeadArrayFiles (BSD-2) examples/locus_summary.py over the 36 oracle GTCs, run in a separate venv with
# scipy/pandas (oracle-only dependencies; never needed by SimurgArray itself);
# * the gtc2vcf BAFregress plugin (MIT) is built by scripts/make_oracle_gtcs.sh and run by the tests directly.
set -euo pipefail
cd "$(dirname "$0")/.."
V=refs/tools/oracle-venv
[[ -x $V/bin/python ]] || { uv venv -q $V && uv pip install -q --python $V/bin/python numpy scipy pandas; }
SHIM=refs/tools/shim
mkdir -p $SHIM && ln -sfn "$PWD/refs/BeadArrayFiles/module" $SHIM/IlluminaBeadArrayFiles
D=data/p0/gsa_v4_pgx
OUT=data/p0/oracle/locus_summary
mkdir -p $OUT
PYTHONPATH=$SHIM $V/bin/python refs/BeadArrayFiles/examples/locus_summary.py data/p0/oracle/gsa_gt3_nofma \
$D/GSA-PGx-48v4-0_20079540_E2_bpm/GSA-PGx-48v4-0_20079540_E2.bpm \
$D/GSA-PGx-48v4-0_20079540_E2_ClusterFile/GSA-PGx-48v4-0_20079540_E2_ClusterFile.egt \
$OUT/gsa36_beadarrayfiles.csv
echo "wrote $OUT/gsa36_beadarrayfiles.csv"