use of org.broadinstitute.hellbender.utils.codecs.sampileup.SAMPileupFeature in project gatk by broadinstitute.
the class CheckPileup method apply.
@Override
public void apply(final AlignmentContext context, final ReferenceContext ref, final FeatureContext featureContext) {
final ReadPileup pileup = context.getBasePileup();
final SAMPileupFeature truePileup = getTruePileup(featureContext);
if (!ignoreOverlaps) {
pileup.fixOverlaps();
}
if (truePileup == null) {
out.printf("No truth pileup data available at %s%n", pileup.getPileupString((char) ref.getBase()));
if (!continueAfterAnError) {
throw new UserException.BadInput(String.format("No pileup data available at %s given GATK's output of %s -- this walker requires samtools mpileup data over all bases", context.getLocation(), new String(pileup.getBases())));
}
} else {
final String pileupDiff = pileupDiff(pileup, truePileup);
if (pileupDiff != null) {
out.printf("%s vs. %s%n", pileup.getPileupString((char) ref.getBase()), truePileup.getPileupString());
if (!continueAfterAnError) {
throw new UserException.BadInput(String.format("The input pileup doesn't match the GATK's internal pileup: %s", pileupDiff));
}
}
}
nLoci++;
nBases += pileup.size();
}
Aggregations