# HG changeset patch # User sanbi-uwc # Date 1463471158 14400 # Node ID 51769181245290f18f7ca6dbd5b06912b8bb140e # Parent cb322069c7bcb313f331858a68d13dc34019329e planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc.git commit 3f5361a7226127ec8b8d6cb5591b5bb4f52bb6fe diff -r cb322069c7bc -r 517691812452 build_ctb_gene.py --- 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 = """ - - - - - - - -
- - - """ - for f in files: - output_file1 += "" - output_file1 += """
Files
" + f + "
\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() + diff -r cb322069c7bc -r 517691812452 build_ctb_gene.xml --- 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 @@ - 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}