public final class ReferenceFileSource extends java.lang.Object implements ReferenceDataSource
Constructor and Description |
---|
ReferenceFileSource(java.nio.file.Path fastaPath)
Initialize this data source using a fasta file.
|
ReferenceFileSource(java.nio.file.Path fastaPath,
boolean preserveFileBases)
Initialize this data source using a fasta file.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Permanently close this data source
|
htsjdk.samtools.SAMSequenceDictionary |
getSequenceDictionary()
Get the sequence dictionary for this reference
|
java.util.Iterator<java.lang.Byte> |
iterator()
Start an iteration over the entire reference.
|
htsjdk.samtools.reference.ReferenceSequence |
queryAndPrefetch(java.lang.String contig,
long start,
long stop)
Query a specific interval on this reference, and get back all bases spanning that interval at once.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
of, of, of, query, queryAndPrefetch
public ReferenceFileSource(java.nio.file.Path fastaPath)
fastaPath
- reference fasta filepublic ReferenceFileSource(java.nio.file.Path fastaPath, boolean preserveFileBases)
preserveFileBases
is true
, will NOT convert IUPAC bases in the file to `N` and will NOT capitalize lower-case bases.
NOTE: Most GATK tools do not support data created by setting preserveFileBases
to true
.fastaPath
- reference fasta filepreserveFileBases
- Whether to preserve the original bases in the given reference file path.public java.util.Iterator<java.lang.Byte> iterator()
iterator
in interface java.lang.Iterable<java.lang.Byte>
public htsjdk.samtools.reference.ReferenceSequence queryAndPrefetch(java.lang.String contig, long start, long stop)
queryAndPrefetch
in interface ReferenceDataSource
contig
- query interval contigstart
- query interval startstop
- query interval stoppublic htsjdk.samtools.SAMSequenceDictionary getSequenceDictionary()
getSequenceDictionary
in interface ReferenceDataSource
public void close()
close
in interface java.lang.AutoCloseable
close
in interface ReferenceDataSource