Fixed AlignmentUtils bug for handling Ns in the CIGAR string. Added a UG integration test that calls a BAM with such reads (provided by a user on GetSatisfaction).
This commit is contained in:
parent
fff78ab462
commit
10111450aa
|
|
@ -476,7 +476,6 @@ public class AlignmentUtils {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case D:
|
case D:
|
||||||
case N:
|
|
||||||
if (!isDeletion) {
|
if (!isDeletion) {
|
||||||
alignmentPos += elementLength;
|
alignmentPos += elementLength;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -498,6 +497,7 @@ public class AlignmentUtils {
|
||||||
break;
|
break;
|
||||||
case H:
|
case H:
|
||||||
case P:
|
case P:
|
||||||
|
case N:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ReviewedStingException("Unsupported cigar operator: " + ce.getOperator());
|
throw new ReviewedStingException("Unsupported cigar operator: " + ce.getOperator());
|
||||||
|
|
@ -516,16 +516,13 @@ public class AlignmentUtils {
|
||||||
final int elementLength = ce.getLength();
|
final int elementLength = ce.getLength();
|
||||||
|
|
||||||
switch (ce.getOperator()) {
|
switch (ce.getOperator()) {
|
||||||
case I:
|
|
||||||
case S:
|
|
||||||
break;
|
|
||||||
case D:
|
case D:
|
||||||
case N:
|
case N:
|
||||||
alignmentLength += elementLength;
|
|
||||||
break;
|
|
||||||
case M:
|
case M:
|
||||||
alignmentLength += elementLength;
|
alignmentLength += elementLength;
|
||||||
break;
|
break;
|
||||||
|
case I:
|
||||||
|
case S:
|
||||||
case H:
|
case H:
|
||||||
case P:
|
case P:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -373,13 +373,13 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// testing SnpEff
|
// testing MinIndelFraction
|
||||||
//
|
//
|
||||||
// --------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
final static String assessMinIndelFraction = baseCommandIndelsb37 + " -I " + validationDataLocation
|
final static String assessMinIndelFraction = baseCommandIndelsb37 + " -I " + validationDataLocation
|
||||||
+ "978604.bam -L 1:978,586-978,626 -o %s --sites_only -rf Sample -goodSM 7377 -goodSM 22-0022 -goodSM 134 -goodSM 344029-53 -goodSM 14030";
|
+ "978604.bam -L 1:978,586-978,626 -o %s --sites_only -rf Sample -goodSM 7377 -goodSM 22-0022 -goodSM 134 -goodSM 344029-53 -goodSM 14030";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMinIndelFraction0() {
|
public void testMinIndelFraction0() {
|
||||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||||
|
|
@ -403,4 +403,18 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
||||||
Arrays.asList("3f07efb768e08650a7ce333edd4f9a52"));
|
Arrays.asList("3f07efb768e08650a7ce333edd4f9a52"));
|
||||||
executeTest("test minIndelFraction 1.0", spec);
|
executeTest("test minIndelFraction 1.0", spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// testing Ns in CIGAR
|
||||||
|
//
|
||||||
|
// --------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testNsInCigar() {
|
||||||
|
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||||
|
baseCommand + " -I " + validationDataLocation + "testWithNs.bam", 1,
|
||||||
|
Arrays.asList("22c9fd65ce3298bd7fbf400c9c209f29"));
|
||||||
|
executeTest("test calling on reads with Ns in CIGAR", spec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue