public class FastaSequenceFile
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.io.File |
file |
protected SAMSequenceDictionary |
sequenceDictionary |
| Constructor and Description |
|---|
FastaSequenceFile(java.io.File file,
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 java.io.File |
findSequenceDictionary(java.io.File file) |
ReferenceSequence |
getSequence(java.lang.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(java.lang.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.
|
java.lang.String |
toString()
Returns the full path to the reference file.
|
protected final java.io.File file
protected SAMSequenceDictionary sequenceDictionary
public FastaSequenceFile(java.io.File file,
boolean truncateNamesAtWhitespace)
public void close()
public ReferenceSequence nextSequence()
ReferenceSequenceFilepublic void reset()
ReferenceSequenceFileprotected static java.io.File findSequenceDictionary(java.io.File file)
public SAMSequenceDictionary getSequenceDictionary()
getSequenceDictionary in interface ReferenceSequenceFilepublic java.lang.String toString()
toString in interface ReferenceSequenceFiletoString in class java.lang.Objectpublic boolean isIndexed()
isIndexed in interface ReferenceSequenceFilepublic ReferenceSequence getSequence(java.lang.String contig)
getSequence in interface ReferenceSequenceFilecontig - contig whose data should be returned.public ReferenceSequence getSubsequenceAt(java.lang.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.