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:
Eric Banks 2012-07-31 15:37:22 -04:00
parent fff78ab462
commit 10111450aa
2 changed files with 19 additions and 8 deletions

View File

@ -476,7 +476,6 @@ public class AlignmentUtils {
}
break;
case D:
case N:
if (!isDeletion) {
alignmentPos += elementLength;
} else {
@ -498,6 +497,7 @@ public class AlignmentUtils {
break;
case H:
case P:
case N:
break;
default:
throw new ReviewedStingException("Unsupported cigar operator: " + ce.getOperator());
@ -516,16 +516,13 @@ public class AlignmentUtils {
final int elementLength = ce.getLength();
switch (ce.getOperator()) {
case I:
case S:
break;
case D:
case N:
alignmentLength += elementLength;
break;
case M:
alignmentLength += elementLength;
break;
case I:
case S:
case H:
case P:
break;

View File

@ -373,13 +373,13 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
// --------------------------------------------------------------------------------------------------------------
//
// testing SnpEff
// testing MinIndelFraction
//
// --------------------------------------------------------------------------------------------------------------
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";
@Test
public void testMinIndelFraction0() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
@ -403,4 +403,18 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
Arrays.asList("3f07efb768e08650a7ce333edd4f9a52"));
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);
}
}