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 SAMSequenceDictionarysequenceDictionary
-
Constructor Summary
Constructors Constructor Description SRAIndexedSequenceFile(SRAAccession acc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ReferenceSequencegetSequence(String contig)Retrieves the complete sequence described by this contig.SAMSequenceDictionarygetSequenceDictionary()Must return a sequence dictionary with at least the following fields completed for each sequence: name, length.ReferenceSequencegetSubsequenceAt(String contig, long start, long stop)Gets the subsequence of the contig in the range [start,stop]booleanisIndexed()protected SAMSequenceDictionaryloadSequenceDictionary()ReferenceSequencenextSequence()Retrieves the next whole sequences from the file.voidreset()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
toString
-
-
-
-
Field Detail
-
sequenceDictionary
protected SAMSequenceDictionary sequenceDictionary
-
-
Constructor Detail
-
SRAIndexedSequenceFile
public SRAIndexedSequenceFile(SRAAccession acc)
- Parameters:
acc- accession
-
-
Method Detail
-
getSequenceDictionary
public SAMSequenceDictionary getSequenceDictionary()
Description copied from interface:ReferenceSequenceFileMust return a sequence dictionary with at least the following fields completed for each sequence: name, length.- Specified by:
getSequenceDictionaryin interfaceReferenceSequenceFile- Returns:
- a list of sequence records representing the sequences in this reference file
-
nextSequence
public ReferenceSequence nextSequence()
Description copied from interface:ReferenceSequenceFileRetrieves the next whole sequences from the file.- Specified by:
nextSequencein interfaceReferenceSequenceFile- Returns:
- a ReferenceSequence or null if at the end of the file
-
reset
public void reset()
Description copied from interface:ReferenceSequenceFileResets the ReferenceSequenceFile so that the next call to nextSequence() will return the first sequence in the file.- Specified by:
resetin interfaceReferenceSequenceFile
-
isIndexed
public boolean isIndexed()
- Specified by:
isIndexedin interfaceReferenceSequenceFile- Returns:
- true if getSequence and getSubsequenceAt methods are allowed.
-
getSequence
public ReferenceSequence getSequence(String contig)
Description copied from interface:ReferenceSequenceFileRetrieves the complete sequence described by this contig.- Specified by:
getSequencein interfaceReferenceSequenceFile- 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:ReferenceSequenceFileGets the subsequence of the contig in the range [start,stop]- Specified by:
getSubsequenceAtin interfaceReferenceSequenceFile- 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReferenceSequenceFile- Throws:
IOException
-
loadSequenceDictionary
protected SAMSequenceDictionary loadSequenceDictionary() throws ngs.ErrorMsg
- Throws:
ngs.ErrorMsg
-
-