Skip to content

Commit

Permalink
Merge pull request #19 from molgenis/fix/compoundCheckNull
Browse files Browse the repository at this point in the history
Fix #20: ARCompoundChecker throws exception if individual from ped is not in the VCF
  • Loading branch information
dennishendriksen authored Feb 18, 2022
2 parents 3e35f07 + 22d1e63 commit 3608b06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ private boolean checkIndividual(VariantContext variantContext, VariantContext ot
}

private boolean checkUnaffectedSample(Genotype sampleGt, Genotype sampleOtherGt) {
if(sampleGt == null || sampleOtherGt == null){
return true;
}
boolean sampleContainsAlt = !sampleGt.getAlleles().stream()
.allMatch(allele -> allele.isReference() || allele
.isNoCall());
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/ArCompoundTests.tsv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name probandGt probandOtherGt probandAffectedStatus probandSex fatherGt fatherOtherGt fatherAffectedStatus motherGt motherOtherGt motherAffectedStatus brotherGt brotherOtherGt brotherAffectedStatus expected
regular 0/1 0/1 AFFECTED MALE 0/0 0/1 UNAFFECTED 0/1 0/0 UNAFFECTED true
regularBrotherMissingFromVcf 0/1 0/1 AFFECTED MALE 0/0 0/1 UNAFFECTED 0/1 0/0 UNAFFECTED UNAFFECTED true
regularPhased 1|0 0|1 AFFECTED MALE 0|0 0|1 UNAFFECTED 0|1 0|0 UNAFFECTED true
FatherUnaffectedHasBoth 1/0 0/1 AFFECTED MALE 0/1 0/1 UNAFFECTED 0/1 0/0 UNAFFECTED false
phasedFatherBothSameAllele 1|0 0|1 AFFECTED MALE 0|1 0|1 UNAFFECTED 0|1 0|0 UNAFFECTED true
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/pedigree_complex.ped
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FAM001 Patient Father Mother 1 2
FAM001 Father 0 0 1 1
FAM001 Mother 0 0 2 1
FAM001 Mother 0 Mother3 2 1
FAM001 Mother3 0 0 2 1
FAM002 Patient2 Father2 0 1 2
FAM002 Father2 0 0 1 1
FAM003 Patient3 0 0 1 2

0 comments on commit 3608b06

Please sign in to comment.