Package htsjdk.samtools

# Class DuplicateSetIterator

java.lang.Object
htsjdk.samtools.DuplicateSetIterator

All Implemented Interfaces:
  `CloseableIterator<DuplicateSet>`, `Closeable`, `AutoCloseable`, `Iterator<DuplicateSet>`

public class DuplicateSetIterator extends Object implements CloseableIterator<DuplicateSet>
An iterator of sets of duplicates. Duplicates are defined currently by the ordering in SAMRecordDuplicateComparator.

If the input records are not pre-sorted according to the duplicate ordering, the records will be sorted on-the-fly. This may require extra memory or disk to buffer records, and also computational time to perform the sorting.

## Constructor Summary

Constructors
Constructor
Description
`DuplicateSetIterator(CloseableIterator<SAMRecord> iterator, SAMFileHeader header)`
`DuplicateSetIterator(CloseableIterator<SAMRecord> iterator, SAMFileHeader header, boolean preSorted)`
`DuplicateSetIterator(CloseableIterator<SAMRecord> iterator, SAMFileHeader header, boolean preSorted, SAMRecordDuplicateComparator comparator)`
`DuplicateSetIterator(CloseableIterator<SAMRecord> iterator, SAMFileHeader header, boolean preSorted, SAMRecordDuplicateComparator comparator, Log log)`
Allows the user of this iterator to skip the sorting of the input if the input is already sorted.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Should be implemented to close/release any underlying resources.
`boolean`
`hasNext()`
`DuplicateSet`
`next()`
`void`
`remove()`
`void`
`setScoringStrategy(DuplicateScoringStrategy.ScoringStrategy scoringStrategy)`
Deprecated.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface htsjdk.samtools.util.CloseableIterator

`stream, toList`

### Methods inherited from interface java.util.Iterator

`forEachRemaining`

## Constructor Details

### DuplicateSetIterator

public DuplicateSetIterator(CloseableIterator<SAMRecord> iterator, SAMFileHeader header)

### DuplicateSetIterator

public DuplicateSetIterator(CloseableIterator<SAMRecord> iterator, SAMFileHeader header, boolean preSorted)

### DuplicateSetIterator

public DuplicateSetIterator(CloseableIterator<SAMRecord> iterator, SAMFileHeader header, boolean preSorted, SAMRecordDuplicateComparator comparator)

### DuplicateSetIterator

public DuplicateSetIterator(CloseableIterator<SAMRecord> iterator, SAMFileHeader header, boolean preSorted, SAMRecordDuplicateComparator comparator, Log log)
Allows the user of this iterator to skip the sorting of the input if the input is already sorted. If the records are said to be sorted but not actually sorted in the correct order, an exception during iteration will be thrown. Progress information will be printed for sorting of the input if `log` is provided.

## Method Details

### setScoringStrategy

@Deprecated public void setScoringStrategy(DuplicateScoringStrategy.ScoringStrategy scoringStrategy)
Deprecated.

### next

public DuplicateSet next()

Specified by:
  `next` in interface `Iterator<DuplicateSet>`

### close

public void close()
Description copied from interface: `CloseableIterator`
Should be implemented to close/release any underlying resources.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `CloseableIterator<DuplicateSet>`

### hasNext

public boolean hasNext()

Specified by:
  `hasNext` in interface `Iterator<DuplicateSet>`

### remove

public void remove()

Specified by:
  `remove` in interface `Iterator<DuplicateSet>`