Mercurial > repos > iuc > ampvis2_setmetadata
view setmetadata.xml @ 1:e7afc79b841e draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit 40ca64669b0f8c875835fcf41ce91e6adb391283"
author | iuc |
---|---|
date | Thu, 07 Apr 2022 14:13:03 +0000 |
parents | 7499e3a586c0 |
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>