view gmql_rest_datasets_download.xml @ 0:35d52820e7c7 draft default tip

planemo upload for repository https://github.com/lu-brn/gmql-galaxy commit 953ee36ceda5814dc9baa03427bc0eb4ee2e93bd-dirty
author geco-team
date Tue, 26 Jun 2018 09:01:39 -0400
parents
children
line wrap: on
line source

<tool id="gmql_download" name="GMLQ Import Dataset" version="0.1.1">
  <macros>
    <import>gmql_rest_macros.xml</import>
  </macros>
    <command><![CDATA[
        #if $operation == 'import' :
         python $__tool_directory__/gmql_rest_datasets.py '' -user=$authToken -cmd=import -dataset=${dataset}
        #else :
         python $__tool_directory__/gmql_rest_datasets.py $ds_archive -user=$authToken -cmd=download -dataset=${dataset}
        #end if
	  ]]></command>
    <code file="dynamic_utils.py">
        <hook validate_input="validate" />
    </code>
    <inputs>
        <param format="gmql_user" name="authToken" type="data" label="Select user" />
        <param name="gmql_datasets" type="data" format="gmql_repository" label="Working Datasets"/>
        <param name="dataset" type="select" label="Select Dataset">
            <options from_dataset="gmql_datasets">
                <column name="value" index="0"/>
                <filter column="1" type="static_value" value="public" keep="false"/>
            </options>
        </param>
        <param name="operation" type="select" display="radio" multiple="false" label="Select the desired action">
            <option value="import">Import data as a collection</option>
            <option value="zip">Download zip archive</option>
        </param>
    </inputs>
    <outputs>
        <data format="zip" name="ds_archive" label="${dataset} Compressed Archive">
            <filter>operation == 'zip'</filter>
        </data>
        <collection name="query_results_m" type="list" label="${dataset} metadata">
            <discover_datasets pattern="(?P&lt;identifier_0&gt;[\w]+)\.(?P&lt;ext&gt;[^\._]+)?"
                               directory="metadata"/>
            <filter>operation == 'import'</filter>
        </collection>
        <collection name="query_results_s" type="list" label="${dataset}">
            <discover_datasets pattern="(?P&lt;identifier_0&gt;[\w]+)\.(?P&lt;ext&gt;[^\._]+)?"
                               directory="samples"/>
            <filter>operation == 'import'</filter>
        </collection>
    </outputs>
    <tests>
        <test>
            <param name="authToken" value="guest.gmql_user" />
            <param name="gmql_datasets" value="rep.gmql_repository" />
            <param name="dataset" value="Example1" />
            <param name="operation" value="zip" />
            <output name="ds_archive" file="Example1_Archive.zip" compare="sim_size" delta="0"/>
        </test>
        <test>
            <param name="authToken" value="guest.gmql_user" />
            <param name="gmql_datasets" value="rep.gmql_repository" />
            <param name="dataset" value="Example1" />
            <param name="operation" value="import" />
            <collection name="query_results_s" type="list">
               <metadata name="name" value="Example1" />
               <discovered_dataset designation="sample1" file="sample1.bed"/>
               <discovered_dataset designation="sample2" file="sample2.bed"/>
               <discovered_dataset designation="sample3" file="sample3.bed"/>
            </collection>
            <collection name="query_results_m" type="list">
               <metadata name="name" value="Example1 metadata" />
               <discovered_dataset designation="sample1" file="sample1.bed.meta"/>
               <discovered_dataset designation="sample2" file="sample2.bed.meta"/>
               <discovered_dataset designation="sample3" file="sample3.bed.meta"/>
            </collection>
        </test>
    </tests>
    <help>
It allows importing in the current Galaxy history the selected dataset.

----

**What it does**

- **Import as Collection**: returning data consist of two collections, one for samples and one for their metadata
- **Download ZIP Archive**: returns the dataset as a zip archive


The user provides a list of datasets (gmql_repository file) and selects from there the dataset he wants to import.

.. class:: warningmark

A gmql_user authentication token is required for every action.

  </help>
  <expand macro="citations" />
</tool>