public class FastaSequenceFile
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected SAMSequenceDictionary |
sequenceDictionary |
| Constructor and Description |
|---|
FastaSequenceFile(java.io.File file,
boolean truncateNamesAtWhitespace)
Constructs a FastaSequenceFile that reads from the specified file.
|
FastaSequenceFile(java.nio.file.Path path,
boolean truncateNamesAtWhitespace)
Constructs a FastaSequenceFile that reads from the specified file.
|
FastaSequenceFile(java.lang.String source,
SeekableStream seekableStream,
SAMSequenceDictionary dictionary,
boolean truncateNamesAtWhitespace)
Constructs a FastaSequenceFile that reads from the specified stream (which must not be compressed, i.e.
|
| 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) |
protected static java.nio.file.Path |
findSequenceDictionary(java.nio.file.Path path) |
protected java.lang.String |
getAbsolutePath()
Returns the full path to the reference file.
|
protected java.nio.file.Path |
getPath()
Returns the path to the reference 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.
|
protected java.lang.String |
getSource()
Returns the named source of the reference file.
|
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, or the source if no path was specified.
|
protected SAMSequenceDictionary sequenceDictionary
public FastaSequenceFile(java.io.File file,
boolean truncateNamesAtWhitespace)
public FastaSequenceFile(java.nio.file.Path path,
boolean truncateNamesAtWhitespace)
public FastaSequenceFile(java.lang.String source,
SeekableStream seekableStream,
SAMSequenceDictionary dictionary,
boolean truncateNamesAtWhitespace)
public void close()
public ReferenceSequence nextSequence()
ReferenceSequenceFilepublic void reset()
ReferenceSequenceFileprotected static java.io.File findSequenceDictionary(java.io.File file)
protected static java.nio.file.Path findSequenceDictionary(java.nio.file.Path path)
protected java.nio.file.Path getPath()
protected java.lang.String getSource()
public SAMSequenceDictionary getSequenceDictionary()
getSequenceDictionary in interface ReferenceSequenceFileprotected java.lang.String getAbsolutePath()
public 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.