Package htsjdk.samtools
Class CRAMIterator
java.lang.Object
htsjdk.samtools.CRAMIterator
- All Implemented Interfaces:
SAMRecordIterator,CloseableIterator<SAMRecord>,Closeable,AutoCloseable,Iterator<SAMRecord>
-
Constructor Summary
ConstructorsConstructorDescriptionCRAMIterator(SeekableStream seekableStream, CRAMReferenceSource referenceSource, ValidationStringency validationStringency, QueryInterval[] queryIntervals, long[] coordinates) CRAMIterator(InputStream inputStream, CRAMReferenceSource referenceSource, ValidationStringency validationStringency) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadvanceToAlignmentInContainer(int refIndex, int pos) Skip cached records until given alignment start position.assertSorted(SAMFileHeader.SortOrder sortOrder) Establishes that records returned by this iterator are expected to be in the specified sort order.voidclose()Should be implemented to close/release any underlying resources.longbooleanhasNext()next()voidremove()voidsetFileSource(SamReader mReader) voidsetValidationStringency(ValidationStringency validationStringency) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface htsjdk.samtools.util.CloseableIterator
stream, toListMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
CRAMIterator
public CRAMIterator(InputStream inputStream, CRAMReferenceSource referenceSource, ValidationStringency validationStringency) -
CRAMIterator
public CRAMIterator(SeekableStream seekableStream, CRAMReferenceSource referenceSource, ValidationStringency validationStringency, QueryInterval[] queryIntervals, long[] coordinates)
-
-
Method Details
-
advanceToAlignmentInContainer
public boolean advanceToAlignmentInContainer(int refIndex, int pos) Skip cached records until given alignment start position.- Parameters:
refIndex- reference sequence indexpos- alignment start to skip to
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
close
public void close()Description copied from interface:CloseableIteratorShould be implemented to close/release any underlying resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<SAMRecord>
-
getFirstContainerOffset
public long getFirstContainerOffset() -
assertSorted
Description copied from interface:SAMRecordIteratorEstablishes that records returned by this iterator are expected to be in the specified sort order. If this method has been called, then implementers must throw an IllegalStateException from next() when a record is read that violates the sort order. This method may be called multiple times over the course of an iteration, changing the expected sort, if desired -- from the time it is called, it validates whatever sort is set, or stops validating if it is set to null or SAMFileHeader.SortOrder.unsorted. If this method is not called, then no validation of the iterated records is done.- Specified by:
assertSortedin interfaceSAMRecordIterator- Parameters:
sortOrder- The order in which records are expected to be returned- Returns:
- This SAMRecordIterator
-
getCramHeader
-
getValidationStringency
-
setValidationStringency
-
getFileSource
-
setFileSource
-
getSAMFileHeader
-