Mercurial > repos > iuc > reshape2_cast
comparison cast.xml @ 0:8c13694c3847 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:43:00 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:8c13694c3847 |
|---|---|
| 1 <tool id="cast" name="cast" version="@VERSION@"> | |
| 2 <description>expand combinations of variables:values to columnar format</description> | |
| 3 <macros> | |
| 4 <import>macros.xml</import> | |
| 5 </macros> | |
| 6 <expand macro="requirements"></expand> | |
| 7 <command detect_errors="exit_code"><![CDATA[ | |
| 8 cat '$script' && | |
| 9 Rscript '$script' | |
| 10 ]]></command> | |
| 11 <configfiles> | |
| 12 <configfile name="script"><![CDATA[ | |
| 13 ## Setup R error handling to go to stderr | |
| 14 options(show.error.messages=F, error=function(){cat(geterrmessage(),file=stderr());q("no",1,F)}) | |
| 15 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") | |
| 16 | |
| 17 ## Import library | |
| 18 library("reshape2") | |
| 19 | |
| 20 input <- read.csv('$input', sep='\t', header=TRUE) | |
| 21 cinput <- dcast(input, ... ~ variable) | |
| 22 write.table(cinput, "output.tabular", sep="\t", quote=FALSE, row.names=FALSE) | |
| 23 | |
| 24 ]]></configfile> | |
| 25 </configfiles> | |
| 26 <inputs> | |
| 27 <param name="input" type="data" format="tabular" label="Input should be molten data"/> | |
| 28 </inputs> | |
| 29 <outputs> | |
| 30 <data name="output" format="tabular" from_work_dir="output.tabular"/> | |
| 31 </outputs> | |
| 32 <tests> | |
| 33 <test> | |
| 34 <param name="input" value="melt_result1.tabular"/> | |
| 35 <output name="output" file="cast_result1.tabular"/> | |
| 36 </test> | |
| 37 </tests> | |
| 38 <help><![CDATA[ | |
| 39 This tool will apply the dcast function of the reshape2 R package. The input data should be in a 'long' format or molten by the melt tool. The output will be in a wide format. | |
| 40 The cast function expands each unique variable:value combination on a single line to columnar format. Documantation on the reshape2 package can be found here: https://cran.r-project.org/web/packages/reshape2/reshape2.pdf | |
| 41 ]]></help> | |
| 42 <citations> | |
| 43 <citation type="bibtex"> | |
| 44 @Article{, | |
| 45 title = {Reshaping Data with the {reshape} Package}, | |
| 46 author = {Hadley Wickham}, | |
| 47 journal = {Journal of Statistical Software}, | |
| 48 year = {2007}, | |
| 49 volume = {21}, | |
| 50 number = {12}, | |
| 51 pages = {1--20}, | |
| 52 url = {http://www.jstatsoft.org/v21/i12/}, | |
| 53 } | |
| 54 </citation> | |
| 55 </citations> | |
| 56 </tool> |
