Skip to content

Commit d76ef78

Browse files
committed
genome feature header split fix
1 parent 0aa128e commit d76ef78

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modelseedpy/core/msgenome.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ def parse_fasta_str(faa_str, split=DEFAULT_SPLIT, h_func=None):
2626
if seq:
2727
features.append(seq)
2828
seq_id = line[1:]
29-
desc = None
29+
desc = ''
3030
if h_func:
3131
seq_id, desc = h_func(seq_id)
3232
elif split:
3333
header_data = line[1:].split(split, 1)
3434
seq_id = header_data[0]
35-
desc = header_data[1] # The unit test throws an error when this is commented
35+
if len(header_data) > 1:
36+
desc = header_data[1] # The unit test throws an error when this is commented
3637

3738
seq = MSFeature(seq_id, "", desc)
3839
else:

0 commit comments

Comments
 (0)