Conversation
When sum(AD) is zero, the no-call path writes two likelihood entries regardless of the allele count. Allocate n_alleles * (n_alleles + 1) / 2 entries to match the existing diploid genotype representation. Preserve GT=./., GQ=0, and neutral likelihoods. Add biallelic and multiallelic regression coverage and verify positive-depth calls remain unchanged.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Update 22 zero-depth biallelic records from PL=0,0 to PL=0,0,0 to match the diploid likelihood cardinality correction in 28b5477. Preserve all other fields and headers. This completes the golden fixture update for the existing production-code fix.
This branch has not been deployed
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.
When
sum(AD) == 0,uncall_gt_if_no_ad()sets the genotype to./., sets GQ to zero, and replaces the genotype likelihoods with exactly two zeros. The likelihood array therefore has the wrong number of entries for the function's existing diploid representation, including an ordinary biallelic record.This change allocates one neutral likelihood per possible diploid genotype while preserving the existing no-call behavior.
Problem and correction
VCF genotype likelihood fields use
Number=G: one value per possible genotype. Withnalleles, including REF, a diploid call requiresn * (n + 1) / 2entries.The zero-depth path currently ignores the allele count:
[0, 0][0, 0, 0][0, 0][0, 0, 0, 0, 0, 0]The implementation derives the allele count from REF plus
alternate_basesand allocates the corresponding number of zeros. GT remains./.and GQ remains0.The internal
genotype_likelihoodprotobuf field stores doubles. Using0.0makes that existing type explicit; the previous integer literals were already converted to doubles on assignment. The VCF writer continues to produce integer PL values.Regression coverage
The tests use the existing parameterized test framework and variant construction helper:
The expected likelihood counts are specified explicitly as 3 and 6, independently of the implementation's formula.
Validation
Five focused cases were run using an isolated harness with existing compiled dependencies from a pinned runtime:
The baseline failures show arrays of length 2 where lengths 3 and 6 are expected. The positive-depth preservation check passes with the fix.
In a synthetic postprocessing check, reprocessing existing CNN outputs with the correction produced VCF and gVCF records with valid
Number=Gcardinality throughout. The zero-depth site retained its no-call genotype and GQ zero. Its VCF record had three PL values; its gVCF record had six after addition of the symbolic allele.These checks used the pinned runtime, not a clean Bazel build. The full postprocessing test suite was not run.
Motivation and scope
A zero-depth call should retain a correctly sized likelihood array even when its genotype is unknown. This fix makes the array consistent with the record's allele count and the existing diploid representation, while preserving
GT=./.andGQ=0.The change is limited to zero-depth likelihood allocation and focused regression tests. The demonstrated defect is malformed likelihood-array cardinality; no downstream miscall or accuracy improvement is claimed.