snayfach / MicrobeCensus

MicrobeCensus estimates the average genome size of microbial communities from metagenomic data
http://genomebiology.com/2015/16/1/51
GNU General Public License v3.0
41 stars 16 forks source link

MC should use the Unix exit code convention #10

Closed taltman closed 9 years ago

taltman commented 9 years ago

MC reports "Error! No reads remaining after filtering!"

But the exit code is 0. Unix convention is to have a non-zero, non-negative exit code when there's an error.

This makes it harder to detect errors when running batches of MC runs via a script.

snayfach commented 9 years ago

I am using sys.exit("error message") whenever microbe_census exits prematurely.The exit code should be 1 in this case, and 0 when run to completion (https://docs.python.org/2/library/sys.html). Please make sure you are correctly detecting the exit code.

$ run_microbe_census.py -l 500 metagenome.fa.gz test.out Error! No reads remaining after filtering! $ echo $? 1