Commit 44dfe31e authored by Yakubov, Sergey's avatar Yakubov, Sergey
Browse files

Merge branch '108-update-export-tool-to-export-multiple-collection' into 'dev'

update export tool to support multiple collections

Closes #108

See merge request ndip/galaxy-tools!182
parents 305bfa10 648836ae
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
<?xml version="1.0"?>
<tool name="Export Datasets" id="neutrons_export" version="0.2.0" profile="22.05">
<tool name="Export Datasets" id="neutrons_export" version="0.3.0" profile="22.05">
  <description>to SNS/HFIR storage</description>
    <requirements>
        <container type="docker">alpine:3.17</container>
    </requirements>
    <command><![CDATA[
        #from pathlib import Path
        #if $input_mode.input_mode_collection == 'true':
            mkdir -p $input_mode.export_folder &&
            #for $el in $input_mode.input:
        #for $s in $series
          #if $s.input_mode.input_mode_collection == 'true':
            mkdir -p $s.input_mode.export_folder &&
            #for $el in $s.input_mode.input:
               #set $name = str($el.element_identifier)
               #if Path($name).suffix == '':
                #set $name=$name + '.'+$el.ext
               #end if
               cp '$el' '$input_mode.export_folder/$name' &&
               echo '$input_mode.export_folder/$name' >> $output &&
               cp '$el' '$s.input_mode.export_folder/$name' &&
               echo '$s.input_mode.export_folder/$name' >> $output &&
            #end for
          #else:
            #for $i, $s in enumerate($input_mode.series)
                cp '${s.input}' '${s.export_path}' &&
                echo '${s.export_path}'>> $output &&
            #end for
                cp '${s.input_mode.input}' '${s.input_mode.export_path}' &&
                echo '${s.input_mode.export_path}'>> $output &&
          #end if
        #end for
        :
    ]]>
    </command>
  <inputs>
      <repeat name="series" title="Data">
       <conditional name="input_mode">
            <param name="input_mode_collection" type="boolean" truevalue="true" falsevalue="false" label="Export dataset collection"
            help=""/>
@@ -34,12 +35,11 @@
                <param name="export_folder" type="text" optional="false" default="" label="Export folder"/>
            </when>
            <when value="false">
                 <repeat name="series" title="Datasets">
                    <param name="input" type="data" label="Dataset"/>
                    <param name="export_path" type="text" optional="false" default="" label="Export path"/>
                </repeat>
            </when>
        </conditional>
       </repeat>
  </inputs>
    <outputs>
        <data name="output" auto_format="true" label="exported files"/>