1010import java .io .File ;
1111import java .io .IOException ;
1212import java .io .InputStream ;
13+ import java .io .UncheckedIOException ;
1314import java .nio .file .Path ;
1415import java .util .Collections ;
1516import java .util .Iterator ;
2728 * for use in a functional programming paradigm.
2829 *
2930 * @author Gary Murphy
30- * @since 7.0.3
31+ * @since 7.1.0
3132 */
3233public class FastaStreamer {
3334
@@ -135,12 +136,12 @@ private ProteinSequence next(FastaReader<ProteinSequence, AminoAcidCompound> rea
135136 }
136137 if (iterator .hasNext ()) {
137138 Map .Entry <String , ProteinSequence > entry = iterator .next ();
138- return createSequence (entry .getKey (), entry . getValue ());
139+ return createSequence (entry .getValue ());
139140 }
140141 closed = true ;
141142 reader .close ();
142143 } catch (IOException exception ) {
143- throw new RuntimeException (String .format ("I/O error reading the FASTA file from '%s'" , getPath ()));
144+ throw new UncheckedIOException (String .format ("I/O error reading the FASTA file from '%s'" , getPath ()), exception );
144145 }
145146 return null ;
146147 }
@@ -153,11 +154,10 @@ private ProteinSequence next(FastaReader<ProteinSequence, AminoAcidCompound> rea
153154 * this is an opportunity for the implementer to build specific information into the user collection space
154155 * of the sequence
155156 *
156- * @param header the original header
157157 * @param sequence the protein sequence
158158 * @return the sequence
159159 */
160- protected ProteinSequence createSequence (String header , ProteinSequence sequence ) {
160+ protected ProteinSequence createSequence (ProteinSequence sequence ) {
161161 return sequence ;
162162 }
163163
0 commit comments