diff reactome_analysis.py @ 4:878128362e33 draft

planemo upload commit 34edf9c3db61650a03d5a0d548b9697a94ecde34-dirty
author proteore
date Tue, 03 Apr 2018 08:24:45 -0400
parents 216bd2a75b1d
children 9cc475dcd0f2
line wrap: on
line diff
--- a/reactome_analysis.py	Fri Mar 23 10:48:36 2018 -0400
+++ b/reactome_analysis.py	Tue Apr 03 08:24:45 2018 -0400
@@ -23,8 +23,8 @@
     """
     Check if an variable is numeric
     """
-    float_format = re.compile("^[\-]?[1-9][0-9]*\.?[0-9]+$")
-    int_format = re.compile("^[\-]?[1-9][0-9]*$")
+    float_format = re.compile(r"^[-]?[1-9][0-9]*.?[0-9]+$")
+    int_format = re.compile(r"^[-]?[1-9][0-9]*$")
     test = ""
     if format == "int":
         test = re.match(int_format, n)
@@ -81,9 +81,11 @@
     template.close()
     output.close()
     
-    trash_out = open(trash_file, "w")
-    trash_out.write("\n".join(trash))
-    trash_out.close()
+    if trash:
+        print(trash)
+        trash_out = open(trash_file, "w")
+        trash_out.write("\n".join(trash))
+        trash_out.close()
 
 def options():
     parser = argparse.ArgumentParser()