From b8a10f4da56b12c1bf83bab271bc869c9133ab14 Mon Sep 17 00:00:00 2001 From: Miguel Covarrubias Date: Sun, 21 Apr 2024 06:37:04 -0400 Subject: [PATCH] Fix partition grouping bug --- scripts/variantstore/wdl/extract/hail_create_vat_inputs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/variantstore/wdl/extract/hail_create_vat_inputs.py b/scripts/variantstore/wdl/extract/hail_create_vat_inputs.py index 1f4015abe76..668bc51724e 100644 --- a/scripts/variantstore/wdl/extract/hail_create_vat_inputs.py +++ b/scripts/variantstore/wdl/extract/hail_create_vat_inputs.py @@ -190,7 +190,9 @@ def main(vds, ancestry_file_location, sites_only_vcf_path, dry_run_n_parts=None) sites_only_vcf_path = sites_only_vcf_path.replace(r".vcf.bgz", f'_dryrun.vcf.bgz') else: n_rounds = 5 - parts_per_round = n_parts // n_rounds + # Add in 'n_rounds - 1' to include all of the partitions in the set of groups, otherwise we would omit the final + # n_parts % n_rounds partitions. + parts_per_round = (n_parts + n_rounds - 1) // n_rounds ht_paths = [sites_only_vcf_path.replace(r".sites-only.vcf.bgz", f'_{i}.ht') for i in range(n_rounds)] for i in range(n_rounds): part_range = range(i*parts_per_round, min((i+1)*parts_per_round, n_parts))