Package htsjdk.samtools
Class SamPairUtil.SetMateInfoIterator
- java.lang.Object
-
- htsjdk.samtools.util.PeekableIterator<SAMRecord>
-
- htsjdk.samtools.SamPairUtil.SetMateInfoIterator
-
- All Implemented Interfaces:
CloseableIterator<SAMRecord>
,Closeable
,AutoCloseable
,Iterator<SAMRecord>
- Enclosing class:
- SamPairUtil
public static class SamPairUtil.SetMateInfoIterator extends PeekableIterator<SAMRecord>
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
Constructors Constructor Description SetMateInfoIterator(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getNumMateCigarsAdded()
boolean
hasNext()
True if there are more items, in which case both next() and peek() will return a value.SAMRecord
next()
Returns the next object and advances the iterator.SAMRecord
peek()
Returns the next object but does not advance the iterator.-
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 Detail
-
SetMateInfoIterator
public SetMateInfoIterator(Iterator<SAMRecord> iterator)
By default, the mate cigar tag is set- Parameters:
iterator
- the iterator to wrap
-
SetMateInfoIterator
public SetMateInfoIterator(Iterator<SAMRecord> iterator, boolean setMateCigar)
- 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 Detail
-
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
public SAMRecord next()
Description copied from class:PeekableIterator
Returns the next object and advances the iterator.
-
peek
public SAMRecord 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>
-
-