Class FastaIterator
java.lang.Object
com.compomics.util.experiment.io.biology.protein.iterators.FastaIterator
- All Implemented Interfaces:
ProteinIterator
public class FastaIterator extends Object implements ProteinIterator
Iterator for a FASTA file.
- Author:
- Marc Vaudel
-
Field Summary
Fields Modifier and Type Field Description static char
forbiddenCharacter
Character forbidden in protein sequences, will be removed. -
Constructor Summary
Constructors Constructor Description FastaIterator()
Empty default constructorFastaIterator(File fastaFile)
Constructor without sanity check.FastaIterator(File fastaFile, boolean sanityCheck)
Constructor. -
Method Summary
Modifier and Type Method Description void
close()
Closes the iterator.Header
getLastHeader()
Returns the header corresponding to the last protein.Protein
getNextProtein()
Returns the next protein.
-
Field Details
-
forbiddenCharacter
public static final char forbiddenCharacterCharacter forbidden in protein sequences, will be removed.- See Also:
- Constant Field Values
-
-
Constructor Details
-
FastaIterator
public FastaIterator()Empty default constructor -
FastaIterator
Constructor without sanity check.- Parameters:
fastaFile
- the FASTA file- Throws:
FileNotFoundException
- exception thrown if the file could not be found
-
FastaIterator
Constructor.- Parameters:
fastaFile
- the FASTA filesanityCheck
- boolean indicating whether sanity check should be conducted- Throws:
FileNotFoundException
- exception thrown if the file could not be found
-
-
Method Details
-
getNextProtein
Description copied from interface:ProteinIterator
Returns the next protein. Null if end was reached. If an error is encountered while iterating, the exception is thrown as runtime exception.- Specified by:
getNextProtein
in interfaceProteinIterator
- Returns:
- the next protein
-
getLastHeader
Returns the header corresponding to the last protein.- Returns:
- the header corresponding to the last protein
-
close
public void close()Closes the iterator.
-