boolean showDuplicates = PreferenceManager.getInstance().getAsBoolean(PreferenceManager.SAM_SHOW_DUPLICATES);
int qualityThreshold = PreferenceManager.getInstance().getAsInt(PreferenceManager.SAM_QUALITY_THRESHOLD);
if (!rec.isMapped() || (!showDuplicates && rec.isDuplicate()) ||
(filterFailedReads && rec.isVendorFailedRead()) ||
rec.getMappingQuality() < qualityThreshold ||
(filter != null && filter.filterAlignment(rec))) {
continue;
}
expectedResult.add(rec);
//System.out.println("name: " + rec.getReadName() + "strt: " + rec.getStart() + " end: " + rec.getEnd());