#!/bin/bash
# Phase P4: genotype every Omni2.5 IDAT pair and compare the GTC with the vendor's (fields + whole file).
# Args:
set -uo pipefail
D=$1; OUT=$2
SRC=s3://1000genomes/release/20130502/supporting/hd_genotype_chip/broad_intensities
mkdir -p $D/egt
aws s3 cp --no-sign-request "$SRC/HumanOmni2.5-4v1-Multi_H.egt" $D/egt/ --only-show-errors
cp $D/HumanOmni2.5-4v1-Multi_B.egt $D/egt/
/usr/bin/time -v .venv/bin/python scripts/validate_p4_large.py --root $D/data --bpm $D/HumanOmni2.5-4v1-Multi_B.bpm \
--egt-dir $D/egt --out $OUT/summary.json --norm-version 1.1.2 --sex-version 1 --workers "$(nproc)" \
2> $OUT/time.txt || echo "P4 validation reported differences"
tail -25 $OUT/time.txt