view PAMPA_GLM_SP.xml @ 2:6c14021f678e draft

"planemo upload for repository https://github.com/ColineRoyaux/PAMPA-Galaxy commit 3df1978827a91be30e815dee2ed83a92862d1b1c"
author ecology
date Sun, 22 Nov 2020 18:40:40 +0000
parents e972fe2bffee
children c12897ba5f83
line wrap: on
line source

<tool id="pampa_glmsp" name="Compute GLM on population data" version="@VERSION@">
    <description>Compute a GLM of your choice on population data</description>
    <macros>
        <import>pampa_macros.xml</import>
    </macros>
    <expand macro="GLM_requirements"/>
    <command detect_errors="exit_code"><![CDATA[
        Rscript 
         '$__tool_directory__/FunctExeCalcGLMSpGalaxy.r' 
         '$input_metric'
         '$input_unitobs'
         '$varint'
         '$varrep'
         '$varrand'
         'species.code'
         #if $settings.advanced=='advanced' 
             $settings.distrib
             $settings.rdata
         #else
             'None'
             'false'
         #end if
         'unitSp'
         '$__tool_directory__/FunctPAMPAGalaxy.r' 
         '$output_summary'
         '$output_recap'
         #if $settings.advanced=='advanced'
             #if $settings.rdata=='true'
                 '$output_GLM'
             #end if
         #end if
    ]]>
    </command>
    <inputs>
        <expand macro="pampa_input_GLM"/>
        <expand macro="pampa_var_GLM"/>
        <conditional name="settings">
            <expand macro="pampa_advanced_params_select_GLM"/>
        </conditional>
    </inputs>
    <outputs>
        <data name="output_summary" from_work_dir="GLMSummary.tabular" format="tabular" label="GLM - Results from your population analysis on ${on_string}"/>
        <expand macro="pampa_output_GLM"/>
    </outputs>
    <tests>
        <test expect_num_outputs="4"> 
            <param name="input_metric" value="Presence_absence_table_sansszcl_cropped.tabular"/>
            <param name="input_unitobs" value="Unitobs.tabular"/>
            <param name="varint" value="4"/>
            <param name="varrep" value="year,site,habitat"/>
            <param name="varrand" value="site"/>
            <param name="advanced" value="advanced"/>
            <param name="distrib" value="None"/>
            <param name="rdata" value="true"/>
            <output name="output_summary">
                <assert_contents> 
                    <has_n_lines n="4"/>
                </assert_contents> 
            </output>
            <output name="output_recap">  
                <assert_contents> 
                    <has_n_lines n="606"/>
                </assert_contents> 
            </output>     
            <output name="output_rate">
                <assert_contents> 
                    <has_n_lines n="45"/>
                </assert_contents> 
            </output>
            <output_collection name="output_GLM"  type="list" count="3">
                <element name="GLM_Abalstel" ftype="Rdata">
                    <assert_contents> 
                        <has_size value="199219" delta="10000"/>
                    </assert_contents> 
                </element>
                <element name="GLM_Hemifasc" ftype="Rdata">
                    <assert_contents> 
                        <has_size value="202264" delta="10000"/>
                    </assert_contents> 
                </element>
                <element name="GLM_Zebrscop" ftype="Rdata">
                    <assert_contents> 
                        <has_size value="207311" delta="10000"/>
                    </assert_contents> 
                </element>
            </output_collection>
        </test>
    </tests>
    <edam_topics>
       <edam_topic>topic_0610</edam_topic>
       <edam_topic>topic_3050</edam_topic>
    </edam_topics>
    <help><![CDATA[
===============================================================
Compute GLM on population data with selected interest variables
===============================================================

**What it does**

This tool from PAMPA toolsuite computes Generalized Linear Models on population data. 

It allows user to choose composition of the model :

- Interest variable among numeric or integer variables of the input file

- Response variables among year, site and/or habitat

- Allocation of random effect on year and/or site

|

**Input description**

A tabular file with population data. Must at least contain three or four columns depending on the case : 

- ['year' and 'location'] or ['observation.unit'] 

- 'species.code'

- At least one population metric 

+------------------+--------------+---------+---------+-----+       
| observation.unit | species.code | metric1 | metric2 | ... |            
+==================+==============+=========+=========+=====+        
|   site_yearID    | species code |    2    |   0.4   | ... |            
+------------------+--------------+---------+---------+-----+        
|        ...       |      ...     |   ...   |   ...   | ... |       
+------------------+--------------+---------+---------+-----+           

OR

+------+----------+--------------+---------+---------+-----+
| year | location | species.code | metric1 | metric2 | ... |
+======+==========+==============+=========+=========+=====+
| 2000 |locationID| species code |    2    |   0.4   | ... |
+------+----------+--------------+---------+---------+-----+
|  ... |    ...   |      ...     |   ...   |   ...   | ... |
+------+----------+--------------+---------+---------+-----+

The first input may be extracted from the 'Calculate presence absence' tool.

A tabular file with unitobs or location data which contains at least as much columns as used response variables and separation factor in addition with the 'observation.unit' or 'location' and 'species.code' column.

+--------------------------------+--------------+---------+--------+------------+-----+       
| observation.unit OR location   | species.code |  site   |  year  |  habitat   | ... |            
+================================+==============+=========+========+============+=====+        
|  site_yearID     OR locationID | species code | site ID |  2000  | habitatID  | ... |            
+--------------------------------+--------------+---------+--------+------------+-----+        
|              ...               |      ...     |   ...   |   ...  |     ...    | ... |       
+--------------------------------+--------------+---------+--------+------------+-----+ 

The site may represent the same entity as the location or represent an aggregation of several locations.

|

**Output**

Two text files : 

- A first text file with GLM results. One analysis per species.

- A second text file with simple statistics on the whole dataset.

|

**Source**

Derived from PAMPA scripts (https://wwz.ifremer.fr/pampa/Meth.-Outils/Outils) written by Yves Reecht.

  ]]></help>

  <expand macro="pampa_bibref" />
</tool>