Skip to content

Commit

Permalink
Replace the fatal error by a warning #29
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-couderc committed Oct 6, 2017
1 parent be5f023 commit 9912bb7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/compute_abundance.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ def complete_fasta_with_abundance(input_fasta, output_fasta, abundance):

for header, seq in read_fasta_file_handle(in_fasta_handler):
id = header.split()[0].strip()
ab = 0
if id not in abundance:
logger.fatal("Can't find the abundance for:%s" % id)
sys.exit("Can't find abundance")
logger.warning("Can't find the abundance for:%s. Set to 0 by default." % id)
else:
ab = abundance[id]
ab = round(ab)
header = '{header} count={abundance}'.format(header=header, abundance=ab)
out_fasta_handler.write( '>{header}\n{seq}\n'.format(header=header, seq=format_seq(seq)) )
header = '{header} count={abundance}'.format(header=header, abundance=ab)
out_fasta_handler.write( '>{header}\n{seq}\n'.format(header=header, seq=format_seq(seq)) )

in_fasta_handler.close()
out_fasta_handler.close()
Expand Down

0 comments on commit 9912bb7

Please sign in to comment.