view make_eml.xml @ 4:59349973537f draft

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
author ecology
date Sat, 23 Dec 2023 20:41:10 +0000
parents 8a697f446051
children 4cf24a95c4ff
line wrap: on
line source

<tool id="makeeml" name="Make EML" version="0.1.1+galaxy1" profile="22.05">
    <description> Create EML from EAL templates</description>
    <requirements>
        <container type="docker">outils-patrinat.mnhn.fr/metashark:latest</container>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
    
    mkdir output_template &&
    #for $input in $templates
        ln -s '$input' 'output_template/${input.element_identifier}';
    #end for
   
    #set $table = ""
    mkdir data_files && 
    #for $indata in $inputdata
        ln -s '$indata' 'data_files/${indata.element_identifier}';
        #set $table += $indata.element_identifier + " ";
    #end for
    
    #set $raster = ""
    #for $data_raster in $dataraster
        ln -s '$data_raster' 'data_files/${data_raster.element_identifier}';
        #set $raster += $data_raster.element_identifier + " ";
    #end for
    
    #set $vector = ""
    #for $data_vector in $datavector
        ln -s '$data_vector' 'data_files/${data_vector.element_identifier}';
        #set $vector += $data_vector.element_identifier + " ";
    #end for
    
    #set $other = ""
    #for $data_other in $dataother
        ln -s '$data_other' 'data_files/${data_other.element_identifier}';
        #set $other += $data_other.element_identifier + " ";
    #end for
  
    #set $quotetable ="" 
    #for $q in $table_quote 
       #set $quotetable += $q.quote + ",";
    #end for 

    
    Rscript 
     '$__tool_directory__/make_eml.R' 2> err.txt
     '$title'
     '$temporal_coverage.start'
     '$temporal_coverage.end'
     '$table'
     '$raster'
     '$vector'
     '$other'
     '$destable'
     '$desraster'
     '$desvector'
     '$desother'
     '$quotetable'
     '$table_url'
     '$other_url'
     '$raster_url'
     '$vector_url'
		
    ]]></command>
    <inputs>
        <param name="templates" type="data" multiple="True" label="Upload all EAL templates" help="You can upload dataset collection or upload templates one by one (especially if there are multiple format)."/>
        <param name="title" type="text" label="Title for your dataset." />
      <section name="temporal_coverage" title="Temporal coverage" expanded="true">
	<param name="start" type="text" label="Beginning date of the dataset in the format YYYY-MM-DD" optional="false"/>
	<param name="end" type="text" label="Ending date of the dataset in the format YYYY-MM-DD" optional="false"/>
      </section>
      <section name="data_table" title="Do you have data table ? " >
        <param name="inputdata" type="data_collection"  collection_type="list"  label="Upload all data files wich are data table" help= "Input a data collection." optional = "true"/>
        <param name="destable" type="text" label="Give a short description of your data file. If there is multiple data files please separate your descriptions with a comma (,) in the same order of your data input" optional = "true"/>
        <repeat name="table_quote" title="What's the quotes of your data table ? Repeat this parameter as many time as the number of data tables you've input and in the same order" >
                <param name="quote" type="select" label="What's the quotes of your data table ?" optional="true">
                 <option value="quote">Quote</option>
                 <option value="apostrophe">Apostrophe</option>
                 <option value="none">None</option>
                </param>
        </repeat>
        <param name="table_url" type="text" label="Give the publicly accessible URL from which your data table can be downloaded. If more than one, data files please separate your URLs with a comma (,) in the same order of your data input. If wanting to include URLs for some but not all then use a - for those that don't have a URL." optional = "true"/>
      </section>
      <section name="data_raster" title="Do you have raster data ? " >
        <param name="dataraster" type="data_collection"  collection_type="list"  label="Upload all data files wich are spatial raster" help= "Input a data collection." optional = "true"/>
        <param name="desraster" type="text" label="Give a short description of your data file. If there is multiple data files please separate your descriptions with a comma (,) in the same order of your data input" optional = "true"/>
        <param name="raster_url" type="text" label="Give the publicly accessible URL from which your raster data entity can be downloaded. If more than one, data files please separate your URLs with a comma (,) in the same order of your data input. If wanting to include URLs for some but not all then use a - for those that don't have a URL." optional = "true"/>
      </section>
      <section name="data_vector" title="Do you have vector data ? " >
        <param name="datavector" type="data_collection"  collection_type="list"  label="Upload all data files wich are spatial vector" help= "Input a data collection." optional = "true"/>
        <param name="desvector" type="text" label="Give a short description of your data file. If there is multiple data files please separate your descriptions with a comma (,) in the same order of your data input" optional = "true"/>
        <param name="vector_url" type="text" label="Give the publicly accessible URL from which your vector data entity can be downloaded. If more than one, data files please separate your URLs with a comma (,) in the same order of your data input. If wanting to include URLs for some but not all then use a - for those that don't have a URL." optional = "true"/>
      </section>
      <section name="data_other" title="Do you have other data entity ? " >
        <param name="dataother" type="data_collection"  collection_type="list"  label="Upload all data files wich are other entity" help= "Input a data collection." optional = "true"/>
        <param name="desother" type="text" label="Give a short description of your data file. If there is multiple data files please separate your descriptions with a comma (,) in the same order of your data input" optional = "true"/>
        <param name="other_url" type="text" label="Give the publicly accessible URL from which your other data entity can be downloaded. If more than one, data files please separate your URLs with a comma (,) in the same order of your data input. If wanting to include URLs for some but not all then use a - for those that don't have a URL." optional = "true"/>
      </section>
    </inputs>
    <outputs>
		 <data name="metadataout" from_work_dir="eml.xml" format="xml" label="EML"/>
		 <data name="error" from_work_dir="err.txt" format="txt" label="Warning message"/>
    </outputs>
    <tests>
        <test expect_num_outputs="2"> 
            <param name="templates" value="annotations.txt,keywords.txt,attributes_data_blary_al.txt,catvars_data_blary_al.txt,geographic_coverage.tabular,personnel.txt" >
            </param>
            <output name="metadataout" >
                <assert_contents>
                    <is_valid_xml />
                    <xml_element path="./dataset"/>
                </assert_contents>
            </output>
        </test>
    </tests>
<help><![CDATA[


**What it does?**
--------------------

This tool produce EML metadata from EAL templates.
This tool can be used in the continuation of the eml2eal tool.

**How to use it?**
--------------------
To use this tool, you can select, in your history a data collection with EAL templates or select templates one by one.

To do so you can select the **Upload file** tool, select the *Collection* tab, upload all your templates, click on the *Start* button to integrate the files to Galaxy and then click
on *Build*. You will need to choose a name and select *Create collection* to build a collection with your templates.
You also can upload your files to Galaxy, select them in the history by clicking the *Select items* button, click on the newly appeared box on the right and select *Build dataset list*.

 .. class:: infomark 
 
 Templates can be directly edited in Galaxy (view **eml2eal** tool for more information.)
 


]]></help>
</tool>