diff --git a/source/_static/code/multiple_fasta_reader.py b/source/_static/code/multiple_fasta_reader.py index 1d94a7660677b84b5c6888db5c9211976662eba7..d6a367e4ae9626dceeec42c21c4cb4e9a10fd5da 100644 --- a/source/_static/code/multiple_fasta_reader.py +++ b/source/_static/code/multiple_fasta_reader.py @@ -1,6 +1,6 @@ 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