Skip to content

Commit

Permalink
fixed edge cases where SomaticValidator counts reads ending inside th…
Browse files Browse the repository at this point in the history
…e reference allele as alts
  • Loading branch information
davidbenjamin committed Oct 18, 2018
1 parent 6d25f29 commit 1858eb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.broadinstitute.hellbender.utils.read.GATKRead;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.OptionalInt;
Expand Down Expand Up @@ -435,7 +436,10 @@ public static Allele chooseAlleleForRead(final PileupElement pileupElement, fina
Utils.nonNull(altAlleles);
ParamUtils.isPositiveOrZero(minBaseQualityCutoff, "Minimum base quality must be positive or zero.");

final boolean isRef = referenceAllele.basesMatch(getBasesForAlleleInRead(pileupElement, referenceAllele))
final byte[] basesForAlleleInRead = getBasesForAlleleInRead(pileupElement, referenceAllele);
final byte[] refBasesTruncatedToRead = ArrayUtils.subarray(referenceAllele.getBases(), 0, basesForAlleleInRead.length);

final boolean isRef = Arrays.equals(basesForAlleleInRead, refBasesTruncatedToRead)
&& !pileupElement.isBeforeDeletionStart() && !pileupElement.isBeforeInsertion();

Allele pileupAllele = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ public void testIndelCase() {
// INS2: 20 3076299 . A AAGAAGCATGC

assertValidationResult(variantValidationResults, new SimpleInterval("20", 1330646, 1330646),
"CCTTGGCTTATTCCA", "C", 7, 21, 10,
"CCTTGGCTTATTCCA", "C", 7, 22, 10,
26, 0);

// TODO: This next one actually has an incorrect gtNumAltReadsInValidationNormal, since the validator thinks of this as AT<insT>. There are supporting reads in the validation normal for A<insT>T. See https://github.com/broadinstitute/gatk/issues/5061
assertValidationResult(variantValidationResults, new SimpleInterval("20", 3076247, 3076247),
"AT", "ATT", 4, 33, 4,
"AT", "ATT", 4, 35, 4,
25,0);
assertValidationResult(variantValidationResults, new SimpleInterval("20", 3076299, 3076299),
"A", "AAGAAGCATGC", 9, 41, 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ public Object[][] createTestDeletions() {
{0, "ATT", "A", true},
{0, "ATT", "A", false},
{10, "ATT", "A", true},
{10, "ATT", "A", false}
{10, "ATT", "A", false},
{LENGTH_OF_ARTIFICIAL_READ - 1, "AT", "A", false}
};
}

Expand Down

0 comments on commit 1858eb3

Please sign in to comment.