Mercurial > repos > iuc > ggplot2_heatmap2
comparison heatmap2.xml @ 4:ca7cb0eaad62 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/heatmap2 commit e7b5919a8e06595b23e8fc31b975fc508f5081b3
author | iuc |
---|---|
date | Mon, 11 Feb 2019 17:32:28 -0500 |
parents | 4955e9bb96d1 |
children | 3b37b1b1c3a7 |
comparison
equal
deleted
inserted
replaced
3:4955e9bb96d1 | 4:ca7cb0eaad62 |
---|---|
1 <tool id="ggplot2_heatmap2" name="heatmap2" version="@VERSION@+galaxy1"> | 1 <tool id="ggplot2_heatmap2" name="heatmap2" version="@VERSION@"> |
2 <macros> | 2 <macros> |
3 <import>macros.xml</import> | 3 <token name="@VERSION@">3.0.1</token> |
4 </macros> | 4 </macros> |
5 <requirements> | 5 <requirements> |
6 <requirement type="package" version="3.0.1">r-gplots</requirement> | 6 <requirement type="package" version="@VERSION@">r-gplots</requirement> |
7 <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement> | 7 <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement> |
8 </requirements> | 8 </requirements> |
9 <command detect_errors="exit_code"><![CDATA[ | 9 <command detect_errors="exit_code"><![CDATA[ |
10 cat '$script' && | 10 cat '$script' && |
11 Rscript '$script' && | 11 Rscript '$script' |
12 mv output_plot.pdf $output1 | |
13 ]]></command> | 12 ]]></command> |
14 <configfiles> | 13 <configfiles> |
15 <configfile name="script"><![CDATA[ | 14 <configfile name="script"><![CDATA[ |
15 ## Setup R error handling to go to stderr | |
16 options(show.error.messages=F, error=function(){cat(geterrmessage(), file=stderr()); q("no",1,F)}) | |
16 | 17 |
17 @R_INIT@ | 18 ## Unify locale settings |
19 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") | |
18 | 20 |
19 ## Import library | 21 ## Import library |
20 library("RColorBrewer") | 22 library("RColorBrewer") |
21 library("gplots") | 23 library("gplots") |
22 | 24 |
23 input <- read.delim('$input1', sep='\t', header=TRUE) | 25 input <- read.delim('$input1', sep='\t', header=TRUE) |
24 | 26 |
25 mat_input <- data.matrix(input[,2:ncol(input)]) | 27 mat_input <- data.matrix(input[,2:ncol(input)]) |
26 rownames(mat_input) <- input[,1] | 28 rownames(mat_input) <- input[,1] |
27 | |
28 hclust_fun = function(x) hclust(x, method="complete") | |
29 dist_fun = function(x) dist(x, method="maximum") | |
30 distfun=dist_fun | |
31 hclustfun=hclust_fun | |
32 | 29 |
33 #if $transform == "none" | 30 #if $transform == "none" |
34 linput <- mat_input | 31 linput <- mat_input |
35 #elif $transform == "log2" | 32 #elif $transform == "log2" |
36 linput <- log2(mat_input) | 33 linput <- log2(mat_input) |
41 #elif $transform == "log10plus1" | 38 #elif $transform == "log10plus1" |
42 linput <- log10(mat_input+1) | 39 linput <- log10(mat_input+1) |
43 #end if | 40 #end if |
44 | 41 |
45 #if $colorscheme == "whrd" | 42 #if $colorscheme == "whrd" |
46 colorscale = colfunc <- colorRampPalette(c("white", "red")) | 43 colorscale = colfunc <- colorRampPalette(c("white", "red")) |
47 #elif $colorscheme == "whblu" | 44 #elif $colorscheme == "whblu" |
48 colorscale = colfunc <- colorRampPalette(c("white", "blue")) | 45 colorscale = colfunc <- colorRampPalette(c("white", "blue")) |
49 #elif $colorscheme == "blwhre" | 46 #elif $colorscheme == "blwhre" |
50 colorscale = colfunc <- colorRampPalette(c("blue","white", "red")) | 47 colorscale = colfunc <- colorRampPalette(c("blue","white", "red")) |
51 #end if | 48 #end if |
52 | 49 |
53 #if $labels== "both" | 50 #if $labels== "both" |
54 rlabs = NULL | 51 rlabs = NULL |
55 clabs = NULL | 52 clabs = NULL |
56 #elif $labels== "rows" | 53 #elif $labels== "rows" |
57 rlabs = NULL | 54 rlabs = NULL |
58 clabs = FALSE | 55 clabs = FALSE |
59 #elif $labels== "columns" | 56 #elif $labels== "columns" |
60 rlabs = FALSE | 57 rlabs = FALSE |
61 clabs = NULL | 58 clabs = NULL |
62 #elif $labels== "none" | 59 #elif $labels== "none" |
63 rlabs = FALSE | 60 rlabs = FALSE |
64 clabs = FALSE | 61 clabs = FALSE |
65 #end if | 62 #end if |
66 | 63 |
67 pdf(file='output_plot.pdf') | 64 pdf(file='$output1') |
68 colorscale | 65 colorscale |
69 | 66 |
70 #if $cluster: | 67 #if $cluster_cond.cluster: |
71 heatmap.2(linput, | 68 hclust_fun = function(x) hclust(x, method='$cluster_cond.clustering') |
72 distfun=dist_fun, hclustfun=hclust_fun, scale = '$scale', labRow = rlabs, labCol = clabs, | 69 dist_fun = function(x) dist(x, method='$cluster_cond.distance') |
73 col=colfunc(50), trace="none", density.info = "none", margins=c(8,8), | 70 #if $cluster_cond.cluster_cols_rows=="rows": |
74 main = '$title', key.xlab='$key', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45) | 71 heatmap.2(linput, dendrogram="row", Colv=FALSE, Rowv=TRUE, |
72 distfun=dist_fun, hclustfun=hclust_fun, scale = '$scale', labRow = rlabs, labCol = clabs, | |
73 col=colfunc(50), trace="none", density.info = "none", margins=c(8,8), | |
74 main = '$title', key.xlab='$key', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45) | |
75 #elif $cluster_cond.cluster_cols_rows=="columns": | |
76 heatmap.2(linput, dendrogram="column", Colv=TRUE, Rowv=FALSE, | |
77 distfun=dist_fun, hclustfun=hclust_fun, scale = '$scale', labRow = rlabs, labCol = clabs, | |
78 col=colfunc(50), trace="none", density.info = "none", margins=c(8,8), | |
79 main = '$title', key.xlab='$key', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45) | |
80 #else | |
81 heatmap.2(linput, | |
82 distfun=dist_fun, hclustfun=hclust_fun, scale = '$scale', labRow = rlabs, labCol = clabs, | |
83 col=colfunc(50), trace="none", density.info = "none", margins=c(8,8), | |
84 main = '$title', key.xlab='$key', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45) | |
85 #end if | |
75 #else | 86 #else |
76 heatmap.2(linput, | 87 heatmap.2(linput, |
77 dendrogram="none", Colv=FALSE, Rowv=FALSE, scale = '$scale', labRow = rlabs, labCol = clabs, | 88 dendrogram="none", Colv=FALSE, Rowv=FALSE, scale = '$scale', labRow = rlabs, labCol = clabs, |
78 col=colfunc(50), trace="none", density.info = "none", margins=c(8,8), | 89 col=colfunc(50), trace="none", density.info = "none", margins=c(8,8), |
79 main='$title', key.xlab='$key', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45) | 90 main='$title', key.xlab='$key', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45) |
80 #end if | 91 #end if |
81 | 92 |
82 dev.off() | 93 dev.off() |
83 | |
84 ]]></configfile> | 94 ]]></configfile> |
85 </configfiles> | 95 </configfiles> |
86 | 96 |
87 <inputs> | 97 <inputs> |
88 <param name="input1" type="data" format="tabular" label="Input should have column headers - these will be the columns that are plotted"/> | 98 <param name="input1" type="data" format="tabular" label="Input should have column headers - these will be the columns that are plotted"/> |
89 <param name="title" type="text" format="txt" label="Plot title"/> | 99 <param name="title" type="text" format="txt" label="Plot title"/> |
90 <param name="key" type="text" format="txt" label="key title"/> | 100 <param name="key" type="text" format="txt" label="key title"/> |
91 <expand macro="transform" /> | 101 <param name="transform" type="select" label="Data transformation"> |
92 <param name="cluster" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Enable data clustering" /> | 102 <option value="none">Plot the data as it is</option> |
103 <option value="log2">Log2(value) transform my data</option> | |
104 <option value="log2plus1">Log2(value+1) transform my data</option> | |
105 <option value="log10">Log10(value) transform my data</option> | |
106 <option value="log10plus1">Log10(value+1) transform my data</option> | |
107 </param> | |
108 <conditional name="cluster_cond"> | |
109 <param name="cluster" type="select" label="Enable data clustering"> | |
110 <option value="true">Yes</option> | |
111 <option value="">No</option> | |
112 </param> | |
113 <when value="true"> | |
114 <param name="cluster_cols_rows" type="select" label="Clustering columns and rows"> | |
115 <option value="both" selected="true">Cluster rows and columns</option> | |
116 <option value="rows">Cluster rows and not columns</option> | |
117 <option value="columns">Cluster columns and not rows</option> | |
118 </param> | |
119 <param name="distance" type="select" label="Distance method" help="The method used to compute the distance (dissimilarity) between both rows and columns. Default: Euclidean" > | |
120 <option value="euclidean" selected="true">Euclidean</option> | |
121 <option value="maximum">Maximum</option> | |
122 </param> | |
123 <param name="clustering" type="select" label="Clustering method" help="The method used to compute the hierarchical clustering. Default: Complete" > | |
124 <option value="complete" selected="true">Complete</option> | |
125 <option value="average">Average</option> | |
126 </param> | |
127 </when> | |
128 <when value=""/> | |
129 </conditional> | |
93 <param name="labels" type="select" label="Labeling columns and rows" > | 130 <param name="labels" type="select" label="Labeling columns and rows" > |
94 <option value="both" selected="True">Label my columns and rows</option> | 131 <option value="both" selected="true">Label my columns and rows</option> |
95 <option value="rows">Label rows and not columns</option> | 132 <option value="rows">Label rows and not columns</option> |
96 <option value="columns">Label columns and not rows</option> | 133 <option value="columns">Label columns and not rows</option> |
97 <option value="none">Do not label rows or columns</option> | 134 <option value="none">Do not label rows or columns</option> |
98 </param> | 135 </param> |
99 <param name="colorscheme" type="select" label="Coloring groups" > | 136 <param name="colorscheme" type="select" label="Coloring groups" > |
100 <option value="whrd" selected="True">White to red</option> | 137 <option value="whrd" selected="true">White to red</option> |
101 <option value="whblu">White to blue</option> | 138 <option value="whblu">White to blue</option> |
102 <option value="blwhre">Blue to white to red</option> | 139 <option value="blwhre">Blue to white to red</option> |
103 </param> | 140 </param> |
104 <param name="scale" type="select" label="Data scaling" > | 141 <param name="scale" type="select" label="Data scaling" > |
105 <option value="none" selected="True">Do not scale my data</option> | 142 <option value="none" selected="true">Do not scale my data</option> |
106 <option value="row">Scale my data by row</option> | 143 <option value="row">Scale my data by row</option> |
107 <option value="column">Scale my data by column</option> | 144 <option value="column">Scale my data by column</option> |
108 </param> | 145 </param> |
109 </inputs> | 146 </inputs> |
110 <outputs> | 147 <outputs> |
111 <data name="output1" format="pdf" from_work_dir="Rplot.pdf"/> | 148 <data name="output1" format="pdf"/> |
112 </outputs> | 149 </outputs> |
113 <tests> | 150 <tests> |
114 <test> | 151 <test> |
115 <param name="input1" value="mtcars.txt"/> | 152 <param name="input1" value="mtcars.txt"/> |
116 <output name="output1" file="ggplot_heatmap2_result1.pdf" compare="sim_size"/> | 153 <param name="cluster" value="true"/> |
154 <output name="output1" file="result1.pdf" compare="sim_size"/> | |
155 </test> | |
156 <test> | |
157 <param name="input1" value="mtcars.txt"/> | |
158 <param name="cluster" value=""/> | |
159 <output name="output1" file="result2.pdf" compare="sim_size"/> | |
117 </test> | 160 </test> |
118 </tests> | 161 </tests> |
119 <help><![CDATA[ | 162 <help><![CDATA[ |
120 This tool will generate a clustered heatmap of your data. More customization options will be added, for now the heatmap uses a red coloring scheme and clustering is performed using the "maximum" similarity measure and the "complete" hierarchical clustering measure. | 163 This tool employs the heatmap.2 function from the R gplots package and will generate a heatmap of your data. If clustering is enabled, the heatmap uses the Euclidean distance method and the Complete hierarchical clustering method by default. |
121 | 164 |
122 Input data should have row labels in the first column and column labels. For example, the row labels (the first column) should represent gene IDs and the column labels should represent sample IDs. | 165 Input data should have row labels in the first column and column labels. For example, the row labels (the first column) should represent gene IDs and the column labels should represent sample IDs. |
123 | |
124 This wrapper employs the heatmap.2 function of R. | |
125 ]]></help> | 166 ]]></help> |
126 <citations> | 167 <citations> |
127 </citations> | 168 </citations> |
128 </tool> | 169 </tool> |