Skip to content

Commit e464f50

Browse files
FASTA: only read first character per line for setting metadata
otherwise the whole line is kept in memory which might be the complete sequence in edge cases
1 parent ad18c46 commit e464f50

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/galaxy/datatypes/sequence.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from galaxy.exceptions import InvalidFileFormatError
4343
from galaxy.util import (
4444
compression_utils,
45+
iter_start_of_line,
4546
nice_size,
4647
)
4748
from galaxy.util.checkers import is_gzip
@@ -376,7 +377,7 @@ def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd) -> N
376377
data_lines = 0
377378
sequences = 0
378379
with compression_utils.get_fileobj(dataset.get_file_name()) as fh:
379-
for line in fh:
380+
for line in iter_start_of_line(fh, 1):
380381
if not line:
381382
continue
382383
elif line[0] == ">":

0 commit comments

Comments
 (0)