# Hail gVCF bgzip files are getting sorted?

**URL:** <https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156>\
**Category:** Hail Query & hailctl\
**Created:** [June 3, 2025, 12:19pm UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156 "2025-06-03T12:19:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vipul\_Patel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/vipul_patel/32/1301_2.png) [@Vipul\_Patel](https://discuss.hail.is/u/Vipul_Patel)\
**Post date:** [June 3, 2025, 12:19pm UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/1 "2025-06-03T12:19:19Z")

</div>

Hi

I am currently playing around with hail and read up quite a bit of here and there to make it runnable, solving issues from not finding the file or how to create the storing the result.

The issue, which I face now, is the forcing of resorting the vcf before I can run `combine.run()`.  
How to I can avoid this step, as the gVCF should be already in a sorted state, the tabix file is generated and located next to it.  
Is this a problem that the files on UKB are not ending on .vcf[.bgz, .gz] ?  
Any clue, tip is highly appreciated

I currently testing only with one sample, one chromosome with 16cpu, to keep the cost low for testing.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/2X/5/5b8fcdcfcaab506e188264532e6fdb04139d510f.png)

```python
combiner = hl.vds.new_combiner(
    output_path=f'dnax://{my_database}/vds_result',
    temp_path=f'dnax://{my_database}/tmp/combiner',
    gvcf_paths=test_vcf[0],
    use_genome_default_intervals=True,
    reference_genome='GRCh38'
)

```

---

<div class="post-metadata">

**Author:** ![chrisvittal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/chrisvittal/32/327_2.png) [@chrisvittal](https://discuss.hail.is/u/chrisvittal)\
**Post date:** [June 3, 2025, 2:41pm UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/2 "2025-06-03T14:41:48Z")

</div>

> [@Vipul\_Patel](#):
>
> Is this a problem that the files on UKB are not ending on .vcf[.bgz, .gz] ?

No, this is fine.

I would recommend testing the combiner with at least 2 inputs.

The message you’re seeing is indicating that the VCF is sorted.

What’s going on here is that we scan a single GVCF to determine what fields should be in the reference data. If you set, `gvcf_reference_entry_fields_to_keep ` in `new_combiner` these messages should disappear.

---

<div class="post-metadata">

**Author:** ![Vipul\_Patel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/vipul_patel/32/1301_2.png) [@Vipul\_Patel](https://discuss.hail.is/u/Vipul_Patel)\
**Post date:** [June 3, 2025, 2:48pm UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/3 "2025-06-03T14:48:06Z")

</div>

@chrisvittal thanks a lot for clarifications!

By setting the `gvcf_reference_entry_fields_to_keep` field, would that also reduce then in general the run time or this is more bound to the number of cpu for the inital scan?

---

<div class="post-metadata">

**Author:** ![chrisvittal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/chrisvittal/32/327_2.png) [@chrisvittal](https://discuss.hail.is/u/chrisvittal)\
**Post date:** [June 3, 2025, 3:07pm UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/4 "2025-06-03T15:07:19Z")

</div>

The runtime is dominated by the actual combine work. Anything you see before running `combiner.run()` is setup/metadata collection. Setting `gvcf_reference_entry_fields_to_keep` just avoids a scan that determines the defined reference fields by explicitly requesting the fields you want to keep.

---

<div class="post-metadata">

**Author:** ![Vipul\_Patel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/vipul_patel/32/1301_2.png) [@Vipul\_Patel](https://discuss.hail.is/u/Vipul_Patel)\
**Post date:** [June 3, 2025, 5:25pm UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/5 "2025-06-03T17:25:00Z")

</div>

Thank you again @chrisvittal .

I know this is going now out of the title. I will change it, if I can. But would you be so kind to explain maybe here further? The question would be for me: how I could break down this preparation phase, if actually possible?  
Currently it took using the 16 cpu 3.1h to setup/metadata collection. I am not sure if this `normal expectation time` .

---

<div class="post-metadata">

**Author:** ![Vipul\_Patel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/vipul_patel/32/1301_2.png) [@Vipul\_Patel](https://discuss.hail.is/u/Vipul_Patel)\
**Post date:** [June 6, 2025, 7:37am UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/6 "2025-06-06T07:37:14Z")

</div>

Any tip, recommendation or where to look is highly apricated.

---

<div class="post-metadata">

**Author:** ![chrisvittal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/chrisvittal/32/327_2.png) [@chrisvittal](https://discuss.hail.is/u/chrisvittal)\
**Post date:** [June 6, 2025, 4:18pm UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/7 "2025-06-06T16:18:18Z")

</div>

What are you seeing? It sounds like the actual import and combine work is proceeding rather than the small metadata gathering that the combiner performs.

---

<div class="post-metadata">

**Author:** ![Vipul\_Patel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/vipul_patel/32/1301_2.png) [@Vipul\_Patel](https://discuss.hail.is/u/Vipul_Patel)\
**Post date:** [June 10, 2025, 8:09am UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/8 "2025-06-10T08:09:07Z")

</div>

Sorry for the late reply, we had some public holidays here.  
Anyway here is what I have observed:

when I was running

> combiner = hl.vds.new\_combiner(  
> output\_path=f’dnax://{my\_database}/vds\_result’,  
> temp\_path=f’dnax://{my\_database}/tmp/combiner’,  
> gvcf\_paths=test\_vcf[0],  
> use\_genome\_default\_intervals=True,  
> reference\_genome=‘GRCh38’  
> )

I saw on the control panel for the spark cluster that around 52 jobs were submitted and each took 1h running time. I didn´t got any log out put during this time.

```python
 combiner.run()

```

Afterwards I executed the combiner.run() which send out over around 12000 jobs.

Based on message regarding sorting, I thought actually previous 3h the function tried to resort the sorted gvcf.

Is there a way to see what is ongoing during the initial phase?

---

<div class="post-metadata">

**Author:** ![chrisvittal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/chrisvittal/32/327_2.png) [@chrisvittal](https://discuss.hail.is/u/chrisvittal)\
**Post date:** [June 11, 2025, 6:15pm UTC](https://discuss.hail.is/t/hail-gvcf-bgzip-files-are-getting-sorted/4156/9 "2025-06-11T18:15:06Z")

</div>

There isn’t really. I’ve added a bit more logging so that in the future, there’s more visibility into what `new_combiner` is doing. Thank you for the feedback.
