Merge pull request #119 from broadinstitute/md_assessn12878_bugfixes

AssessNA12878 bugfixes
This commit is contained in:
Ryan Poplin 2013-03-19 05:11:50 -07:00
commit c813259283
2 changed files with 10 additions and 1 deletions

View File

@ -1000,7 +1000,7 @@ public class GATKVariantContextUtils {
public static VariantContext trimAlleles(final VariantContext inputVC, final boolean trimForward, final boolean trimReverse) {
if ( inputVC == null ) throw new IllegalArgumentException("inputVC cannot be null");
if ( inputVC.getNAlleles() <= 1 )
if ( inputVC.getNAlleles() <= 1 || inputVC.isSNP() )
return inputVC;
// see whether we need to trim common reference base from all alleles

View File

@ -694,6 +694,15 @@ public class GATKVariantContextUtilsUnitTest extends BaseTest {
root.alleles(Arrays.asList(CAref, C)).stop(11).make(),
root.alleles(Arrays.asList(CAAAref, C)).stop(13).make())});
final Allele threeCopies = Allele.create("GTTTTATTTTATTTTA", true);
final Allele twoCopies = Allele.create("GTTTTATTTTA", true);
final Allele zeroCopies = Allele.create("G", false);
final Allele oneCopies = Allele.create("GTTTTA", false);
tests.add(new Object[]{root.alleles(Arrays.asList(threeCopies, zeroCopies, oneCopies)).stop(25).make(),
Arrays.asList(
root.alleles(Arrays.asList(threeCopies, zeroCopies)).stop(25).make(),
root.alleles(Arrays.asList(twoCopies, zeroCopies)).stop(20).make())});
return tests.toArray(new Object[][]{});
}