final boolean skipPairsWithNoMateCigar,
final int maxRecordsInRam,
final int blockSize,
final List<File> tmpDirs) throws PicardException {
if (header.getSortOrder() != SAMFileHeader.SortOrder.coordinate) {
throw new PicardException(getClass().getName() + " expects the input to be in coordinate sort order.");
}
this.header = header;
backingIterator = new PeekableIterator<SAMRecord>(iterator);
outputBuffer = new SamRecordTrackingBuffer<SamRecordWithOrdinalAndSetDuplicateReadFlag>(maxRecordsInRam, blockSize, tmpDirs, header, SamRecordWithOrdinalAndSetDuplicateReadFlag.class);
this.removeDuplicates = removeDuplicates;
this.skipPairsWithNoMateCigar = skipPairsWithNoMateCigar;
this.opticalDuplicateFinder = opticalDuplicateFinder;
toMarkQueue = new MarkQueue(duplicateScoringStrategy);
libraryIdGenerator = new LibraryIdGenerator(header);
// Check for supported scoring strategies
if (duplicateScoringStrategy == ScoringStrategy.SUM_OF_BASE_QUALITIES)
throw new PicardException("SUM_OF_BASE_QUALITIES not supported as this may cause inconsistencies across ends in a pair. Please use a different scoring strategy.");
// set up metrics
for (final SAMReadGroupRecord readGroup : header.getReadGroups()) {
final String library = readGroup.getLibrary();
DuplicationMetrics metrics = libraryIdGenerator.getMetricsByLibrary(library);