Iterable<FastaSequenceIndexEntry>
public class FastaSequenceIndex extends Object implements Iterable<FastaSequenceIndexEntry>
Modifier | Constructor | Description |
---|---|---|
protected |
FastaSequenceIndex() |
Empty, protected constructor for unit testing.
|
|
FastaSequenceIndex(File indexFile) |
Build a sequence index from the specified file.
|
|
FastaSequenceIndex(Path indexFile) |
Build a sequence index from the specified file.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
add(FastaSequenceIndexEntry indexEntry) |
Add a new index entry to the list.
|
boolean |
equals(Object other) |
Compare two FastaSequenceIndex objects for equality.
|
FastaSequenceIndexEntry |
getIndexEntry(String contigName) |
Retrieve the index entry associated with the given contig.
|
boolean |
hasIndexEntry(String contigName) |
Does the given contig name have a corresponding entry?
|
Iterator<FastaSequenceIndexEntry> |
iterator() |
Creates an iterator which can iterate through all entries in a fasta index.
|
protected void |
rename(FastaSequenceIndexEntry entry,
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.
|
void |
write(Path indexFile) |
Writes this index to the specified path.
|
forEach, spliterator
public FastaSequenceIndex(File indexFile)
indexFile
- File to open.FileNotFoundException
- if the index file cannot be found.public FastaSequenceIndex(Path indexFile)
indexFile
- File to open.FileNotFoundException
- if the index file cannot be found.protected FastaSequenceIndex()
protected void add(FastaSequenceIndexEntry indexEntry)
indexEntry
- New index entry to add.protected void rename(FastaSequenceIndexEntry entry, String newName)
entry
- entry to update.newName
- New name for the index entry.public boolean equals(Object other)
public void write(Path indexFile) throws IOException
indexFile
- index file to output the index in the .fai formatIOException
- if an IO error occurs.public boolean hasIndexEntry(String contigName)
contigName
- The contig name for which to search.public FastaSequenceIndexEntry getIndexEntry(String contigName)
contigName
- Name of the contig for which to search.SAMException
- if the associated index entry can't be found.public Iterator<FastaSequenceIndexEntry> iterator()
iterator
in interface Iterable<FastaSequenceIndexEntry>
public int size()