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()
ReferenceSequenceFile
public void reset()
ReferenceSequenceFile
protected Path getPath()
public SAMSequenceDictionary getSequenceDictionary()
getSequenceDictionary
in interface ReferenceSequenceFile
protected String getAbsolutePath()
public String toString()
toString
in interface ReferenceSequenceFile
toString
in class Object
public boolean isIndexed()
isIndexed
in interface ReferenceSequenceFile
public ReferenceSequence getSequence(String contig)
getSequence
in interface ReferenceSequenceFile
contig
- contig whose data should be returned.public ReferenceSequence getSubsequenceAt(String contig, long start, long stop)
getSubsequenceAt
in interface ReferenceSequenceFile
contig
- Contig whose subsequence to retrieve.start
- inclusive, 1-based start of region.stop
- inclusive, 1-based stop of region.