changeset 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
files macros.xml melt.xml test-data/cast_result1.tabular test-data/melt_result1.tabular test-data/mtcars.txt
diffstat 5 files changed, 488 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Tue Aug 22 07:44:24 2017 -0400
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<macros>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@VERSION@">r-reshape2</requirement>
+        </requirements>
+    </xml>
+    <token name="@VERSION@">1.4.2</token>
+
+</macros>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/melt.xml	Tue Aug 22 07:44:24 2017 -0400
@@ -0,0 +1,59 @@
+<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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cast_result1.tabular	Tue Aug 22 07:44:24 2017 -0400
@@ -0,0 +1,33 @@
+brand	am	carb	cyl	disp	drat	gear	hp	mpg	qsec	vs	wt
+AMC Javelin	0	2	8	304	3.15	3	150	15.2	17.3	0	3.435
+Cadillac Fleetwood	0	4	8	472	2.93	3	205	10.4	17.98	0	5.25
+Camaro Z28	0	4	8	350	3.73	3	245	13.3	15.41	0	3.84
+Chrysler Imperial	0	4	8	440	3.23	3	230	14.7	17.42	0	5.345
+Datsun 710	1	1	4	108	3.85	4	93	22.8	18.61	1	2.32
+Dodge Challenger	0	2	8	318	2.76	3	150	15.5	16.87	0	3.52
+Duster 360	0	4	8	360	3.21	3	245	14.3	15.84	0	3.57
+Ferrari Dino	1	6	6	145	3.62	5	175	19.7	15.5	0	2.77
+Fiat 128	1	1	4	78.7	4.08	4	66	32.4	19.47	1	2.2
+Fiat X1-9	1	1	4	79	4.08	4	66	27.3	18.9	1	1.935
+Ford Pantera L	1	4	8	351	4.22	5	264	15.8	14.5	0	3.17
+Honda Civic	1	2	4	75.7	4.93	4	52	30.4	18.52	1	1.615
+Hornet 4 Drive	0	1	6	258	3.08	3	110	21.4	19.44	1	3.215
+Hornet Sportabout	0	2	8	360	3.15	3	175	18.7	17.02	0	3.44
+Lincoln Continental	0	4	8	460	3	3	215	10.4	17.82	0	5.424
+Lotus Europa	1	2	4	95.1	3.77	5	113	30.4	16.9	1	1.513
+Maserati Bora	1	8	8	301	3.54	5	335	15	14.6	0	3.57
+Mazda RX4	1	4	6	160	3.9	4	110	21	16.46	0	2.62
+Mazda RX4 Wag	1	4	6	160	3.9	4	110	21	17.02	0	2.875
+Merc 230	0	2	4	140.8	3.92	4	95	22.8	22.9	1	3.15
+Merc 240D	0	2	4	146.7	3.69	4	62	24.4	20	1	3.19
+Merc 280	0	4	6	167.6	3.92	4	123	19.2	18.3	1	3.44
+Merc 280C	0	4	6	167.6	3.92	4	123	17.8	18.9	1	3.44
+Merc 450SE	0	3	8	275.8	3.07	3	180	16.4	17.4	0	4.07
+Merc 450SL	0	3	8	275.8	3.07	3	180	17.3	17.6	0	3.73
+Merc 450SLC	0	3	8	275.8	3.07	3	180	15.2	18	0	3.78
+Pontiac Firebird	0	2	8	400	3.08	3	175	19.2	17.05	0	3.845
+Porsche 914-2	1	2	4	120.3	4.43	5	91	26	16.7	0	2.14
+Toyota Corolla	1	1	4	71.1	4.22	4	65	33.9	19.9	1	1.835
+Toyota Corona	0	1	4	120.1	3.7	3	97	21.5	20.01	1	2.465
+Valiant	0	1	6	225	2.76	3	105	18.1	20.22	1	3.46
+Volvo 142E	1	2	4	121	4.11	4	109	21.4	18.6	1	2.78
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/melt_result1.tabular	Tue Aug 22 07:44:24 2017 -0400
@@ -0,0 +1,353 @@
+brand	variable	value
+Mazda RX4	mpg	21
+Mazda RX4 Wag	mpg	21
+Datsun 710	mpg	22.8
+Hornet 4 Drive	mpg	21.4
+Hornet Sportabout	mpg	18.7
+Valiant	mpg	18.1
+Duster 360	mpg	14.3
+Merc 240D	mpg	24.4
+Merc 230	mpg	22.8
+Merc 280	mpg	19.2
+Merc 280C	mpg	17.8
+Merc 450SE	mpg	16.4
+Merc 450SL	mpg	17.3
+Merc 450SLC	mpg	15.2
+Cadillac Fleetwood	mpg	10.4
+Lincoln Continental	mpg	10.4
+Chrysler Imperial	mpg	14.7
+Fiat 128	mpg	32.4
+Honda Civic	mpg	30.4
+Toyota Corolla	mpg	33.9
+Toyota Corona	mpg	21.5
+Dodge Challenger	mpg	15.5
+AMC Javelin	mpg	15.2
+Camaro Z28	mpg	13.3
+Pontiac Firebird	mpg	19.2
+Fiat X1-9	mpg	27.3
+Porsche 914-2	mpg	26
+Lotus Europa	mpg	30.4
+Ford Pantera L	mpg	15.8
+Ferrari Dino	mpg	19.7
+Maserati Bora	mpg	15
+Volvo 142E	mpg	21.4
+Mazda RX4	cyl	6
+Mazda RX4 Wag	cyl	6
+Datsun 710	cyl	4
+Hornet 4 Drive	cyl	6
+Hornet Sportabout	cyl	8
+Valiant	cyl	6
+Duster 360	cyl	8
+Merc 240D	cyl	4
+Merc 230	cyl	4
+Merc 280	cyl	6
+Merc 280C	cyl	6
+Merc 450SE	cyl	8
+Merc 450SL	cyl	8
+Merc 450SLC	cyl	8
+Cadillac Fleetwood	cyl	8
+Lincoln Continental	cyl	8
+Chrysler Imperial	cyl	8
+Fiat 128	cyl	4
+Honda Civic	cyl	4
+Toyota Corolla	cyl	4
+Toyota Corona	cyl	4
+Dodge Challenger	cyl	8
+AMC Javelin	cyl	8
+Camaro Z28	cyl	8
+Pontiac Firebird	cyl	8
+Fiat X1-9	cyl	4
+Porsche 914-2	cyl	4
+Lotus Europa	cyl	4
+Ford Pantera L	cyl	8
+Ferrari Dino	cyl	6
+Maserati Bora	cyl	8
+Volvo 142E	cyl	4
+Mazda RX4	disp	160
+Mazda RX4 Wag	disp	160
+Datsun 710	disp	108
+Hornet 4 Drive	disp	258
+Hornet Sportabout	disp	360
+Valiant	disp	225
+Duster 360	disp	360
+Merc 240D	disp	146.7
+Merc 230	disp	140.8
+Merc 280	disp	167.6
+Merc 280C	disp	167.6
+Merc 450SE	disp	275.8
+Merc 450SL	disp	275.8
+Merc 450SLC	disp	275.8
+Cadillac Fleetwood	disp	472
+Lincoln Continental	disp	460
+Chrysler Imperial	disp	440
+Fiat 128	disp	78.7
+Honda Civic	disp	75.7
+Toyota Corolla	disp	71.1
+Toyota Corona	disp	120.1
+Dodge Challenger	disp	318
+AMC Javelin	disp	304
+Camaro Z28	disp	350
+Pontiac Firebird	disp	400
+Fiat X1-9	disp	79
+Porsche 914-2	disp	120.3
+Lotus Europa	disp	95.1
+Ford Pantera L	disp	351
+Ferrari Dino	disp	145
+Maserati Bora	disp	301
+Volvo 142E	disp	121
+Mazda RX4	hp	110
+Mazda RX4 Wag	hp	110
+Datsun 710	hp	93
+Hornet 4 Drive	hp	110
+Hornet Sportabout	hp	175
+Valiant	hp	105
+Duster 360	hp	245
+Merc 240D	hp	62
+Merc 230	hp	95
+Merc 280	hp	123
+Merc 280C	hp	123
+Merc 450SE	hp	180
+Merc 450SL	hp	180
+Merc 450SLC	hp	180
+Cadillac Fleetwood	hp	205
+Lincoln Continental	hp	215
+Chrysler Imperial	hp	230
+Fiat 128	hp	66
+Honda Civic	hp	52
+Toyota Corolla	hp	65
+Toyota Corona	hp	97
+Dodge Challenger	hp	150
+AMC Javelin	hp	150
+Camaro Z28	hp	245
+Pontiac Firebird	hp	175
+Fiat X1-9	hp	66
+Porsche 914-2	hp	91
+Lotus Europa	hp	113
+Ford Pantera L	hp	264
+Ferrari Dino	hp	175
+Maserati Bora	hp	335
+Volvo 142E	hp	109
+Mazda RX4	drat	3.9
+Mazda RX4 Wag	drat	3.9
+Datsun 710	drat	3.85
+Hornet 4 Drive	drat	3.08
+Hornet Sportabout	drat	3.15
+Valiant	drat	2.76
+Duster 360	drat	3.21
+Merc 240D	drat	3.69
+Merc 230	drat	3.92
+Merc 280	drat	3.92
+Merc 280C	drat	3.92
+Merc 450SE	drat	3.07
+Merc 450SL	drat	3.07
+Merc 450SLC	drat	3.07
+Cadillac Fleetwood	drat	2.93
+Lincoln Continental	drat	3
+Chrysler Imperial	drat	3.23
+Fiat 128	drat	4.08
+Honda Civic	drat	4.93
+Toyota Corolla	drat	4.22
+Toyota Corona	drat	3.7
+Dodge Challenger	drat	2.76
+AMC Javelin	drat	3.15
+Camaro Z28	drat	3.73
+Pontiac Firebird	drat	3.08
+Fiat X1-9	drat	4.08
+Porsche 914-2	drat	4.43
+Lotus Europa	drat	3.77
+Ford Pantera L	drat	4.22
+Ferrari Dino	drat	3.62
+Maserati Bora	drat	3.54
+Volvo 142E	drat	4.11
+Mazda RX4	wt	2.62
+Mazda RX4 Wag	wt	2.875
+Datsun 710	wt	2.32
+Hornet 4 Drive	wt	3.215
+Hornet Sportabout	wt	3.44
+Valiant	wt	3.46
+Duster 360	wt	3.57
+Merc 240D	wt	3.19
+Merc 230	wt	3.15
+Merc 280	wt	3.44
+Merc 280C	wt	3.44
+Merc 450SE	wt	4.07
+Merc 450SL	wt	3.73
+Merc 450SLC	wt	3.78
+Cadillac Fleetwood	wt	5.25
+Lincoln Continental	wt	5.424
+Chrysler Imperial	wt	5.345
+Fiat 128	wt	2.2
+Honda Civic	wt	1.615
+Toyota Corolla	wt	1.835
+Toyota Corona	wt	2.465
+Dodge Challenger	wt	3.52
+AMC Javelin	wt	3.435
+Camaro Z28	wt	3.84
+Pontiac Firebird	wt	3.845
+Fiat X1-9	wt	1.935
+Porsche 914-2	wt	2.14
+Lotus Europa	wt	1.513
+Ford Pantera L	wt	3.17
+Ferrari Dino	wt	2.77
+Maserati Bora	wt	3.57
+Volvo 142E	wt	2.78
+Mazda RX4	qsec	16.46
+Mazda RX4 Wag	qsec	17.02
+Datsun 710	qsec	18.61
+Hornet 4 Drive	qsec	19.44
+Hornet Sportabout	qsec	17.02
+Valiant	qsec	20.22
+Duster 360	qsec	15.84
+Merc 240D	qsec	20
+Merc 230	qsec	22.9
+Merc 280	qsec	18.3
+Merc 280C	qsec	18.9
+Merc 450SE	qsec	17.4
+Merc 450SL	qsec	17.6
+Merc 450SLC	qsec	18
+Cadillac Fleetwood	qsec	17.98
+Lincoln Continental	qsec	17.82
+Chrysler Imperial	qsec	17.42
+Fiat 128	qsec	19.47
+Honda Civic	qsec	18.52
+Toyota Corolla	qsec	19.9
+Toyota Corona	qsec	20.01
+Dodge Challenger	qsec	16.87
+AMC Javelin	qsec	17.3
+Camaro Z28	qsec	15.41
+Pontiac Firebird	qsec	17.05
+Fiat X1-9	qsec	18.9
+Porsche 914-2	qsec	16.7
+Lotus Europa	qsec	16.9
+Ford Pantera L	qsec	14.5
+Ferrari Dino	qsec	15.5
+Maserati Bora	qsec	14.6
+Volvo 142E	qsec	18.6
+Mazda RX4	vs	0
+Mazda RX4 Wag	vs	0
+Datsun 710	vs	1
+Hornet 4 Drive	vs	1
+Hornet Sportabout	vs	0
+Valiant	vs	1
+Duster 360	vs	0
+Merc 240D	vs	1
+Merc 230	vs	1
+Merc 280	vs	1
+Merc 280C	vs	1
+Merc 450SE	vs	0
+Merc 450SL	vs	0
+Merc 450SLC	vs	0
+Cadillac Fleetwood	vs	0
+Lincoln Continental	vs	0
+Chrysler Imperial	vs	0
+Fiat 128	vs	1
+Honda Civic	vs	1
+Toyota Corolla	vs	1
+Toyota Corona	vs	1
+Dodge Challenger	vs	0
+AMC Javelin	vs	0
+Camaro Z28	vs	0
+Pontiac Firebird	vs	0
+Fiat X1-9	vs	1
+Porsche 914-2	vs	0
+Lotus Europa	vs	1
+Ford Pantera L	vs	0
+Ferrari Dino	vs	0
+Maserati Bora	vs	0
+Volvo 142E	vs	1
+Mazda RX4	am	1
+Mazda RX4 Wag	am	1
+Datsun 710	am	1
+Hornet 4 Drive	am	0
+Hornet Sportabout	am	0
+Valiant	am	0
+Duster 360	am	0
+Merc 240D	am	0
+Merc 230	am	0
+Merc 280	am	0
+Merc 280C	am	0
+Merc 450SE	am	0
+Merc 450SL	am	0
+Merc 450SLC	am	0
+Cadillac Fleetwood	am	0
+Lincoln Continental	am	0
+Chrysler Imperial	am	0
+Fiat 128	am	1
+Honda Civic	am	1
+Toyota Corolla	am	1
+Toyota Corona	am	0
+Dodge Challenger	am	0
+AMC Javelin	am	0
+Camaro Z28	am	0
+Pontiac Firebird	am	0
+Fiat X1-9	am	1
+Porsche 914-2	am	1
+Lotus Europa	am	1
+Ford Pantera L	am	1
+Ferrari Dino	am	1
+Maserati Bora	am	1
+Volvo 142E	am	1
+Mazda RX4	gear	4
+Mazda RX4 Wag	gear	4
+Datsun 710	gear	4
+Hornet 4 Drive	gear	3
+Hornet Sportabout	gear	3
+Valiant	gear	3
+Duster 360	gear	3
+Merc 240D	gear	4
+Merc 230	gear	4
+Merc 280	gear	4
+Merc 280C	gear	4
+Merc 450SE	gear	3
+Merc 450SL	gear	3
+Merc 450SLC	gear	3
+Cadillac Fleetwood	gear	3
+Lincoln Continental	gear	3
+Chrysler Imperial	gear	3
+Fiat 128	gear	4
+Honda Civic	gear	4
+Toyota Corolla	gear	4
+Toyota Corona	gear	3
+Dodge Challenger	gear	3
+AMC Javelin	gear	3
+Camaro Z28	gear	3
+Pontiac Firebird	gear	3
+Fiat X1-9	gear	4
+Porsche 914-2	gear	5
+Lotus Europa	gear	5
+Ford Pantera L	gear	5
+Ferrari Dino	gear	5
+Maserati Bora	gear	5
+Volvo 142E	gear	4
+Mazda RX4	carb	4
+Mazda RX4 Wag	carb	4
+Datsun 710	carb	1
+Hornet 4 Drive	carb	1
+Hornet Sportabout	carb	2
+Valiant	carb	1
+Duster 360	carb	4
+Merc 240D	carb	2
+Merc 230	carb	2
+Merc 280	carb	4
+Merc 280C	carb	4
+Merc 450SE	carb	3
+Merc 450SL	carb	3
+Merc 450SLC	carb	3
+Cadillac Fleetwood	carb	4
+Lincoln Continental	carb	4
+Chrysler Imperial	carb	4
+Fiat 128	carb	1
+Honda Civic	carb	2
+Toyota Corolla	carb	1
+Toyota Corona	carb	1
+Dodge Challenger	carb	2
+AMC Javelin	carb	2
+Camaro Z28	carb	4
+Pontiac Firebird	carb	2
+Fiat X1-9	carb	1
+Porsche 914-2	carb	2
+Lotus Europa	carb	2
+Ford Pantera L	carb	4
+Ferrari Dino	carb	6
+Maserati Bora	carb	8
+Volvo 142E	carb	2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/mtcars.txt	Tue Aug 22 07:44:24 2017 -0400
@@ -0,0 +1,33 @@
+brand	mpg	cyl	disp	hp	drat	wt	qsec	vs	am	gear	carb
+Mazda RX4	21	6	160	110	3.9	2.62	16.46	0	1	4	4
+Mazda RX4 Wag	21	6	160	110	3.9	2.875	17.02	0	1	4	4
+Datsun 710	22.8	4	108	93	3.85	2.32	18.61	1	1	4	1
+Hornet 4 Drive	21.4	6	258	110	3.08	3.215	19.44	1	0	3	1
+Hornet Sportabout	18.7	8	360	175	3.15	3.44	17.02	0	0	3	2
+Valiant	18.1	6	225	105	2.76	3.46	20.22	1	0	3	1
+Duster 360	14.3	8	360	245	3.21	3.57	15.84	0	0	3	4
+Merc 240D	24.4	4	146.7	62	3.69	3.19	20	1	0	4	2
+Merc 230	22.8	4	140.8	95	3.92	3.15	22.9	1	0	4	2
+Merc 280	19.2	6	167.6	123	3.92	3.44	18.3	1	0	4	4
+Merc 280C	17.8	6	167.6	123	3.92	3.44	18.9	1	0	4	4
+Merc 450SE	16.4	8	275.8	180	3.07	4.07	17.4	0	0	3	3
+Merc 450SL	17.3	8	275.8	180	3.07	3.73	17.6	0	0	3	3
+Merc 450SLC	15.2	8	275.8	180	3.07	3.78	18	0	0	3	3
+Cadillac Fleetwood	10.4	8	472	205	2.93	5.25	17.98	0	0	3	4
+Lincoln Continental	10.4	8	460	215	3	5.424	17.82	0	0	3	4
+Chrysler Imperial	14.7	8	440	230	3.23	5.345	17.42	0	0	3	4
+Fiat 128	32.4	4	78.7	66	4.08	2.2	19.47	1	1	4	1
+Honda Civic	30.4	4	75.7	52	4.93	1.615	18.52	1	1	4	2
+Toyota Corolla	33.9	4	71.1	65	4.22	1.835	19.9	1	1	4	1
+Toyota Corona	21.5	4	120.1	97	3.7	2.465	20.01	1	0	3	1
+Dodge Challenger	15.5	8	318	150	2.76	3.52	16.87	0	0	3	2
+AMC Javelin	15.2	8	304	150	3.15	3.435	17.3	0	0	3	2
+Camaro Z28	13.3	8	350	245	3.73	3.84	15.41	0	0	3	4
+Pontiac Firebird	19.2	8	400	175	3.08	3.845	17.05	0	0	3	2
+Fiat X1-9	27.3	4	79	66	4.08	1.935	18.9	1	1	4	1
+Porsche 914-2	26	4	120.3	91	4.43	2.14	16.7	0	1	5	2
+Lotus Europa	30.4	4	95.1	113	3.77	1.513	16.9	1	1	5	2
+Ford Pantera L	15.8	8	351	264	4.22	3.17	14.5	0	1	5	4
+Ferrari Dino	19.7	6	145	175	3.62	2.77	15.5	0	1	5	6
+Maserati Bora	15	8	301	335	3.54	3.57	14.6	0	1	5	8
+Volvo 142E	21.4	4	121	109	4.11	2.78	18.6	1	1	4	2