Package htsjdk.samtools
Class SamPairUtil.SetMateInfoIterator
- All Implemented Interfaces:
CloseableIterator<SAMRecord>
,Closeable
,AutoCloseable
,Iterator<SAMRecord>
- Enclosing class:
- SamPairUtil
A class to iterate through SAMRecords and set mate information on the given records, and optionally
set the mate cigar tag (true by default).
-
Constructor Summary
ConstructorDescriptionSetMateInfoIterator
(Iterator<SAMRecord> iterator) By default, the mate cigar tag is setSetMateInfoIterator
(Iterator<SAMRecord> iterator, boolean setMateCigar) SetMateInfoIterator
(Iterator<SAMRecord> iterator, boolean setMateCigar, boolean ignoreMissingMates) -
Method Summary
Methods inherited from class htsjdk.samtools.util.PeekableIterator
close, remove
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
-
SetMateInfoIterator
By default, the mate cigar tag is set- Parameters:
iterator
- the iterator to wrap
-
SetMateInfoIterator
- Parameters:
iterator
- the iterator to wrapsetMateCigar
- true if we are to update/create the Mate CIGAR (MC) optional tag, false if we are to clear any mate cigar tag that is present.
-
SetMateInfoIterator
public SetMateInfoIterator(Iterator<SAMRecord> iterator, boolean setMateCigar, boolean ignoreMissingMates) - Parameters:
iterator
- the iterator to wrapsetMateCigar
- true if we are to update/create the Mate CIGAR (MC) optional tag, false if we are to clear any mate cigar tag that is present.ignoreMissingMates
- set this to true if we are to ignore missing mates, otherwise an exception will be thrown when a missing mate is encountered
-
-
Method Details
-
getNumMateCigarsAdded
public long getNumMateCigarsAdded()- Returns:
- the current number of mate cigars added. This could be more than the number of records returned.
-
hasNext
public boolean hasNext()Description copied from class:PeekableIterator
True if there are more items, in which case both next() and peek() will return a value. -
next
Description copied from class:PeekableIterator
Returns the next object and advances the iterator. -
peek
Description copied from class:PeekableIterator
Returns the next object but does not advance the iterator. Subsequent calls to peek() and next() will return the same object.- Overrides:
peek
in classPeekableIterator<SAMRecord>
-