Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
class Sequence(object): class Sequence(object):
def __init__(self, id_, comment, sequence): def __init__(self, id_, sequence, comment=''):
self.id = id_ self.id = id_
self.comment = comment self.comment = comment
self.sequence = sequence self.sequence = sequence
...@@ -40,8 +40,8 @@ class FastaParser(object): ...@@ -40,8 +40,8 @@ class FastaParser(object):
# a new sequence begin # a new sequence begin
if self._current_id != '': if self._current_id != '':
new_seq = Sequence(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) self._parse_header(line)
return new_seq return new_seq
else: else:
...@@ -53,8 +53,8 @@ class FastaParser(object): ...@@ -53,8 +53,8 @@ class FastaParser(object):
raise StopIteration() raise StopIteration()
else: else:
new_seq = Sequence(self._current_id, new_seq = Sequence(self._current_id,
self._current_comment, self._current_sequence,
self._current_sequence) comment=self._current_comment)
self._current_id = '' self._current_id = ''
self._current_sequence = '' self._current_sequence = ''
return new_seq return new_seq
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment