Mercurial > repos > proteore > proteore_reactome
comparison 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 |
comparison
equal
deleted
inserted
replaced
3:be06c14e543d | 4:878128362e33 |
---|---|
21 | 21 |
22 def isnumber(format, n): | 22 def isnumber(format, n): |
23 """ | 23 """ |
24 Check if an variable is numeric | 24 Check if an variable is numeric |
25 """ | 25 """ |
26 float_format = re.compile("^[\-]?[1-9][0-9]*\.?[0-9]+$") | 26 float_format = re.compile(r"^[-]?[1-9][0-9]*.?[0-9]+$") |
27 int_format = re.compile("^[\-]?[1-9][0-9]*$") | 27 int_format = re.compile(r"^[-]?[1-9][0-9]*$") |
28 test = "" | 28 test = "" |
29 if format == "int": | 29 if format == "int": |
30 test = re.match(int_format, n) | 30 test = re.match(int_format, n) |
31 elif format == "float": | 31 elif format == "float": |
32 test = re.match(float_format, n) | 32 test = re.match(float_format, n) |
79 except ValueError: | 79 except ValueError: |
80 output.write("An error occurred due to unavailability of Reactome web service. Please return later.") | 80 output.write("An error occurred due to unavailability of Reactome web service. Please return later.") |
81 template.close() | 81 template.close() |
82 output.close() | 82 output.close() |
83 | 83 |
84 trash_out = open(trash_file, "w") | 84 if trash: |
85 trash_out.write("\n".join(trash)) | 85 print(trash) |
86 trash_out.close() | 86 trash_out = open(trash_file, "w") |
87 trash_out.write("\n".join(trash)) | |
88 trash_out.close() | |
87 | 89 |
88 def options(): | 90 def options(): |
89 parser = argparse.ArgumentParser() | 91 parser = argparse.ArgumentParser() |
90 argument = parser.add_argument("--json", nargs="+", required=True) | 92 argument = parser.add_argument("--json", nargs="+", required=True) |
91 argument = parser.add_argument("--output", default="output.html") | 93 argument = parser.add_argument("--output", default="output.html") |