changeset 10:c0be9583df97 draft

Uploaded 20170525
author fabio
date Thu, 25 May 2017 17:58:15 -0400
parents 61989e353d24
children 9d24947d4335
files ._gdcwebapp.xml ._json_data_source_mod.py gdcwebapp.xml json_data_source_mod.py tool_dependencies.xml
diffstat 5 files changed, 23 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
Binary file ._gdcwebapp.xml has changed
Binary file ._json_data_source_mod.py has changed
--- a/gdcwebapp.xml	Thu May 25 15:49:07 2017 -0400
+++ b/gdcwebapp.xml	Thu May 25 17:58:15 2017 -0400
@@ -1,25 +1,24 @@
 <?xml version="1.0"?>
 <tool name="GDCWebApp" id="data_source_gdcwebapp" tool_type="data_source" hidden="False" display_interface="False" version="1.0.0" force_history_refresh="True">
     <description>an intuitive interface to filter, extract, and convert Genomic Data Commons experiments</description>
-    <requirements>
-        <requirement type="package" version="2.7.10">python</requirement>
-        <!--<requirement type="package" version="1.0.0">galaxy_json_data_source</requirement>-->
-    </requirements>
     <stdio>
         <exit_code range="1:" />
         <exit_code range=":-1" />
     </stdio>
-    <!--<version_command>json_data_source.py --version</version_command>-->
-    <!--<command>json_data_source.py "${__app__.config.output_size_limit}" --json_param_file "${output1}" --path "."</command>-->
-    <command interpreter="python">json_data_source_mod.py "${__app__.config.output_size_limit}" --json_param_file "${output1}" --path "." --appdata "${tool.name}"</command>
+    <command>
+        <![CDATA[
+            mkdir -p ${tool.name}_tmp && 
+            python ${__tool_directory__}/json_data_source_mod.py "${__app__.config.output_size_limit}" --json_param_file "${output1}" --path "." --appdata "${tool.name}_tmp"
+        ]]>
+    </command>
     <inputs check_values="False" action="http://bioinf.iasi.cnr.it/gdcwebapp/app.php" >
         <display>Go to GDCWebApp service $GALAXY_URL</display>
         <param name="URL" type="hidden" value="" />
     </inputs>
     <outputs>
-        <data name="output1" format="auto" />
-        <collection name="list_output" type="list:list" label="${tool.name} output">
-            <discover_datasets pattern="(?P&lt;archive_name&gt;.*)_(?P&lt;file_name&gt;.*)\..*" ext="auto" visible="True" directory="${tool.name}" />
+        <data name="output1" format="auto" visible="False" />
+        <collection name="list_output" type="list:list" label="${tool.name} Output Collection">
+            <discover_datasets pattern="(?P&lt;archive_name&gt;.*)_(?P&lt;file_name&gt;.*)\..*" ext="auto" visible="True" directory="${tool.name}_tmp" />
         </collection>
     </outputs>
     <options sanitize="False" refresh="True" />
--- a/json_data_source_mod.py	Thu May 25 15:49:07 2017 -0400
+++ b/json_data_source_mod.py	Thu May 25 17:58:15 2017 -0400
@@ -145,6 +145,7 @@
         extra_files_path = ''.join( [ target_output_filename, 'files' ] )
         download_extra_data( extra_data, extra_files_path )
 
+    """ the following code handles archives and decompress them in a collection """
     check_ext = ""
     if ( fname.endswith( "gz" ) ):
         check_ext = "r:gz"
@@ -157,25 +158,25 @@
             for entry in tf:
                 fileobj = tf.extractfile( entry )
                 if entry.isfile():
-                    """
-                    dataset_url, output_filename, \
-                        extra_files_path, file_name, \
-                        ext, out_data_name, \
-                        hda_id, dataset_id = set_up_config_values(json_params)
-                    """
+                    
+                    #dataset_url, output_filename, \
+                    #    extra_files_path, file_name, \
+                    #    ext, out_data_name, \
+                    #    hda_id, dataset_id = set_up_config_values(json_params)
+                    
                     filename = os.path.basename( entry.name )
                     extension = splitext( filename )
                     extra_data = None
                     #target_output_filename = output_filename
-                    """ (?P&lt;archive_name&gt;.*)_(?P&lt;file_name&gt;.*)\..* """
+                    # (?P&lt;archive_name&gt;.*)_(?P&lt;file_name&gt;.*)\..*
                     filename_with_collection_prefix = query_item.get( 'name' ) + "_" + filename
                     target_output_filename = os.path.join(appdata_path, filename_with_collection_prefix)
-                    """
-                    metadata_parameter_file.write( metadata_to_json_for_archive_entry( dataset_id, extension,
-                                                         filename, target_output_filename,
-                                                         ds_type='dataset',
-                                                         primary=primary) )
-                    """
+                    
+                    #metadata_parameter_file.write( metadata_to_json_for_archive_entry( dataset_id, extension,
+                    #                                     filename, target_output_filename,
+                    #                                     ds_type='dataset',
+                    #                                     primary=primary) )
+                    
                     store_file_from_archive( fileobj, target_output_filename )
     
     return True
--- a/tool_dependencies.xml	Thu May 25 15:49:07 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-    <package name="python" version="2.7.10">
-        <repository changeset_revision="0339c4a9b87b" name="package_python_2_7_10" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-    </package>
-    <!--<package name="galaxy_json_data_source" version="1.0.0">
-        <repository changeset_revision="5ea54764a6b9" name="package_galaxy_json_data_source" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-    </package>-->
-</tool_dependency>