aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-04-02 13:59:50 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2014-04-02 13:59:50 -0400
commit9b1b14529cb7f7f2dedcfc148f781ef457ad568b (patch)
tree6fc3c4b50814ffd69a374b712b019f154c2f9d5a
parent3cb93355a7e80dd4e910eadc613c61b1347067bc (diff)
add exit codes
-rwxr-xr-xsrc/score_mers.py14
-rwxr-xr-xsrc/select_mers.py6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/score_mers.py b/src/score_mers.py
index d040760..683066c 100755
--- a/src/score_mers.py
+++ b/src/score_mers.py
@@ -192,7 +192,7 @@ def check_feasible(selected):
if total is 0:
print "something went wrong, no mers found in the foreground. Consider this a bug!"
print fg_mers
- exit()
+ exit(1)
if (fg_genome_length / (total + 1 )) > max_mer_distance:
print "even if we select all top", max_select, "of", total
@@ -200,7 +200,7 @@ def check_feasible(selected):
print "still not meet the right max mer distance < ", max_mer_distance, "requirement."
print total, " / ", fg_genome_length, " = ", total / fg_genome_length
- exit()
+ exit(1)
def percentage(part, whole, precision=2):
@@ -410,7 +410,7 @@ def main():
parser.error("you must have at least one input file to score from [-s -c -m -r]")
else:
parser.error("you can only have one input file to score from" )
- exit()
+ exit(1)
if not os.path.isfile(args.foreground):
parser.error(args.foreground + " not found")
@@ -449,7 +449,7 @@ def main():
if len(selected_mers) is 0:
print "no merss found."
- exit()
+ exit(1)
# we already have our background counts
initialize_mers(args.foreground, args.background, load_background=False)
@@ -473,7 +473,7 @@ def main():
if len(combinations) is 0:
print "no combinations found."
- exit()
+ exit(1)
initialize_mers(args.foreground, args.background)
score_specific_combinations(combinations)
@@ -493,7 +493,7 @@ def main():
if len(fg_mers.keys()) is 0:
print "no mers found."
- exit()
+ exit(1)
initialize_mers(args.foreground, args.background)
score_all_combinations(fg_mers.keys())
@@ -516,7 +516,7 @@ def main():
if len(combinations) is 0:
print "no combinations found."
- exit()
+ exit(1)
initialize_mers(args.foreground, args.background)
diff --git a/src/select_mers.py b/src/select_mers.py
index a3d1f32..f8f7f1a 100755
--- a/src/select_mers.py
+++ b/src/select_mers.py
@@ -12,9 +12,9 @@ if(len(sys.argv) == 3):
bg_count_fn = sys.argv[2]
else:
print len(sys.argv)
- print "please specify your inputs"
- print "ex: select_mers.py fg_counts bg_counts"
- exit()
+ sys.stderr.write("please specify your inputs\n")
+ sys.stderr.write("ex: select_mers.py fg_counts bg_count\n")
+ exit(1)
# select mers based on our 'selectivity' measure. (count in fg) / (count in bg)