Package htsjdk.samtools

# Class SRAFileReader

java.lang.Object
htsjdk.samtools.SamReader.ReaderImplementation
htsjdk.samtools.SRAFileReader

All Implemented Interfaces:
  `SamReader.Indexing`, `SamReader.PrimitiveSamReader`

public class SRAFileReader extends SamReader.ReaderImplementation implements SamReader.Indexing

## Constructor Summary

Constructors
Constructor
Description
`SRAFileReader(SRAAccession acc)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`BrowseableBAMIndex`
`getBrowseableIndex()`
Gets an index tagged with the BrowseableBAMIndex interface.
`SAMFileHeader`
`getFileHeader()`
`SAMFileSpan`
`getFilePointerSpanningReads()`
Gets a pointer spanning all reads in the BAM file.
`BAMIndex`
`getIndex()`
Retrieves the index for the given file type.
`CloseableIterator<SAMRecord>`
`getIterator()`
`CloseableIterator<SAMRecord>`
`getIterator(SAMFileSpan chunks)`
`protected SRAIterator.RecordRangeInfo`
`getRecordsRangeInfo()`
`ValidationStringency`
`getValidationStringency()`
`boolean`
`hasBrowseableIndex()`
Returns true if the supported index is browseable, meaning the bins in it can be traversed and chunk data inspected and retrieved.
`boolean`
`hasIndex()`
`SAMRecordIterator`
`iterator(SAMFileSpan chunks)`
Iterate through the given chunks in the file.
`CloseableIterator<SAMRecord>`
`query(QueryInterval[] intervals, boolean contained)`
`CloseableIterator<SAMRecord>`
`queryAlignmentStart(String sequence, int start)`
`CloseableIterator<SAMRecord>`
`queryUnmapped()`
`SamReader.Type`
`type()`

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

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

### Methods inherited from interface htsjdk.samtools.SamReader.PrimitiveSamReader

`isQueryable`

## Constructor Details

### SRAFileReader

public SRAFileReader(SRAAccession acc)

## Method Details

### type

public SamReader.Type type()

Specified by:
  `type` in interface `SamReader.PrimitiveSamReader`

### hasIndex

public boolean hasIndex()

Specified by:
  `hasIndex` in interface `SamReader.PrimitiveSamReader`

### getIndex

public BAMIndex getIndex()
Description copied from interface: `SamReader.Indexing`
Retrieves the index for the given file type. Ensure that the index is of the specified type.

Specified by:
  `getIndex` in interface `SamReader.Indexing`
Specified by:
  `getIndex` in interface `SamReader.PrimitiveSamReader`
Returns:
  An index of the given type.

### getFileHeader

public SAMFileHeader getFileHeader()

Specified by:
  `getFileHeader` in interface `SamReader.PrimitiveSamReader`

### getIterator

public CloseableIterator<SAMRecord> getIterator()

Specified by:
  `getIterator` in interface `SamReader.PrimitiveSamReader`

### getIterator

public CloseableIterator<SAMRecord> getIterator(SAMFileSpan chunks)

Specified by:
  `getIterator` in interface `SamReader.PrimitiveSamReader`

### getFilePointerSpanningReads

public SAMFileSpan getFilePointerSpanningReads()
Description copied from interface: `SamReader.Indexing`
Gets a pointer spanning all reads in the BAM file.

Specified by:
  `getFilePointerSpanningReads` in interface `SamReader.Indexing`
Specified by:
  `getFilePointerSpanningReads` in interface `SamReader.PrimitiveSamReader`
Returns:
  Unbounded pointer to the first record, in chunk format.

### query

public CloseableIterator<SAMRecord> query(QueryInterval[] intervals, boolean contained)

Specified by:
  `query` in interface `SamReader.PrimitiveSamReader`

### queryAlignmentStart

public CloseableIterator<SAMRecord> queryAlignmentStart(String sequence, int start)

Specified by:
  `queryAlignmentStart` in interface `SamReader.PrimitiveSamReader`

### queryUnmapped

public CloseableIterator<SAMRecord> queryUnmapped()

Specified by:
  `queryUnmapped` in interface `SamReader.PrimitiveSamReader`

### close

public void close()

Specified by:
  `close` in interface `SamReader.PrimitiveSamReader`

### getValidationStringency

public ValidationStringency getValidationStringency()

Specified by:
  `getValidationStringency` in interface `SamReader.PrimitiveSamReader`

### hasBrowseableIndex

public boolean hasBrowseableIndex()
Returns true if the supported index is browseable, meaning the bins in it can be traversed and chunk data inspected and retrieved.

Specified by:
  `hasBrowseableIndex` in interface `SamReader.Indexing`
Returns:
  True if the index supports the BrowseableBAMIndex interface. False otherwise.

### getBrowseableIndex

public BrowseableBAMIndex getBrowseableIndex()
Gets an index tagged with the BrowseableBAMIndex interface. Throws an exception if no such index is available.

Specified by:
  `getBrowseableIndex` in interface `SamReader.Indexing`
Returns:
  An index with a browseable interface, if possible.
Throws:
  `SAMException` - if no such index is available.

### iterator

public SAMRecordIterator iterator(SAMFileSpan chunks)
Iterate through the given chunks in the file.

Specified by:
  `iterator` in interface `SamReader.Indexing`
Parameters:
  `chunks` - List of chunks for which to retrieve data.
Returns:
  An iterator over the given chunks.

### getRecordsRangeInfo

protected SRAIterator.RecordRangeInfo getRecordsRangeInfo()