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
All Methods Instance Methods Concrete Methods 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
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:ReferenceSequenceFile
Must return a sequence dictionary with at least the following fields completed for each sequence: name, length.- Specified by:
getSequenceDictionary
in interfaceReferenceSequenceFile
- 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 interfaceReferenceSequenceFile
- 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 interfaceReferenceSequenceFile
-
isIndexed
public boolean isIndexed()
- Specified by:
isIndexed
in interfaceReferenceSequenceFile
- 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 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:ReferenceSequenceFile
Gets the subsequence of the contig in the range [start,stop]- Specified by:
getSubsequenceAt
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceReferenceSequenceFile
- Throws:
IOException
-
loadSequenceDictionary
protected SAMSequenceDictionary loadSequenceDictionary() throws ngs.ErrorMsg
- Throws:
ngs.ErrorMsg
-
-