File Info

Filename
.command.sh
Full Path
s3://natera-rnd-pltf-dev-nextflow-scratch-01/work/da/368ed736e8b869732a3c5598640708/.command.sh
Size
838 bytes
Attempt
#!/bin/bash -euo pipefail
# Sort partial VCFs by shard label (natural sort handles shard_0001 < shard_0010).
SORTED_VCFS=$(ls *.vcf | sort -V)
FIRST=$(echo "$SORTED_VCFS" | head -1)

# Take header from first VCF, data lines from all in shard order, then
# sort the body by chrom + pos so the merged VCF is genomically sorted.
grep "^#" "$FIRST" > 52941-ND0952_fetal.unsorted.vcf
for vcf in $SORTED_VCFS; do
    grep -v "^#" "$vcf" >> 52941-ND0952_fetal.unsorted.vcf || true
done

grep "^#" 52941-ND0952_fetal.unsorted.vcf > 52941-ND0952_fetal.vcf
grep -v "^#" 52941-ND0952_fetal.unsorted.vcf | sort -k1,1V -k2,2n >> 52941-ND0952_fetal.vcf || true
rm 52941-ND0952_fetal.unsorted.vcf

# Recompute per-call proximity features over the global call set.
nipt_recompute_proximity.py --vcf 52941-ND0952_fetal.vcf --output 52941-ND0952_fetal.vcf