diff --git a/src/main/java/com/github/discvrseq/walkers/ExtendedMultiVariantWalkerGroupedOnStart.java b/src/main/java/com/github/discvrseq/walkers/ExtendedMultiVariantWalkerGroupedOnStart.java index 57a9e06f..3239b121 100644 --- a/src/main/java/com/github/discvrseq/walkers/ExtendedMultiVariantWalkerGroupedOnStart.java +++ b/src/main/java/com/github/discvrseq/walkers/ExtendedMultiVariantWalkerGroupedOnStart.java @@ -1,6 +1,7 @@ package com.github.discvrseq.walkers; import htsjdk.variant.variantcontext.VariantContext; +import htsjdk.variant.variantcontext.VariantContextComparator; import org.broadinstitute.hellbender.engine.FeatureInput; import org.broadinstitute.hellbender.engine.MultiVariantWalkerGroupedOnStart; @@ -34,6 +35,9 @@ protected Map, List> groupVariantsB if (!byFeatureInput.containsKey(fi)) { byFeatureInput.put(fi, Collections.emptyList()); } + else { + byFeatureInput.get(fi).sort(new VariantContextComparator(getBestAvailableSequenceDictionary())); + } } return byFeatureInput; diff --git a/src/main/java/com/github/discvrseq/walkers/annotator/MendelianViolationCount.java b/src/main/java/com/github/discvrseq/walkers/annotator/MendelianViolationCount.java index 6a017696..09108f9a 100644 --- a/src/main/java/com/github/discvrseq/walkers/annotator/MendelianViolationCount.java +++ b/src/main/java/com/github/discvrseq/walkers/annotator/MendelianViolationCount.java @@ -19,6 +19,7 @@ import org.broadinstitute.hellbender.utils.samples.Sex; import javax.annotation.Nullable; +import java.io.Serial; import java.util.*; /** @@ -161,6 +162,10 @@ public boolean isViolation(){ } private static boolean testParents(Genotype gChild, Genotype gDad, Genotype gMom){ + if (gChild.getAlleles().size() != 2) { + return false; + } + return !(gMom.getAlleles().contains(gChild.getAlleles().get(0)) && gDad.getAlleles().contains(gChild.getAlleles().get(1)) || gMom.getAlleles().contains(gChild.getAlleles().get(1)) && gDad.getAlleles().contains(gChild.getAlleles().get(0))); } @@ -182,10 +187,11 @@ public List getDescriptions() { return Arrays.asList( } public static class NoCallGenotype extends Genotype { + @Serial private static final long serialVersionUID = 1L; private Genotype _orig = null; - private List _alleles = Arrays.asList(Allele.NO_CALL, Allele.NO_CALL); + private final List _alleles = Arrays.asList(Allele.NO_CALL, Allele.NO_CALL); public NoCallGenotype(String sampleName) {