CramHeader cramHeader = iterator.getCramHeader();
iterator.close();
ProgressLogger progress = new ProgressLogger(log, 100000,
"Validated Read");
SamFileValidator v = new SamFileValidator(new PrintWriter(System.out),
1);
List<SAMValidationError.Type> errors = new ArrayList<SAMValidationError.Type>();
errors.add(Type.MATE_NOT_FOUND);
// errors.add(Type.MISSING_TAG_NM);
v.setErrorsToIgnore(errors);
v.init(referenceSequenceFile, cramHeader.samFileHeader);
v.validateSamRecords(new SAMIterator.CramFileIterable(
params.cramFile, referenceSequenceFile),
cramHeader.samFileHeader);
log.info("Elapsed seconds: " + progress.getElapsedSeconds());
}