Skip to content

Commit

Permalink
Fix sys.stderr output and report if no reads contained errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus1487 committed Sep 26, 2019
1 parent 86ffce2 commit fba9e63
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions megalodon/megalodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ def update_prog(reads_called, sig_called, unexp_err_fp):
[(len(fns), err) for err, fns in failed_reads.items()
if len(fns) > 0], reads_called))
# TODO flag to output failed read names to file
else:
logger.info('All reads processed successfully.')

return

Expand Down Expand Up @@ -704,9 +706,8 @@ def mkdir(out_dir, overwrite):
logger = logging.get_logger()
if os.path.exists(out_dir):
if not overwrite:
sys.stderr.write(
'ERROR: --output-directory exists and --overwrite is ' +
'not set.\n')
logger.error(
'--output-directory exists and --overwrite is not set.')
sys.exit(1)
if os.path.isfile(out_dir) or os.path.islink(out_dir):
os.remove(out_dir)
Expand Down

0 comments on commit fba9e63

Please sign in to comment.