fix a bug that caused list index out of range (because there's empty lines).

This commit is contained in:
Wen-Yu Chung
2008-02-06 18:07:00 +00:00
parent 32846eaaf2
commit 2f96d33be7
2 changed files with 8 additions and 8 deletions
@@ -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
+4 -4
View File
@@ -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