public class FastaSequenceFile extends Object
| Modifier and Type | Field and Description |
|---|---|
protected SAMSequenceDictionary |
sequenceDictionary |
| Constructor and Description |
|---|
FastaSequenceFile(File file,
boolean truncateNamesAtWhitespace)
Constructs a FastaSequenceFile that reads from the specified file.
|
FastaSequenceFile(Path path,
boolean truncateNamesAtWhitespace)
Constructs a FastaSequenceFile that reads from the specified file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
It's good to call this to free up memory.
|
protected static File |
findSequenceDictionary(File file) |
protected static Path |
findSequenceDictionary(Path path) |
protected String |
getAbsolutePath()
Returns the full path to the reference file.
|
protected Path |
getPath()
Returns the path to the reference file.
|
ReferenceSequence |
getSequence(String contig)
default implementation -- override if index is supported
|
SAMSequenceDictionary |
getSequenceDictionary()
Returns the list of sequence records associated with the reference sequence if found
otherwise null.
|
ReferenceSequence |
getSubsequenceAt(String contig,
long start,
long stop)
default implementation -- override if index is supported
|
boolean |
isIndexed()
default implementation -- override if index is supported
|
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.
|
String |
toString()
Returns the full path to the reference file.
|
protected SAMSequenceDictionary sequenceDictionary
public FastaSequenceFile(File file, boolean truncateNamesAtWhitespace)
public FastaSequenceFile(Path path, boolean truncateNamesAtWhitespace)
public void close()
public ReferenceSequence nextSequence()
ReferenceSequenceFilepublic void reset()
ReferenceSequenceFileprotected Path getPath()
public SAMSequenceDictionary getSequenceDictionary()
getSequenceDictionary in interface ReferenceSequenceFileprotected String getAbsolutePath()
public String toString()
toString in interface ReferenceSequenceFiletoString in class Objectpublic boolean isIndexed()
isIndexed in interface ReferenceSequenceFilepublic ReferenceSequence getSequence(String contig)
getSequence in interface ReferenceSequenceFilecontig - contig whose data should be returned.public ReferenceSequence getSubsequenceAt(String contig, long start, long stop)
getSubsequenceAt in interface ReferenceSequenceFilecontig - Contig whose subsequence to retrieve.start - inclusive, 1-based start of region.stop - inclusive, 1-based stop of region.