view setmetadata.xml @ 0:7499e3a586c0 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit 7c0ecbffdb5e993f5af7e3b52c424c2761fb91d3"
author iuc
date Mon, 04 Apr 2022 10:30:36 +0000
parents
children 20a46ce12854
line wrap: on
line source

<tool id="ampvis2_setmetadata" name="ampvis2 set metadata" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT">
    <description>types</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="header"/>
    <command detect_errors="exit_code"><![CDATA[
        Rscript '$rscript'
    ]]></command>
    <configfiles>
        <configfile name="rscript"><![CDATA[
            library(lubridate, quietly = TRUE)
            data <- readRDS("$data")
            #for col in $numbers
                data\$metadata\$$col <- as.numeric(data\$metadata\$$col)
            #end for
            #for col in $integers
                data\$metadata\$$col <- as.integer(data\$metadata\$$col)
            #end for
            #for col in $dates
                data\$metadata\$$col <- as_datetime(data\$metadata\$$col)
            #end for
            saveRDS(data, "$ampvis")
            @SAVE_METADATA_LIST@
        ]]></configfile>
    </configfiles>
    <inputs>
        <expand macro="rds_metadata_input_macro" metadata_optional="false"/>
        <expand macro="metadata_select" an="name" argument="character" multiple="true" label="Character metadata variables">
        </expand>
        <expand macro="metadata_select" an="name" argument="numbers" multiple="true" label="Numerical metadata variables">
            <filter type="param_value" column="0" ref="character" keep="false"/>
        </expand>
        <expand macro="metadata_select" an="name" argument="integers" multiple="true" label="Discrete numerical metadata variables (integers)">
            <filter type="param_value" column="0" ref="character" keep="false"/>
            <filter type="param_value" column="0" ref="numbers" keep="false"/>
        </expand>
        <expand macro="metadata_select" an="name" argument="dates" multiple="true" label="Date metadata variables">
            <filter type="param_value" column="0" ref="character" keep="false"/>
            <filter type="param_value" column="0" ref="numbers" keep="false"/>
            <filter type="param_value" column="0" ref="integers" keep="false"/>
        </expand>
    </inputs>
    <outputs>
        <data name="ampvis" format="ampvis2"/>
        <data name="metadata_list_out" format="tabular" label="${tool.name} on ${on_string}: metadata list"/>
    </outputs>
    <tests>
        <!-- -->
        <test expect_num_outputs="2">
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/>
            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
            <param name="numbers" value="Year"/>
            <param name="dates" value="Date"/>
            <output name="ampvis" ftype="ampvis2">
                <assert_contents>
                    <has_size value="11966" delta="1000"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
What it does
============

Allows to manually set the data types of metadata. `ampvis2: load` tries to
detect the metadata data types automatically. If this is not as desired
the data types can be set manually with this tool.

Input
=====

@HELP_RDS_INPUT@

@HELP_METADATA_LIST_INPUT@

Output
======

**RDS**

The main output of the tool is an RDS data set that contains the R representation of
the ampvis2 object containing the same data as the input, but with data types changes
as chosen in the input form.

**Metadata list file**

Updated metadata (only column 4 should change and reflect the desired datatype changes).
    ]]></help>
    <expand macro="citations"/>
</tool>