use of org.broadinstitute.hellbender.utils.pileup.PileupElement in project gatk by broadinstitute.
the class PileupSpark method createVerboseOutput.
private static String createVerboseOutput(final ReadPileup pileup) {
final StringBuilder sb = new StringBuilder();
boolean isFirst = true;
sb.append(pileup.getNumberOfElements(PileupElement::isDeletion));
sb.append(" ");
for (final PileupElement p : pileup) {
if (isFirst) {
isFirst = false;
} else {
sb.append(",");
}
sb.append(p.getRead().getName());
sb.append(VERBOSE_DELIMITER);
sb.append(p.getOffset());
sb.append(VERBOSE_DELIMITER);
sb.append(p.getRead().getLength());
sb.append(VERBOSE_DELIMITER);
sb.append(p.getRead().getMappingQuality());
}
return sb.toString();
}
use of org.broadinstitute.hellbender.utils.pileup.PileupElement in project gatk by broadinstitute.
the class LocusIteratorByStateUnitTest method testIndelLengthAndBasesTest.
@Test(enabled = true, dataProvider = "IndelLengthAndBasesTest")
public void testIndelLengthAndBasesTest(final GATKRead read, final CigarOperator op, final int eventSize, final String eventBases) {
// create the iterator by state with the fake reads and fake records
final LocusIteratorByState li;
li = makeLIBS(Arrays.asList(read), null, false, header);
Assert.assertTrue(li.hasNext());
final PileupElement firstMatch = getFirstPileupElement(li.next());
Assert.assertEquals(firstMatch.getLengthOfImmediatelyFollowingIndel(), 0, "Length != 0 for site not adjacent to indel");
Assert.assertEquals(firstMatch.getBasesOfImmediatelyFollowingInsertion(), null, "Getbases of following event should be null at non-adajenct event");
Assert.assertTrue(li.hasNext());
final PileupElement pe = getFirstPileupElement(li.next());
if (op == CigarOperator.D)
Assert.assertTrue(pe.isBeforeDeletionStart());
else
Assert.assertTrue(pe.isBeforeInsertion());
Assert.assertEquals(pe.getLengthOfImmediatelyFollowingIndel(), eventSize, "Length of event failed");
Assert.assertEquals(pe.getBasesOfImmediatelyFollowingInsertion(), eventBases, "Getbases of following event failed");
}
Aggregations