From e1e73d4c8790e9d83ac56ef0a97096556cc5a90f Mon Sep 17 00:00:00 2001 From: free hacker <freeh4cker@gmail.com> Date: Thu, 18 Feb 2016 08:05:19 +0100 Subject: [PATCH] comment is now an optional argumnt of the Sequence init --- source/_static/code/fasta_object.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/_static/code/fasta_object.py b/source/_static/code/fasta_object.py index 963229a..a1a32c8 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 -- GitLab