diff --git a/lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py b/lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py index 7cd6eeb137e..5a54570f060 100644 --- a/lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py +++ b/lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py @@ -4,7 +4,6 @@ Input: fasta, minimal length, maximal length Output: fasta Return sequences whose lengths are within the range. -Wen-Yu Chung """ import sys, os @@ -26,9 +25,10 @@ def __main__(): title = line sequence = '' else: - sequence += line - if line.split()[0].isdigit(): - sequence += ' ' + if line: + sequence += line + if line.split()[0].isdigit(): + sequence += ' ' if sequence: seq_hash[( sequence_count, title )] = sequence # return only those lengths are in the range diff --git a/tools/fasta_tools/fasta_to_tabular.py b/tools/fasta_tools/fasta_to_tabular.py index 7cd6eeb137e..5a54570f060 100644 --- a/tools/fasta_tools/fasta_to_tabular.py +++ b/tools/fasta_tools/fasta_to_tabular.py @@ -4,7 +4,6 @@ Input: fasta, minimal length, maximal length Output: fasta Return sequences whose lengths are within the range. -Wen-Yu Chung """ import sys, os @@ -26,9 +25,10 @@ def __main__(): title = line sequence = '' else: - sequence += line - if line.split()[0].isdigit(): - sequence += ' ' + if line: + sequence += line + if line.split()[0].isdigit(): + sequence += ' ' if sequence: seq_hash[( sequence_count, title )] = sequence # return only those lengths are in the range