Repository 'orf_tools'
hg clone https://toolshed.g2.bx.psu.edu/repos/nedias/orf_tools

Changeset 1:3814470e221a (2016-10-12)
Previous changeset 0:ec8fe63afdb8 (2016-10-12) Next changeset 2:c56b8a6bd02e (2016-10-12)
Commit message:
Uploaded
added:
entry.py
b
diff -r ec8fe63afdb8 -r 3814470e221a entry.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/entry.py Wed Oct 12 00:03:34 2016 -0400
b
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+"""
+ Python script, served as the entry of open reading frame searching tool
+ Separated the API with actual functionality (for Galaxy and future Web API)
+
+ Use -v or --version to get the version, -h or --help for help.
+
+ Author Nedias Sept 2016
+
+"""
+import sys
+from optparse import OptionParser
+import orf_tool
+
+# Usage message
+usage = """Use as follows:
+$ python entry.py -i input_seq_file -l length_of_designated_match
+"""
+
+# User OptionParser to separate all optional arguments of the commandline
+parser = OptionParser(usage=usage)
+parser.add_option('-i', '--input', dest='input',
+                  default=None, help='Input sequences filename',
+                  metavar="FILE")
+parser.add_option("-l", "--length", dest="length",
+                  default=100,
+                  help="Set the length of designated match, length is the percentage of the longest match")
+parser.add_option("-f", "--format", dest="format",
+                  default="fasta",
+                  help="Set the format of input file")
+parser.add_option("-v", "--version", dest="version",
+                  default=False, action="store_true",
+                  help="Show version and quit")
+parser.add_option("-a", "--outputall", dest="outputa",
+                  default=None,
+                  help="Output of all matches",
+   metavar="FILE")
+parser.add_option("-d", "--outputdest", dest="outputd",
+                  default=None,
+                  help="Output of designated matches",
+                  metavar="FILE")
+
+options, args = parser.parse_args()
+
+# Show version data (TODO:consider move to orf_tool.py)
+if options.version:
+    print("v0.1.0")
+    sys.exit(0)
+
+# Call actual function
+else:
+    orf_tool.exec_tool(options)
+
+