Skip to content

Commit 962eb3a

Browse files
author
Nolan Woods
committed
Handle empty sequences when outputting fasta
1 parent d9c2ef4 commit 962eb3a

4 files changed

Lines changed: 48801 additions & 1 deletion

File tree

biopython_convert/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ def _to_SeqRecords(records):
160160

161161
return map(lambda r: _to_SeqRecord(r) if isinstance(r, dict) else r, records)
162162

163-
164163
def get_records(input_handle, input_type: str, jpath: str = '', xform: Callable = _to_SeqRecords):
165164
"""
166165
Read in records and apply optional jmespath
@@ -369,6 +368,8 @@ def convert(input_path: pathlib.Path, input_type: str, output_path: pathlib.Path
369368
raise
370369
binary = 'b'
371370
continue
371+
except Seq.UndefinedSequenceError:
372+
path.unlink(True)
372373
break
373374
else:
374375
while True:
@@ -387,5 +388,7 @@ def convert(input_path: pathlib.Path, input_type: str, output_path: pathlib.Path
387388
raise
388389
binary = 'b'
389390
continue
391+
except Seq.UndefinedSequenceError:
392+
pass
390393
break
391394

0 commit comments

Comments
 (0)