public class FastaSequenceIndex
extends java.lang.Object
implements java.lang.Iterable<htsjdk.samtools.reference.FastaSequenceIndexEntry>
Modifier | Constructor and Description |
---|---|
protected |
FastaSequenceIndex()
Empty, protected constructor for unit testing.
|
|
FastaSequenceIndex(java.io.File indexFile)
Build a sequence index from the specified file.
|
|
FastaSequenceIndex(java.nio.file.Path indexFile)
Build a sequence index from the specified file.
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(htsjdk.samtools.reference.FastaSequenceIndexEntry indexEntry)
Add a new index entry to the list.
|
boolean |
equals(java.lang.Object other)
Compare two FastaSequenceIndex objects for equality.
|
htsjdk.samtools.reference.FastaSequenceIndexEntry |
getIndexEntry(java.lang.String contigName)
Retrieve the index entry associated with the given contig.
|
boolean |
hasIndexEntry(java.lang.String contigName)
Does the given contig name have a corresponding entry?
|
java.util.Iterator<htsjdk.samtools.reference.FastaSequenceIndexEntry> |
iterator()
Creates an iterator which can iterate through all entries in a fasta index.
|
protected void |
rename(htsjdk.samtools.reference.FastaSequenceIndexEntry entry,
java.lang.String newName)
Renames the existing index entry to the new index entry with the specified name.
|
int |
size()
Returns the number of elements in the index.
|
public FastaSequenceIndex(java.io.File indexFile)
indexFile
- File to open.java.io.FileNotFoundException
- if the index file cannot be found.public FastaSequenceIndex(java.nio.file.Path indexFile)
indexFile
- File to open.java.io.FileNotFoundException
- if the index file cannot be found.protected FastaSequenceIndex()
protected void add(htsjdk.samtools.reference.FastaSequenceIndexEntry indexEntry)
indexEntry
- New index entry to add.protected void rename(htsjdk.samtools.reference.FastaSequenceIndexEntry entry, java.lang.String newName)
entry
- entry to update.newName
- New name for the index entry.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- Another FastaSequenceIndex to comparepublic boolean hasIndexEntry(java.lang.String contigName)
contigName
- The contig name for which to search.public htsjdk.samtools.reference.FastaSequenceIndexEntry getIndexEntry(java.lang.String contigName)
contigName
- Name of the contig for which to search.SAMException
- if the associated index entry can't be found.public java.util.Iterator<htsjdk.samtools.reference.FastaSequenceIndexEntry> iterator()
iterator
in interface java.lang.Iterable<htsjdk.samtools.reference.FastaSequenceIndexEntry>
public int size()