public class FastaParser
extends java.lang.Object
implements java.lang.Iterable<java.lang.String>
this.iterator()
method) and
staging each line as a data block. The iterator's remove method is not
supported. Modifying the lines or records will invalidate the iterator,
making its behavior undefined.Modifier and Type | Class and Description |
---|---|
static class |
FastaParser.FastaRecord |
Constructor and Description |
---|
FastaParser(java.io.File file)
Constructs a FASTA file parser over the
File . |
FastaParser(java.io.InputStream in,
java.lang.String fileName)
Constructs a FASTA file parser over the
InputStream . |
FastaParser(java.lang.String absolutePath)
Constructs a FASTA file parser over the FASTA file at the given
absolute path.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream and releases any system resources associated with it.
|
java.util.Iterator<java.lang.String> |
iterator() |
java.util.Iterator<java.lang.String> |
lineIterator()
Returns a
FastaParser.FastaLineIterator over
the FASTA file. |
java.util.Iterator<FastaParser.FastaRecord> |
recordIterator()
Returns a
FastaParser.FastaRecordIterator
over the FASTA file. |
java.util.Iterator<ProteinSequence> |
windowIterator() |
public FastaParser(java.io.InputStream in, java.lang.String fileName)
InputStream
.in
- the input stream over the fasta file to parsepublic FastaParser(java.io.File file) throws java.io.FileNotFoundException
File
.file
- the fasta file to parsejava.io.FileNotFoundException
- if the file does not exist, is a
directory rather than a regular file, or
for some other reason cannot
be opened for reading.public FastaParser(java.lang.String absolutePath) throws java.io.FileNotFoundException
absolutePath
- the absolute path to the FASTA filejava.io.FileNotFoundException
- if the file does not exist, is a
directory rather than a regular file, or
for some other reason cannot
be opened for reading.public java.util.Iterator<java.lang.String> lineIterator()
FastaParser.FastaLineIterator
over
the FASTA file.public java.util.Iterator<FastaParser.FastaRecord> recordIterator()
FastaParser.FastaRecordIterator
over the FASTA file.public java.util.Iterator<ProteinSequence> windowIterator()
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
public void close() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.