changeset 1:3814470e221a draft

Uploaded
author nedias
date Wed, 12 Oct 2016 00:03:34 -0400
parents ec8fe63afdb8
children c56b8a6bd02e
files entry.py
diffstat 1 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/entry.py	Wed Oct 12 00:03:34 2016 -0400
@@ -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)
+
+