Mercurial > repos > sanbi-uwc > build_ctb_gene
changeset 4:714cbeae0b96 draft
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc.git commit 43f091b6ac53f9754906c0be9ab6ced467cb3535
author | sanbi-uwc |
---|---|
date | Mon, 16 May 2016 04:20:19 -0400 |
parents | 65558b5914fc |
children | 6098213127d7 |
files | build_ctb_gene.py build_ctb_gene.xml |
diffstat | 2 files changed, 107 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build_ctb_gene.py Mon May 16 04:20:19 2016 -0400 @@ -0,0 +1,61 @@ +#!/usr/bin/env python +from __future__ import print_function +import argparse +import os +import sys +import glob + +import logging +log = logging.getLogger( __name__ ) + +def build_ctb_gene(output_file1, output_dir, input_file, mount_point ): + #cmdline_str = "build_ctb_gene goterms ${}".format(input_file) + cmdline_str = "echo goterms" + build_ctb = False + try: + os.system(cmdline_str) + build_ctb = True + except: + log.debug("Error running the build_ctb_gene goterms", file=sys.stderr) + + # Read the files at the mount point and load the html file + if build_ctb == True: + files=glob.glob(mount_point) + output_file1 = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="generator" content="Galaxy %s tool output - see http://g2.trac.bx.psu.edu/" /> + <title></title> + <link rel="stylesheet" href="/static/style/base.css" type="text/css" /> + </head> + <body> + <div class="toolFormBody"> + <table> + <th>Files</th> + """ + for file in files: + output_file1 += """<tr><td>file</td></tr>""" + output_file1 += """</table></div></body></html>\n""" + + +def main(): + parser = argparse.ArgumentParser(description="Generate a BAM file from the Novo Align tool") + parser.add_argument('output_file1') + parser.add_argument('output_dir') + parser.add_argument('--input_file') + parser.add_argument('--mount_point') + parser.add_argument('--username') + parser.add_argument('--password') + parser.add_argument('--url') + parser.add_argument('--port') + args = parser.parse_args() + + export_cmd = "export NEO4J_REST_URL=http://${neo4j_db_username}:${neo4j_db_password}@${neo4j_db_url}:${neo4j_db_port}/db/data/" + try: + os.system(export_cmd) + except: + log.debug("Error exporting the NEO4J db environmental values") + + build_ctb_gene(args.output_file1, args.output_dir, args.input_file, args.mount_point) + +if __name__ == "__main__": main()
--- a/build_ctb_gene.xml Tue May 10 14:55:23 2016 -0400 +++ b/build_ctb_gene.xml Mon May 16 04:20:19 2016 -0400 @@ -1,26 +1,63 @@ <?xml version="1.0" encoding="utf-8" ?> <tool id="build_ctb_gene" name="Build_ctb_gene Tool" version="1.0"> <requirements> - <requirement type="package" version="0.1">build_ctb_gene</requirement> + <requirement type="package" version="0.1">build_ctb_gene_neo4j</requirement> </requirements> <description> build_ctb_gene is the tool used to extract data about genes using locus_tags </description> <stdio> <exit_code range=":-1" /> <exit_code range="1:" /> </stdio> - <command> - export NEO4J_REST_URL=http://${neo4j_db_username}:${neo4j_db_password}@${neo4j_db_url}:${neo4j_db_port}/db/data/ && - build_ctb_gene goterms ${input_file} + <command interpreter="python"> + build_ctb_gene.py '${outputFile1}' --outputdir ${outputFile2.files_path} --input_file ${input_file} --mount_point ${neo4j_data_mount_point} \ + --username ${neo4j_db_username} --password ${neo4j_db_password} --url ${neo4j_db_url} --port ${neo4j_db_port} </command> <inputs> <param name="input_file" type="data" format="gff" label="Choose the GFF file" help="Specify the GFF file" optional="False" /> - <param type="text" name="neo4j_db_url" value="" label="Neo4j database URL" optional="False" /> - <param type="text" name="neo4j_db_port" value="" label="Neo4j database port" optional="False" /> - <param type="text" name="neo4j_db_username" value="" label="Neo4j database username" optional="False" /> - <param type="text" name="neo4j_db_password" value="" label="Neo4j database password" optional="False" /> + <param type="text" name="neo4j_data_mount_point" value="" label="Neo4j data mount point" place-holder="/mnt/neo4j/data/lib" optional="False" /> + <section name="db_settings" title="Neo4j Backend Database Settings" expanded="True"> + <param type="text" name="neo4j_db_url" value="" label="Neo4j database URL" optional="False" /> + <param type="text" name="neo4j_db_port" value="" label="Neo4j database port" optional="False" /> + <param type="text" name="neo4j_db_username" value="" label="Neo4j database username" optional="False" /> + <param type="text" name="neo4j_db_password" value="" label="Neo4j database password" optional="False" /> + </section> </inputs> <outputs> - <data format="txt" name="out_file" /> + <data format="neo4j" name="outputFile1"/> + <data format="neostore" name="outputFile2"/> + <!--<data format="neostore" name="outputFile3"/> + <data format="neostore" name="outputFile4"/> + <data format="neostore" name="outputFile5"/> + <data format="neostore" name="outputFile6"/> + <data format="neostore" name="outputFile7"/> + <data format="neostore" name="outputFile8"/> + <data format="neostore" name="outputFile9"/> + <data format="neostore" name="outputFile10"/> + <data format="neostore" name="outputFile11"/> + <data format="neostore" name="outputFile12"/> + <data format="neostore" name="outputFile13"/> + <data format="neostore" name="outputFile14"/> + <data format="neostore" name="outputFile15"/> + <data format="neostore" name="outputFile16"/> + <data format="neostore" name="outputFile17"/> + <data format="neostore" name="outputFile18"/> + <data format="neostore" name="outputFile19"/> + <data format="neostore" name="outputFile20"/> + <data format="neostore" name="outputFile21"/> + <data format="neostore" name="outputFile22"/> + <data format="neostore" name="outputFile23"/> + <data format="neostore" name="outputFile24"/> + <data format="neostore" name="outputFile25"/> + <data format="neostore" name="outputFile26"/> + <data format="neostore" name="outputFile27"/> + <data format="neostore" name="outputFile28"/> + <data format="neostore" name="outputFile29"/> + <data format="neostore" name="outputFile30"/> + <data format="neostore" name="outputFile31"/> + <data format="neostore" name="outputFile32"/> + <data format="neostore" name="outputFile33"/> + <data format="neostore" name="outputFile34"/> + <data format="neostore" name="outputFile35"/> --> </outputs> <help>Help!</help> <citations>