diff --git a/source/_static/code/fasta_object.py b/source/_static/code/fasta_object.py index 963229a730975480a769ef95e28338b0d007b44a..a1a32c8ad3dfa247a16386ce45e9df5503d07f8d 100644 --- a/source/_static/code/fasta_object.py +++ b/source/_static/code/fasta_object.py @@ -1,6 +1,6 @@ class Sequence(object): - def __init__(self, id_, comment, sequence): + def __init__(self, id_, sequence, comment=''): self.id = id_ self.comment = comment self.sequence = sequence @@ -40,8 +40,8 @@ class FastaParser(object): # a new sequence begin if self._current_id != '': new_seq = Sequence(self._current_id, - self._current_comment, - self._current_sequence) + self._current_sequence, + comment=self._current_comment) self._parse_header(line) return new_seq else: @@ -53,8 +53,8 @@ class FastaParser(object): raise StopIteration() else: new_seq = Sequence(self._current_id, - self._current_comment, - self._current_sequence) + self._current_sequence, + comment=self._current_comment) self._current_id = '' self._current_sequence = '' return new_seq