view run_idw_interpolation.xml @ 0:d07fcc660f3c draft

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/interpolation commit 450e4496f243d6e94d5238358873bbc014fe2f08
author ecology
date Mon, 08 Jan 2024 10:32:25 +0000
parents
children
line wrap: on
line source

<tool id="interpolation_run_idw_interpolation" name="Run interpolation" version="1.0" profile="22.05">
    <description>based on Inverse Distance Weighting (IDW)</description>
    <requirements>
        <requirement type="package" version="1.20.4">r-getopt</requirement>
        <requirement type="package" version="3.3_4">r-tmap</requirement>
        <requirement type="package" version="3.6_26">r-raster</requirement>
        <requirement type="package" version="2.1_1">r-gstat</requirement>
    </requirements>
    <command detect_errors='exit_code'><![CDATA[
    Rscript '$__tool_directory__/run_idw_interpolation.R'
        --observationsCsv '$observations_csv'
        --latitudeColumn '$latitude_column'
        --longitudeColumn '$longitude_column'
        --observationsColumn '$observations_column' 
        --studyArea '$study_area'
        --idwPower '$idw_power' 
        --samplePoints '$sample_points' 
        --sampleType '$sample_type'
        --legendLabel '$legend_label'
        --legendPosition '$legend_position'
        --numberClasses '$number_classes'
        --dotSize '$dot_size'
        --colorType '$color_type'
        --testCase '$test_case'  
        --outputData '$output'
    ]]></command>
    <inputs>
        <param type="data" format="csv" name="observations_csv" label="Select the .csv file including the observations"/>
        <param type="data" format="geojson" name="study_area" label="Select the .geojson containing the study area"/>
        <param name="latitude_column" type="data_column" data_ref="observations_csv" label="In which column are the latitude coordinates?"/>
        <param name="longitude_column" type="data_column" data_ref="observations_csv" label="In which column are the longitude coordinates?"/>
        <param name="observations_column" type="data_column" data_ref="observations_csv" label="In which column are the observation values?"/>
        <param value="2" min="0.1" max="5" type="float" name="idw_power" label="Select the interpolation power of the IDW method"/>
        <param value="50000" min="1000" max="100000" type="integer" name="sample_points" label="Select the number of sample points"/>
        <param type="select" name="sample_type" label="Select a sample type">
            <option value="regular">Regular</option>
            <option value="random">Random</option>
            <option value="stratified">Stratified</option>
            <option value="nonaligned">Nonaligned</option>
        </param>
        <param type="text" name="legend_label" label="Enter a label for the legend"/>
        <param type="select" name="legend_position" label="Should the legend be displayed inside or outside the frame?">
            <option value="false">Inside</option>
            <option value="true">Outside</option>
        </param>
        <param value="0.2" min="0.1" max="2" type="float" name="dot_size" label="Select the dot size of the points shown on the map"/>
        <param value="10" min="1" max="100" type="integer" name="number_classes" label="Number of classes" help="Note: Not all values are possible. tmap tries to generate a number of classes which are as close to the indicated value as possible"/>
        <param type="select" name="color_type" label="Select a color palette">
            <option value="RdBu">RdBu</option>
            <option value="Blues">Blues</option>
            <option value="BuGn">BuGn</option>
            <option value="BuPu">BuPu</option>
            <option value="GnBu">GnBu</option>
            <option value="Greens">Greens</option>
            <option value="Greys">Greys</option>
            <option value="Oranges">Oranges</option>
            <option value="OrRd">OrRd</option>
            <option value="PuBu">PuBu</option>
            <option value="PuBuGn ">PuBuGn</option>
            <option value="PuRd">PuRd</option>
            <option value="Purples">Purples</option>
            <option value="RdPu">RdPu</option>
            <option value="Reds">Reds</option>
            <option value="YlGn">YlGn</option>
            <option value="YlGnBu">YlGnBu</option>
            <option value="YlOrBr">YlOrBr</option>
            <option value="YlOrRd">YlOrRd</option>
        </param>
        <param type="boolean" name="test_case" label="Should a seed be set?" truevalue="true" falsevalue="false" />
    </inputs>
    <outputs>
        <data name="output" format="png" />
    </outputs>
    <tests>
        <!-- Run test with: planemo test - -biocontainers plotInterpolationMap.xml - -test_output=plotInterpolationMap.html -->
        <test>
            <param name="observations_csv" value="run_idw_interpolation_test_input1.csv"/>
            <param name="latitude_column" value="3"/>
            <param name="longitude_column" value="4"/>
            <param name="observations_column" value="5"/>
            <param name="study_area" value="run_idw_interpolation_test_input2.geojson"/>
            <param name="idw_power" value="2"/>
            <param name="sample_points" value="50000"/>
            <param name="sample_type" value="regular"/>
            <param name="legend_label" value="Legend"/>
            <param name="legend_position" value="false"/>
            <param name="number_classes" value="10"/>
            <param name="dot_size" value="1"/>
            <param name="color_type" value="RdBu"/>
            <param name="test_case" value="true"/>
            <output name="output" file="run_idw_interpolation_test_output.png" compare="sim_size" delta_frac="0.1"/>
        </test>
    </tests>
    <help><![CDATA[
        IDW stands for Inverse Distance Weighting. The .csv file contains the observations and the .geojson file the study area. The plot is stored as a .png file. 
    ]]></help>
    <citations>
        <citation type="doi">10.32614/RJ-2018-009</citation>
        <citation type="doi">10.18637/jss.v084.i06</citation>
        <citation type="doi">10.32614/RJ-2016-014</citation>
    </citations>
</tool>