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

fix space to be pep8 compliant

parent c5f48a35
from collections import namedtuple
Sequence = namedtuple("Sequence", "id comment sequence")
Sequence = namedtuple("Sequence", "id comment sequence")
def fasta_reader(fasta_path):
"""
......@@ -19,19 +19,18 @@ def fasta_reader(fasta_path):
# a new sequence begin
if id_ != '':
# a sequence was already parsed so add it to the list
sequences.append(Sequence(id_ , comment, sequence))
sequences.append(Sequence(id_, comment, sequence))
sequence = ''
header = line.split()
id_ = header[0]
comment = ' '.join(header[1:])
else:
sequence += line.strip()
sequences.append(Sequence(id_ , comment, sequence))
sequences.append(Sequence(id_, comment, sequence))
return sequences
# The problem with this implementation is that we have to load all
# sequences in memory before to start to work with
# it is better to return sequence one by one
# and treat them as they are loaded.
\ No newline at end of file
# and treat them as they are loaded.
\ No newline at end of file
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