set -uo pipefail module load bcftools/1.16 >/dev/null 2>&1 R=/ibex/project/c2041/hany0c/bench_h2h_20260915/real V=$R/raw/1kGP_high_coverage_Illumina.chr2.filtered.SNV_INDEL_SV_phased_panel.vcf.gz echo "start $(date -u +%FT%TZ) host $(hostname)" echo "== GT values chr2:10000000-10100000 (all 3202 samples)" bcftools query -r chr2:10000000-10100000 -f "[%GT\n]" $V 2>/dev/null | sort | uniq -c echo "== samples VCF vs ped" bcftools query -l $V > $R/logs/.vcf_samples.tmp awk "NR>1{print \$2}" $R/ref/20130606_g1k_3202_samples_ped_population.txt | sort > $R/logs/.ped_samples.tmp sort $R/logs/.vcf_samples.tmp | comm -3 - $R/logs/.ped_samples.tmp | wc -l rm -f $R/logs/.vcf_samples.tmp $R/logs/.ped_samples.tmp echo "== whole-file site scan (no genotypes)" bcftools query -f "%POS\t%FILTER\t%TYPE\t%N_ALT\t%INFO/AC\n" $V 2>/dev/null | awk -F"\t" " {n++; filt[\$2]++; typ[\$3]++; if(\$3==\"snp\" && \$4==1){bs++; if(\$5==1)ac1++; if(\$51){d++; dr+=pc[p]}; print \"biallelic_snv positions with >1 biallelic snv record\",d,\"records\",dr; e=0; for(p in snpany) if(snpany[p]>1)e++; print \"positions with >1 SNV record (any N_ALT)\",e}" echo "end $(date -u +%FT%TZ)"