# HG changeset patch # User nedias # Date 1476245014 14400 # Node ID 3814470e221ae7f6553ca050a71f63e3a6645fd4 # Parent ec8fe63afdb847ad719459bda5e51827b2ee7bca Uploaded 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 @@ -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) + +