Fixed a bug in ReblockGVCF that could cause the first position on a contig to be dropped. #8028
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.
Closes #7884.
The bug was caused by two position-only checks that should have been contig+position checks.
I added a minimal regression test that uses a 2-record snippet of the test data discussed in the first post of the issue.
Also discussed there is expected behavior that this fix does not induce. It seems the expectation is that a QUAL = 0 variant block should be turned into a GQ0 reference block.
However, I wonder if this is not actually representative of the current (pre-fix) behavior of the tool. For example, if the test data is run only over chr13 using master, the position is not dropped (since then the position-only checks are valid). In that case, we do not see a GQ0 reference block; we instead see a GQ40 reference block, since the original record had GQ61.
With the fix, we reproduce this reference block. So although we do not induce the expected GQ0 behavior, I would say the bug is fixed.
Whether or not we should issue an additional fix to induce the expected GQ0 behavior is another question entirely. I'm not completely sure what the expected behavior should be from the tool or code documentation alone. Someone more familiar with this tool (@droazen perhaps you can suggest?) may have to chime in. They should probably also check that the contig+position checks are all that need to be added to address the original bug; I'm not 100% sure about behavior there either, but at least all other integration tests seem to still pass.