Skip to content

Commit

Permalink
Fix for PossibleDeNovo annotation to work without Genotype Likelihoods (
Browse files Browse the repository at this point in the history
#7662)

* PossibleDeNovo annotation works on VCF without PLs
  • Loading branch information
meganshand committed Feb 8, 2022
1 parent f3ea606 commit 0d4897f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public Map<String, Object> annotate(final ReferenceContext ref,
final List<String> lowConfDeNovoChildren = new ArrayList<>();
for (final Trio trio : trioSet) {
if (vc.isBiallelic() &&
PossibleDeNovo.contextHasTrioLikelihoods(vc, trio) &&
PossibleDeNovo.contextHasTrioGQs(vc, trio) &&
mendelianViolation.isViolation(trio.getMother(), trio.getFather(), trio.getChild(), vc) &&
mendelianViolation.getParentsRefRefChildHet() > 0) {

Expand Down Expand Up @@ -135,14 +135,14 @@ public Map<String, Object> annotate(final ReferenceContext ref,
return attributeMap;
}

private static boolean contextHasTrioLikelihoods(final VariantContext vc, final Trio trio) {
private static boolean contextHasTrioGQs(final VariantContext vc, final Trio trio) {
final String mom = trio.getMaternalID();
final String dad = trio.getPaternalID();
final String kid = trio.getChildID();

return (!mom.isEmpty() && vc.hasGenotype(mom) && vc.getGenotype(mom).hasLikelihoods())
&& (!dad.isEmpty() && vc.hasGenotype(dad) && vc.getGenotype(dad).hasLikelihoods())
&& (!kid.isEmpty() && vc.hasGenotype(kid) && vc.getGenotype(kid).hasLikelihoods());
return (!mom.isEmpty() && vc.hasGenotype(mom) && vc.getGenotype(mom).hasGQ())
&& (!dad.isEmpty() && vc.hasGenotype(dad) && vc.getGenotype(dad).hasGQ())
&& (!kid.isEmpty() && vc.hasGenotype(kid) && vc.getGenotype(kid).hasGQ());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ public Object[][] deNovo() {
tests.add(new Object[]{gNo, gNo, g11, false});
tests.add(new Object[]{gNo, gNo, gNo, false});

final Genotype g00NoPl = new GenotypeBuilder("2", homRef).DP(10).GQ(GQ30).make();
final Genotype g01NoPl = new GenotypeBuilder("1", het).DP(10).GQ(GQ30).make();
final Genotype g11NoPl = new GenotypeBuilder("3", homVar).DP(10).GQ(GQ30).make();

tests.add(new Object[]{g00NoPl, g01NoPl, g11NoPl, false});
tests.add(new Object[]{g00NoPl, g00NoPl, g01NoPl, true});

return tests.toArray(new Object[][]{});
}

Expand Down

0 comments on commit 0d4897f

Please sign in to comment.