view lcbd.xml @ 0:fb7b2cbd80bb draft default tip

"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
author ecology
date Fri, 13 Aug 2021 18:17:38 +0000
parents
children
line wrap: on
line source

<tool id="ecology_beta_diversity" name="Local Contributions to Beta Diversity (LCBD)" version="@VERSION@" profile="20.01">
    <description>Computes a measure of beta diversity, SCBD and representations</description>
    <macros>
        <import>macro.xml</import>
    </macros>
    <requirements> 
        <requirement type="package" version="3.3.3">r-ggplot2</requirement>
        <requirement type="package" version="2.5_7">r-vegan</requirement>
        <requirement type="package" version="0.3_14">r-adespatial</requirement>
        <requirement type="package" version="3.1.3">r-tibble</requirement>
        <requirement type="package" version="1.0.7">r-dplyr</requirement>
        <requirement type="package" version="1.1.3">r-tidyr</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        Rscript
        '$__tool_directory__/graph_lcbd.r'
          '$input'
          '$colnames'
          '$abundance'
          '$location'
          '$species'
          '$date'
          #if $method.type == 'Graph':
            'TRUE'
            'FALSE'
            'FALSE'
            '$method.latitude'
            '$method.longitude'
            ''
          #elif $method.type == 'Separation':
            'FALSE'
            'TRUE'
            'FALSE'
            ''
            ''
            '$method.variable'
          #elif $method.type == 'Nothing':
            'FALSE'
            'FALSE'
            'TRUE'
            ''
            ''
            ''
          #end if
         '$__tool_directory__/functions.r'
          '$output_lcbd'
          '$output_scbd'
          '$plots'
           #if $rdata=='true'
             '$output_beta'
           #end if
        ]]>
        </command>
        <inputs>
            <expand macro="explo_input"/>
            <param name="abundance" label="Select column with abundances" type="data_column" data_ref="input" numerical="true" multiple="false" use_header_names="true"/>
            <param name="location" label="Select column with locations" type="data_column" data_ref="input" multiple="false" use_header_names="true"/>
            <param name="species" label="Select column containing taxon" type="data_column" data_ref="input" multiple="false" use_header_names="true"/>
            <param name="date" label="Select column containing dates" type="data_column" data_ref="input" multiple="false" use_header_names="true"/>
            <param name="rdata" type="boolean" checked="yes" label="Beta diversity object as .Rdata output ?"/>
            <conditional name="method">
                <param name="type" type="select" label="Other LCBD : spatialized representation or xy plot.">
                    <option value="Nothing">Don't want to do another graph</option>
                    <option value="Graph">Spatialized representation</option>
                    <option value="Separation">Separation to construct a new lcbd graph</option>
                </param>
                <when value="Graph">
                    <param name="latitude" label="Select column containing latitudes in decimal degrees" type="data_column" numerical="true" data_ref="input" multiple="false" use_header_names="true"/>
                    <param name="longitude" label="Select column containing longitudes in decimal degrees" type="data_column" numerical="true" data_ref="input" multiple="false" use_header_names="true"/>
                </when>
                <when value="Separation">
                    <param name="variable" type="data_column" data_ref="input" label="Select a column to make another graph according to the separation of the variable you choose" use_header_names="true"/>
                </when>
                <when value="Nothing"/>
            </conditional>
        </inputs>
        <outputs>
            <data name="output_lcbd" from_work_dir="LCBD.txt" format="txt" label="LCBD"/>
            <data name="output_scbd" from_work_dir="SCBD.txt" format="txt" label="Which species have a SCBD larger than the mean SCBD?"/>
            <data name="output_beta" from_work_dir="beta_diversity.Rdata" format="Rdata" label="Beta diversity, LCDB, SCBD - R object">
                <filter>rdata</filter>
            </data>
            <collection type="list" name="plots">
                <discover_datasets pattern="(?P&lt;designation&gt;.+)\.png" visible="false" format="png"/>
            </collection>
        </outputs>
        <tests>
            <test>
                <param name="input" value="Reel_life_survey_fish_modif.tabular"/>
                <param name="colnames" value="true"/>
                <param name="abundance" value="18"/>
                <param name="location" value="20"/>
                <param name="species" value="15"/>
                <param name="date" value="11"/>
                <param name="rdata" value="false"/>
                <conditional name="method">
                    <param name="type" value="Nothing"/>
                </conditional>
                <output name="output_lcbd">
                    <assert_contents>
                        <has_n_lines n="186"/>
                    </assert_contents>
                </output>
                <output name="output_scbd" value="SCBD.txt"/>
                <output_collection name="plots" type="list" count="3">
                    <element name="LCBD_sites_time" ftype="png">
                        <assert_contents>
                            <has_text text="PNG"/>
                        </assert_contents>
                    </element>
                    <element name="Mean_LCBD_through_time" ftype="png">
                        <assert_contents>
                            <has_text text="PNG"/>
                        </assert_contents>
                    </element>
                    <element name="SCBD_Species_Radar_plot" ftype="png">
                        <assert_contents>
                            <has_text text="PNG"/>
                        </assert_contents>
                    </element>
                </output_collection>
            </test>
        </tests>
        <expand macro="topic"/>  
        <help><![CDATA[
=======================================================================================
Computes measures of beta diversity : Species and Local Contributions to Beta Diversity 
=======================================================================================

**What it does**

This tool computes Species and Local Contributions to Beta Diversity (SCBD and LCBD) with Hellinger method and 9999 permutations from a species occurence file :

- **Creates two text files** : LCBD comparative indicators of the ecological uniqueness of the sites and SCBD degree of variation for individual species across the study area. The LCBD represents the degree of uniqueness of the sites in their taxonomic compositions. The "Beta diversity" value represents the total LCBD, hence if it equals 1, there is no taxon in common in sites, each site is entirely unique and if it equals 0, each site is identical in terms of their taxon composition.

- 3, 4 or 5 plots according to what you choose : 
    - A plot representing LCBD repartition according to sites and date ; ⚠️ hard to read over 40 dates and/or 70 sites
    - A plot representing mean LCDB and confidence intervals for each date ; ⚠️ hard to read over 40 dates
    - A radar plot representing  SCDB for each taxon ; ⚠️ hard to read over 80 taxons but every taxon is alphabetically classified clockwise on the radar plot so it should be easy to find the correspondance over this number
    - If you choose to get a spatialized representation, a map of LCBD values according to longitudes and latitudes ;
    - If you choose to get an additional LCBD representation, a plot of LCBD values through time for each values of the separation factor you chose. ⚠️ hard to read over 40 dates and/or 70 levels


**Input description**

A tabular file with observation data. Must at least contain four columns
which associate abundance, sites, dates and species ID.

+------------+-----------+--------------+------------+
|  abundance |   dates   | species.code |    site    |
+============+===========+==============+============+
|    2       |    2014   |   speciesID  |            |
+------------+-----------+--------------+------------+
|    ...     |    ...    |      ...     |    ...     |
+------------+-----------+--------------+------------+

If you choose to get a spatialized representation of the LCBD, you'll need to have two columns with your spatial coordinates latitude and longitude in decimal degrees.

**Output**

A text and png files. The text file contains a table with information on the beta diversity and the png files shows multiple plots according to one type of variable in order to vizualize the beta diversity.
|

    ]]></help>
    
<expand macro="book_bibref"/>

</tool>