Mercurial > repos > iuc > ampvis2_setmetadata
view setmetadata.xml @ 5:024a22e84bea draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit 9ed0c3078be166bd22136771f517ae91a5198ecf
author | iuc |
---|---|
date | Fri, 16 Aug 2024 09:03:21 +0000 |
parents | 0d18b4bb08cb |
children |
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_date(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 macro="metadata_select" an="name" argument="numbers" multiple="true" label="Numerical metadata variables"> <token name="options"> <filter type="param_value" column="0" ref="character" keep="false"/> </token> </expand> <expand macro="metadata_select" an="name" argument="integers" multiple="true" label="Discrete numerical metadata variables (integers)"> <token name="options"> <filter type="param_value" column="0" ref="character" keep="false"/> <filter type="param_value" column="0" ref="numbers" keep="false"/> </token> </expand> <expand macro="metadata_select" an="name" argument="dates" multiple="true" label="Date metadata variables"> <token name="options"> <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"/> </token> </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>