changeset 1:cc5ae94acf01 draft default tip

planemo upload commit 2b9ef766ea9ee24964464363a9d41faeefa3d360-dirty
author devteam
date Wed, 26 Aug 2015 11:50:48 -0400
parents 367878cb3698
children
files data_manager/bwa_index_builder.py data_manager/bwa_index_builder.xml tool_dependencies.xml
diffstat 3 files changed, 10 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/bwa_index_builder.py	Fri Mar 28 14:18:43 2014 -0400
+++ b/data_manager/bwa_index_builder.py	Wed Aug 26 11:50:48 2015 -0400
@@ -7,7 +7,7 @@
 import optparse
 import subprocess
 
-from galaxy.util.json import from_json_string, to_json_string
+from json import loads, dumps
 
 
 CHUNK_SIZE = 2**20
@@ -46,20 +46,11 @@
     if color_space:
         args.append( '-c' )
     args.append( sym_linked_fasta_filename )
-    tmp_stderr = tempfile.NamedTemporaryFile( prefix = "tmp-data-manager-bwa-index-builder-stderr" )
-    proc = subprocess.Popen( args=args, shell=False, cwd=target_directory, stderr=tmp_stderr.fileno() )
+    proc = subprocess.Popen( args=args, shell=False, cwd=target_directory )
     return_code = proc.wait()
     if return_code:
-        tmp_stderr.flush()
-        tmp_stderr.seek(0)
-        print >> sys.stderr, "Error building index:"
-        while True:
-            chunk = tmp_stderr.read( CHUNK_SIZE )
-            if not chunk:
-                break
-            sys.stderr.write( chunk )
+        print >> sys.stderr, "Error building index."
         sys.exit( return_code )
-    tmp_stderr.close()
     data_table_entry = dict( value=sequence_id, dbkey=dbkey, name=sequence_name, path=fasta_base_name )
     _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry )
 
@@ -81,7 +72,7 @@
     
     filename = args[0]
     
-    params = from_json_string( open( filename ).read() )
+    params = loads( open( filename ).read() )
     target_directory = params[ 'output_data' ][0]['extra_files_path']
     os.mkdir( target_directory )
     data_manager_dict = {}
@@ -97,6 +88,6 @@
     build_bwa_index( data_manager_dict, options.fasta_filename, params, target_directory, dbkey, sequence_id, sequence_name, data_table_name=options.data_table_name or DEFAULT_DATA_TABLE_NAME, color_space=options.color_space )
     
     #save info to json file
-    open( filename, 'wb' ).write( to_json_string( data_manager_dict ) )
+    open( filename, 'wb' ).write( dumps( data_manager_dict ) )
         
 if __name__ == "__main__": main()
--- a/data_manager/bwa_index_builder.xml	Fri Mar 28 14:18:43 2014 -0400
+++ b/data_manager/bwa_index_builder.xml	Wed Aug 26 11:50:48 2015 -0400
@@ -4,6 +4,10 @@
         <requirement type="package" version="0.5.9">bwa</requirement>
     </requirements>
     <command interpreter="python">bwa_index_builder.py "${out_file}" --fasta_filename "${all_fasta_source.fields.path}" --fasta_dbkey "${all_fasta_source.fields.dbkey}" --fasta_description "${all_fasta_source.fields.name}" --data_table_name "bwa_indexes"</command>
+    <stdio>
+        <exit_code range=":-1" />
+        <exit_code range="1:" />
+    </stdio>
     <inputs>
         <param name="all_fasta_source" type="select" label="Source FASTA Sequence">
             <options from_data_table="all_fasta"/>
--- a/tool_dependencies.xml	Fri Mar 28 14:18:43 2014 -0400
+++ b/tool_dependencies.xml	Wed Aug 26 11:50:48 2015 -0400
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <tool_dependency>
     <package name="bwa" version="0.5.9">
-        <repository changeset_revision="ec2595e4d313" name="package_bwa_0_5_9" owner="devteam" toolshed="http://toolshed.g2.bx.psu.edu" />
+        <repository changeset_revision="ec2595e4d313" name="package_bwa_0_5_9" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>