view melt.xml @ 0:317ed0ee8bf2 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/reshape2 commit 62172bde663955b6c3cb86dc22c47739824f014a
author iuc
date Tue, 22 Aug 2017 07:44:24 -0400
parents
children
line wrap: on
line source

<tool id="melt" name="melt" version="@VERSION@">
    <description>collapse combinations of variables:values to single lines</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"></expand>
    <command detect_errors="exit_code"><![CDATA[
cat '$script' &&
Rscript '$script'
    ]]></command>
    <configfiles>
        <configfile name="script"><![CDATA[
## Setup R error handling to go to stderr
options(show.error.messages=F, error=function(){cat(geterrmessage(),file=stderr());q("no",1,F)})
loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")

## Import library
library("reshape2")

input <- read.csv('$input', sep='\t', header=TRUE)
minput <- melt(input)
write.table(minput, "output.tabular", sep="\t", quote=FALSE, row.names=FALSE)

        ]]></configfile>
    </configfiles>
    <inputs>
        <param name="input" type="data" format="tabular" label="Input should have column headers - these will be the variable IDs that are summarized"/>
       
    </inputs>
    <outputs>
        <data name="output" format="tabular" from_work_dir="output.tabular"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="mtcars.txt"/>
            <output name="output" file="melt_result1.tabular"/>
        </test>
    </tests>
    <help><![CDATA[
This tool will apply the melt function of the reshape2 R package. 

The melt function summarizes each unique variable:value combination on a single line. An example can be found here: http://www.statmethods.net/management/reshape.html

    ]]></help>
    <citations>
        <citation type="bibtex">
@Article{,
    title = {Reshaping Data with the {reshape} Package},
    author = {Hadley Wickham},
    journal = {Journal of Statistical Software},
    year = {2007},
    volume = {21},
    number = {12},
    pages = {1--20},
    url = {http://www.jstatsoft.org/v21/i12/},
  }
        </citation>
    </citations>
</tool>