view merge.xml @ 3:c0c988378838 draft

planemo upload commit 6bde05f38465311441e89cfa070f03d3b6edad1b
author nml
date Mon, 24 Oct 2016 16:23:11 -0400
parents 4263967e8d40
children 25136a2b0cfe
line wrap: on
line source

<tool id="collapse_dataset" name="Collapse Collection" version="3.0">
  <description>Collapse collection into single dataset in order of the collection</description>
  <command>
    <![CDATA[
    
     (
    #for $f in $input_list#
    #if $filename.add_name:
       #if str($filename.place_name) ==  "same_once":
           printf "$f.element_identifier\t"; cat "$f";
       #elif str($filename.place_name) ==  "same_multiple":
           awk '{print "$f.element_identifier\t"$0}' "$f";
       #elif str($filename.place_name) ==  "above":
           printf "$f.element_identifier\n"; cat "$f";
       #end if
    #else:
       cat "$f" ;
    #end if

    #end for#
    )
    > $output

    ]]>
    
  </command>
  <inputs>
     <param name="input_list" type="data" format="data" label="Collection of files to collapse into single dataset" help="" optional="false" multiple="true" />
     <conditional name="filename">
     <param name="add_name" type="boolean" display="checkboxes" label="Append File name"/>
     <when value="true">
       <param name="place_name" type="select" label="Where to add dataset name">
         <option value="same_once">Same line and only once per dataset</option>
         <option value="same_multiple">Same line and each line in dataset</option>
         <option value="above">Line Above</option>
       </param>
     </when>
     <when value='false'>
     </when>
     </conditional>
  </inputs>
  <outputs>
    <data name="output" format_source="input_list" ></data>
  </outputs>
  <tests>
    <test>
      <param name="input_list">
        <collection type="list">
	  <element name="input1" value="input1" />
          <element name="input2" value="input2" />
	</collection>
      </param>
      <output name="output" file="answer.txt"/>
    </test>
  </tests>
  <help>
	Combines a list collection into a single file dataset with option to include dataset names.
  </help>
  <citations>
  </citations>
</tool>