Skip to content

Commit

Permalink
Add explicit check for empty FASTA/fai files.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkelSchubert authored Jul 30, 2018
1 parent 9abe405 commit 6d6b7c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mapdamage/seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ def print_err(msg, filename, line):
print_err("Column 2 in FASTA index did not contain a number, found '%s':" % ref[1], filename, line)
return None

if not fai:
sys.stderr.write("Error: Index for %r does contain any sequences.\n" % (filename,))
sys.stderr.write(" Please ensure that FASTA file is valid, and\n")
sys.stderr.write(" re-index file using 'samtool faidx'.\n")
return None

return fai


Expand Down

0 comments on commit 6d6b7c8

Please sign in to comment.