Package htsjdk.samtools.sra

# Class SRAIndexedSequenceFile

java.lang.Object
htsjdk.samtools.sra.SRAIndexedSequenceFile

All Implemented Interfaces:
  `ReferenceSequenceFile`, `Closeable`, `AutoCloseable`

public class SRAIndexedSequenceFile extends Object implements ReferenceSequenceFile
Allows reading Reference data from SRA

## Field Summary

Fields
Modifier and Type
Field
Description
`protected SAMSequenceDictionary`
`sequenceDictionary`

## Constructor Summary

Constructors
Constructor
Description
`SRAIndexedSequenceFile(SRAAccession acc)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`ReferenceSequence`
`getSequence(String contig)`
Retrieves the complete sequence described by this contig.
`SAMSequenceDictionary`
`getSequenceDictionary()`
Must return a sequence dictionary with at least the following fields completed for each sequence: name, length.
`ReferenceSequence`
`getSubsequenceAt(String contig, long start, long stop)`
Gets the subsequence of the contig in the range [start,stop]
`boolean`
`isIndexed()`
`protected SAMSequenceDictionary`
`loadSequenceDictionary()`
`ReferenceSequence`
`nextSequence()`
Retrieves the next whole sequences from the file.
`void`
`reset()`
Resets the ReferenceSequenceFile so that the next call to nextSequence() will return the first sequence in the file.

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

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

### Methods inherited from interface htsjdk.samtools.reference.ReferenceSequenceFile

`getSubsequenceAt, toString`

## Field Details

### sequenceDictionary

protected SAMSequenceDictionary sequenceDictionary

## Constructor Details

### SRAIndexedSequenceFile

public SRAIndexedSequenceFile(SRAAccession acc)

Parameters:
  `acc` - accession

## Method Details

### getSequenceDictionary

public SAMSequenceDictionary getSequenceDictionary()
Description copied from interface: `ReferenceSequenceFile`
Must return a sequence dictionary with at least the following fields completed for each sequence: name, length.

Specified by:
  `getSequenceDictionary` in interface `ReferenceSequenceFile`
Returns:
  a list of sequence records representing the sequences in this reference file

### nextSequence

public ReferenceSequence nextSequence()
Description copied from interface: `ReferenceSequenceFile`
Retrieves the next whole sequences from the file.

Specified by:
  `nextSequence` in interface `ReferenceSequenceFile`
Returns:
  a ReferenceSequence or null if at the end of the file

### reset

public void reset()
Description copied from interface: `ReferenceSequenceFile`
Resets the ReferenceSequenceFile so that the next call to nextSequence() will return the first sequence in the file.

Specified by:
  `reset` in interface `ReferenceSequenceFile`

### isIndexed

public boolean isIndexed()

Specified by:
  `isIndexed` in interface `ReferenceSequenceFile`
Returns:
  true if getSequence and getSubsequenceAt methods are allowed.

### getSequence

public ReferenceSequence getSequence(String contig)
Description copied from interface: `ReferenceSequenceFile`
Retrieves the complete sequence described by this contig.

Specified by:
  `getSequence` in interface `ReferenceSequenceFile`
Parameters:
  `contig` - contig whose data should be returned.
Returns:
  The full sequence associated with this contig.

### getSubsequenceAt

public ReferenceSequence getSubsequenceAt(String contig, long start, long stop)
Description copied from interface: `ReferenceSequenceFile`
Gets the subsequence of the contig in the range [start,stop]

Specified by:
  `getSubsequenceAt` in interface `ReferenceSequenceFile`
Parameters:
  `contig` - Contig whose subsequence to retrieve.
  `start` - inclusive, 1-based start of region.
  `stop` - inclusive, 1-based stop of region.
Returns:
  The partial reference sequence associated with this range.

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `ReferenceSequenceFile`
Throws:
  `IOException`

### loadSequenceDictionary

protected SAMSequenceDictionary loadSequenceDictionary() throws ngs.ErrorMsg

Throws:
  `ngs.ErrorMsg`