Commit e1e73d4c authored by Bertrand Néron's avatar Bertrand Néron
Browse files

comment is now an optional argumnt of the Sequence init

parent b5dada79
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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment