[query/vds] Add LEN field to VDS #14675
Merged
Merged
Conversation
patrick-schultz
requested changes
Sep 11, 2024
patrick-schultz
left a comment
Member
There was a problem hiding this comment.
Looking good, just a few small things
cjllanwarne
requested changes
Sep 17, 2024
cjllanwarne
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. I've left a few minor comments but happy to switch over to Approve if you prefer to leave things as they are.
| .when(hl.is_defined(mt[ref_block_indicator_field]) & mt[gt_field].is_hom_ref(), True) | ||
| .or_error( | ||
| hl.str( | ||
| 'cannot create VDS from merged representation -' ' found END field with non-reference genotype at ' |
Collaborator
There was a problem hiding this comment.
TIL python lets you concatenate strings by just putting them next to each other like this 🤯
cjllanwarne
approved these changes
Sep 17, 2024
chrisvittal
added a commit
to chrisvittal/hail
that referenced
this pull request
Sep 18, 2024
After split_multi, LGT is dropped from the variant data of a VDS. After PR hail-is#14560, LGT is added to datasets after creation via the combiner. After hail-is#14675 the same is true for `from_merged_representation`. We should keep the GT/LGT field consistent across ref and var data. This change does so for split_multi. Resolves hail-is#14694
chrisvittal
added a commit
to chrisvittal/hail
that referenced
this pull request
Sep 19, 2024
After split_multi, LGT is dropped from the variant data of a VDS. After PR hail-is#14560, LGT is added to datasets after creation via the combiner. After hail-is#14675 the same is true for `from_merged_representation`. We should keep the GT/LGT field consistent across ref and var data. This change does so for split_multi. Resolves hail-is#14694
hail-ci-robot
pushed a commit
that referenced
this pull request
Sep 19, 2024
After split_multi, LGT is dropped from the variant data of a VDS. After PR #14560, LGT is added to datasets after creation via the combiner. After #14675 the same is true for `from_merged_representation`. We should keep the GT/LGT field consistent across ref and var data. This change does so for split_multi. Resolves #14694
9bce5c9 to
d7d31cb
Compare
We can't do this anymore since genotype may be something other than diploid. Missed this in the original VDS ploidy changes
This is the beginning of a series of changes to support export of VDS to VCF 4.5, the version of VCF that contains the standardized form of our work that culminated in SVCR/VDS. Reference blocks were standardized with a LEN rather than an END. So, now, by default, add LEN to all VDS reads and drop END in favor of LEN on all VDS writes. Our optimizer will be able to take care of pruning away the dead field. We make sure that all VDS creation (other than the combiner), such as read_vds and from_merged_representation, contains both LEN and END preserving user code that depends on the presence of the END field.
Co-authored-by: Patrick Schultz <pschultz@broadinstitute.org>
473e90f to
f39364c
Compare
dismissing this since I'd like another look after working around one of the core issues discoverd here
a8961c7 to
56b6c23
Compare
patrick-schultz
approved these changes
Oct 1, 2024
patrick-schultz
left a comment
Member
There was a problem hiding this comment.
Looks great, thanks Chris!
chrisvittal
added a commit
to chrisvittal/hail
that referenced
this pull request
May 21, 2025
As of hail-is#14675, we are automatically adding a `LEN` field to VDS on read, while also dropping the `END` field on write. For older VDS, this puts the `LEN` field at the end of the reference entry struct. PR hail-is#14675 puts `LEN` as the first item in the entry struct when creating new reference data from a GVCF. This leads to an incompatibility when running the combiner on a mixture of old and new datasets. The solution here can be very simple. Just put `LEN` at the end of the entry struct on GVCF import as well.
chrisvittal
added a commit
to chrisvittal/hail
that referenced
this pull request
May 23, 2025
…#14897) As of hail-is#14675, we are automatically adding a `LEN` field to VDS on read, while also dropping the `END` field on write. For older VDS, this puts the `LEN` field at the end of the reference entry struct. PR hail-is#14675 puts `LEN` as the first item in the entry struct when creating new reference data from a GVCF. This leads to an incompatibility when running the combiner on a mixture of old and new datasets. The solution here can be very simple. Just put `LEN` at the end of the entry struct on GVCF import as well. ## Security Assessment Delete all except the correct answer: - This change cannot impact the Hail Batch instance as deployed by Broad Institute in GCP
jmarshall
pushed a commit
to populationgenomics/hail
that referenced
this pull request
May 25, 2025
…#14897) As of hail-is#14675, we are automatically adding a `LEN` field to VDS on read, while also dropping the `END` field on write. For older VDS, this puts the `LEN` field at the end of the reference entry struct. PR hail-is#14675 puts `LEN` as the first item in the entry struct when creating new reference data from a GVCF. This leads to an incompatibility when running the combiner on a mixture of old and new datasets. The solution here can be very simple. Just put `LEN` at the end of the entry struct on GVCF import as well. [Cherry-picked from upstream 012856c]
milo-hyben
pushed a commit
to populationgenomics/hail
that referenced
this pull request
May 25, 2025
…#14897) (#366) As of hail-is#14675, we are automatically adding a `LEN` field to VDS on read, while also dropping the `END` field on write. For older VDS, this puts the `LEN` field at the end of the reference entry struct. PR hail-is#14675 puts `LEN` as the first item in the entry struct when creating new reference data from a GVCF. This leads to an incompatibility when running the combiner on a mixture of old and new datasets. The solution here can be very simple. Just put `LEN` at the end of the entry struct on GVCF import as well. [Cherry-picked from upstream 012856c] Co-authored-by: Christopher Vittal <cvittal@broadinstitute.org>
ehigham
added a commit
to ehigham/hail
that referenced
this pull request
Jun 24, 2026
…ail-is#15543) Adds two `Simplify` rules that push `MatrixFilterCols` through `MatrixMapEntries` and `MatrixFilterEntries`, so column reduction runs before per-entry work. _should_ fix a regression in VDS queries introduced by hail-is#14675 (which added a LEN field via `MatrixMapEntries`). The regression occurs because `MatrixFilterCols` sits outside `MatrixMapEntries` after lowering, forcing the entries map to materialize the full entries array for all columns before column filtering subsets it — producing an extra `ToArray` of the entire entries array per row. (to verify) This change does not affect the broad-managed batch service in gcp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the beginning of a series of changes to support export of VDS to VCF 4.5, the version of VCF that contains the standardized form of our work that culminated in SVCR/VDS.
Reference blocks were standardized with a LEN rather than an END. So, now, by default, add LEN to all VDS reads and drop END in favor of LEN on all VDS writes. Our optimizer will be able to take care of pruning away the dead field in pipelines that don't use it.
We make sure that all VDS creation (other than the combiner), such as read_vds and from_merged_representation, contains both LEN and END preserving user code that depends on the presence of the END field.
Furthermore, this change contains necessary combiner updates to prefer LEN over END, and to use LEN in the combiner itself.