Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[query/vds] Fix removal of ref GT in from_merged_representation #14699

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions hail/python/hail/vds/variant_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ def from_merged_representation(mt, *, ref_block_fields=(), infer_ref_block_field

gt_field = 'LGT' if 'LGT' in mt.entry else 'GT'

# remove LGT/GT and LA fields, which are trivial for reference blocks and do not need to be represented
if gt_field in used_ref_block_fields:
used_ref_block_fields.remove(gt_field)
# remove the LA field, which is trivial for reference blocks and does not need to be represented
if 'LA' in used_ref_block_fields:
used_ref_block_fields.remove('LA')

Expand Down
3 changes: 3 additions & 0 deletions hail/python/test/hail/vds/test_vds.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,9 @@ def test_combiner_max_len():
@test_timeout(4 * 60, local=6 * 60)
def test_split_sparse_roundtrip():
vds = hl.vds.read_vds(os.path.join(resource('vds'), '1kg_chr22_5_samples.vds'))
# this doesn't actually roundtrip because 1kg_chr22_5_samples was generated before
# we added GT to reference_data, to_merged_sparse_mt adds a reference GT
vds.reference_data = vds.reference_data.annotate_entries(LGT=hl.call(0, 0))
smt = hl.vds.to_merged_sparse_mt(vds)
smt = hl.experimental.sparse_split_multi(smt)
vds2 = hl.vds.VariantDataset.from_merged_representation(
Expand Down