for ( int trimStop = trimStart; trimStop <= loc.getStop(); trimStop++ ) {
final int start = trimStart - loc.getStart();
final int stop = start + (trimStop - trimStart) + 1;
final GenomeLoc trimmedLoc = new UnvalidatingGenomeLoc("20", 0, start + loc.getStart(), stop + loc.getStart() - 1);
final String expectedBases = fullBases.substring(start, stop);
final Haplotype full = new Haplotype(fullBases.getBytes(), loc);
final Haplotype trimmed = new Haplotype(expectedBases.getBytes(), trimmedLoc);
final int hapStart = 10;
full.setAlignmentStartHapwrtRef(hapStart);
full.setCigar(TextCigarCodec.getSingleton().decode(full.length() + "M"));
trimmed.setAlignmentStartHapwrtRef(hapStart + start);
trimmed.setCigar(TextCigarCodec.getSingleton().decode(trimmed.length() + "M"));
tests.add(new Object[]{full, trimmedLoc, trimmed});
}
}
final Haplotype full = new Haplotype("ACT".getBytes(), new UnvalidatingGenomeLoc("20", 0, 10, 14));
full.setAlignmentStartHapwrtRef(10);
full.setCigar(TextCigarCodec.getSingleton().decode("1M2D2M"));
tests.add(new Object[]{full, new UnvalidatingGenomeLoc("20", 0, 11, 12), null});
tests.add(new Object[]{full, new UnvalidatingGenomeLoc("20", 0, 10, 12), null});
tests.add(new Object[]{full, new UnvalidatingGenomeLoc("20", 0, 11, 13), null});
return tests.toArray(new Object[][]{});