changeset 11:517691812452 draft

planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc.git commit 3f5361a7226127ec8b8d6cb5591b5bb4f52bb6fe
author sanbi-uwc
date Tue, 17 May 2016 03:45:58 -0400
parents cb322069c7bc
children 7d49ea27d9f6
files build_ctb_gene.py build_ctb_gene.xml
diffstat 2 files changed, 15 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/build_ctb_gene.py	Mon May 16 10:34:46 2016 -0400
+++ b/build_ctb_gene.py	Tue May 17 03:45:58 2016 -0400
@@ -21,43 +21,25 @@
         '''
 
         # Check whether the options are specified and saves them into the object
-        assert args != None
+        #assert args != None
         self.args = args
 
     def build_ctb_gene(self, output_file1, output_dir, input_file, mount_point):
-        # cmdline_str = "build_ctb_gene goterms ${}".format(input_file)
+        #cmdline_str = "build_ctb_gene goterms ${}".format(input_file)
+        #cmdline_str = "build_ctb_gene goterms --help"
         cmdline_str = "touch /tmp/foo.bar"
         build_ctb = False
         cmdline_str = self.newSplit(cmdline_str)
         try:
             check_call(cmdline_str)
-            build_ctb = True
+            #build_ctb = True
         except CalledProcessError:
             print("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:
-            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 f in files:
-                output_file1 += "<tr><td>" + f + "</td></tr>"
-            output_file1 += """</table></div></body></html>\n"""
+        self.copy_output_file_to_dataset()
+        self.args.output_file1 = self.args.outputdir
 
-        self.copy_output_file_to_dataset()
-        return output_file1
-
-    def newSplit(value):
+    def newSplit(self, value):
         lex = shlex.shlex(value)
         lex.quotes = '"'
         lex.whitespace_split = True
@@ -71,9 +53,12 @@
 
         # retrieve neo4j files to the working gx directory
         result_file = glob.glob(self.args.mount_point + '/*')
-        with open(result_file[0], 'rb') as fsrc:
-            with open(self.args.outputdir, 'wb') as fdest:
-                shutil.copyfileobj(fsrc, fdest)
+        for file_name in result_file:
+            shutil.copy(file_name, self.args.outputdir)
+
+        #with open(result_file[0], 'rb') as fsrc:
+            #with open(self.args.outputdir, 'wb') as fdest:
+            #shutil.copy(fsrc, self.args.outputdir)
 
 
 def main():
@@ -103,3 +88,4 @@
 
 
 if __name__ == "__main__": main()
+
--- a/build_ctb_gene.xml	Mon May 16 10:34:46 2016 -0400
+++ b/build_ctb_gene.xml	Tue May 17 03:45:58 2016 -0400
@@ -9,7 +9,7 @@
         <exit_code range="1:" />
     </stdio>
     <command interpreter="python">
-        build_ctb_gene.py '${outputFile1}' --outputdir ${outputFile2.files_path} --input_file ${input_file} --mount_point ${neo4j_data_mount_point} --username ${db_settings.neo4j_db_username} --password ${db_settings.neo4j_db_password} --url ${db_settings.neo4j_db_url} --port ${db_settings.neo4j_db_port}
+        build_ctb_gene.py '${outputFile1}' --outputdir ${outputFile2} --input_file ${input_file} --mount_point ${neo4j_data_mount_point} --username ${db_settings.neo4j_db_username} --password ${db_settings.neo4j_db_password} --url ${db_settings.neo4j_db_url} --port ${db_settings.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" />