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
All Methods Instance Methods Concrete Methods 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 Detail
-
SRAFileReader
public SRAFileReader(SRAAccession acc)
-
-
Method Detail
-
type
public SamReader.Type type()
- Specified by:
type
in interfaceSamReader.PrimitiveSamReader
-
hasIndex
public boolean hasIndex()
- Specified by:
hasIndex
in interfaceSamReader.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 interfaceSamReader.Indexing
- Specified by:
getIndex
in interfaceSamReader.PrimitiveSamReader
- Returns:
- An index of the given type.
-
getFileHeader
public SAMFileHeader getFileHeader()
- Specified by:
getFileHeader
in interfaceSamReader.PrimitiveSamReader
-
getIterator
public CloseableIterator<SAMRecord> getIterator()
- Specified by:
getIterator
in interfaceSamReader.PrimitiveSamReader
-
getIterator
public CloseableIterator<SAMRecord> getIterator(SAMFileSpan chunks)
- Specified by:
getIterator
in interfaceSamReader.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 interfaceSamReader.Indexing
- Specified by:
getFilePointerSpanningReads
in interfaceSamReader.PrimitiveSamReader
- Returns:
- Unbounded pointer to the first record, in chunk format.
-
query
public CloseableIterator<SAMRecord> query(QueryInterval[] intervals, boolean contained)
- Specified by:
query
in interfaceSamReader.PrimitiveSamReader
-
queryAlignmentStart
public CloseableIterator<SAMRecord> queryAlignmentStart(String sequence, int start)
- Specified by:
queryAlignmentStart
in interfaceSamReader.PrimitiveSamReader
-
queryUnmapped
public CloseableIterator<SAMRecord> queryUnmapped()
- Specified by:
queryUnmapped
in interfaceSamReader.PrimitiveSamReader
-
close
public void close()
- Specified by:
close
in interfaceSamReader.PrimitiveSamReader
-
getValidationStringency
public ValidationStringency getValidationStringency()
- Specified by:
getValidationStringency
in interfaceSamReader.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 interfaceSamReader.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 interfaceSamReader.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 interfaceSamReader.Indexing
- Parameters:
chunks
- List of chunks for which to retrieve data.- Returns:
- An iterator over the given chunks.
-
getRecordsRangeInfo
protected SRAIterator.RecordRangeInfo getRecordsRangeInfo()
-
-