Class FastaIterator
java.lang.Object
com.compomics.util.experiment.io.biology.protein.iterators.FastaIterator
- All Implemented Interfaces:
ProteinIterator
Iterator for a FASTA file.
- Author:
- Marc Vaudel, Harald Barsnes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charCharacter forbidden in protein sequences, will be removed. -
Constructor Summary
ConstructorsConstructorDescriptionFastaIterator(File fastaFile) Constructor without sanity check.FastaIterator(File fastaFile, boolean sanityCheck) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the iterator.Returns the header corresponding to the last protein.Returns the next protein.doubleReturns the progress reading the file in percent.
-
Field Details
-
FORBIDDEN_CHARACTER
public static final char FORBIDDEN_CHARACTERCharacter forbidden in protein sequences, will be removed.- See Also:
-
-
Constructor Details
-
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
-
getProgressInPercent
public double getProgressInPercent()Returns the progress reading the file in percent.- Returns:
- The progress reading the file in percent.
-
getNextProtein
Description copied from interface:ProteinIteratorReturns the next protein. Null if end was reached. If an error is encountered while iterating, the exception is thrown as runtime exception.- Specified by:
getNextProteinin 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.
-