Repository 'ggplot2_heatmap2'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/ggplot2_heatmap2

Changeset 4:ca7cb0eaad62 (2019-02-11)
Previous changeset 3:4955e9bb96d1 (2018-07-28) Next changeset 5:3b37b1b1c3a7 (2022-04-12)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/heatmap2 commit e7b5919a8e06595b23e8fc31b975fc508f5081b3
modified:
heatmap2.xml
added:
test-data/result1.pdf
test-data/result2.pdf
removed:
macros.xml
test-data/ggplot_heatmap2_result1.pdf
test-data/ggplot_heatmap_result1.pdf
test-data/ggplot_histogram_result1.pdf
test-data/ggplot_pca_result1.pdf
test-data/ggplot_point_result1.pdf
test-data/ggplot_violin_result1.pdf
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 heatmap2.xml
--- a/heatmap2.xml Sat Jul 28 03:44:29 2018 -0400
+++ b/heatmap2.xml Mon Feb 11 17:32:28 2019 -0500
[
b'@@ -1,20 +1,22 @@\n-<tool id="ggplot2_heatmap2" name="heatmap2" version="@VERSION@+galaxy1">\n+<tool id="ggplot2_heatmap2" name="heatmap2" version="@VERSION@">\n     <macros>\n-        <import>macros.xml</import>\n+        <token name="@VERSION@">3.0.1</token>\n     </macros>\n     <requirements>\n-        <requirement type="package" version="3.0.1">r-gplots</requirement>\n+        <requirement type="package" version="@VERSION@">r-gplots</requirement>\n         <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement>\n     </requirements>\n     <command detect_errors="exit_code"><![CDATA[\n cat \'$script\' &&\n-Rscript \'$script\' &&\n-mv output_plot.pdf $output1\n+Rscript \'$script\'\n     ]]></command>\n     <configfiles>\n         <configfile name="script"><![CDATA[\n+## Setup R error handling to go to stderr\n+options(show.error.messages=F, error=function(){cat(geterrmessage(), file=stderr()); q("no",1,F)})\n \n-@R_INIT@\n+## Unify locale settings\n+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")\n \n ## Import library\n library("RColorBrewer")\n@@ -25,11 +27,6 @@\n mat_input <- data.matrix(input[,2:ncol(input)])\n rownames(mat_input) <- input[,1]\n \n-hclust_fun = function(x) hclust(x, method="complete")\n-dist_fun = function(x) dist(x, method="maximum")\n-distfun=dist_fun\n-hclustfun=hclust_fun\n-\n #if $transform == "none"\n     linput <- mat_input\n #elif $transform == "log2"\n@@ -43,85 +40,129 @@\n #end if\n \n #if $colorscheme == "whrd"\n-  colorscale = colfunc <- colorRampPalette(c("white", "red"))\n+    colorscale = colfunc <- colorRampPalette(c("white", "red"))\n #elif $colorscheme == "whblu"\n-  colorscale = colfunc <- colorRampPalette(c("white", "blue"))\n+    colorscale = colfunc <- colorRampPalette(c("white", "blue"))\n #elif $colorscheme == "blwhre"\n-  colorscale = colfunc <- colorRampPalette(c("blue","white", "red"))\n+    colorscale = colfunc <- colorRampPalette(c("blue","white", "red"))\n #end if\n \n #if $labels== "both"\n-  rlabs = NULL\n-  clabs = NULL\n+    rlabs = NULL\n+    clabs = NULL\n #elif $labels== "rows"\n-  rlabs = NULL\n-  clabs = FALSE\n+    rlabs = NULL\n+    clabs = FALSE\n #elif $labels== "columns"\n-  rlabs = FALSE\n-  clabs = NULL\n+    rlabs = FALSE\n+    clabs = NULL\n #elif $labels== "none"\n-  rlabs = FALSE\n-  clabs = FALSE\n+    rlabs = FALSE\n+    clabs = FALSE\n #end if\n \n-pdf(file=\'output_plot.pdf\')\n+pdf(file=\'$output1\')\n colorscale\n \n-#if $cluster:\n-    heatmap.2(linput,\n-        distfun=dist_fun, hclustfun=hclust_fun, scale = \'$scale\', labRow = rlabs, labCol = clabs,\n-        col=colfunc(50), trace="none", density.info = "none", margins=c(8,8),\n-        main = \'$title\', key.xlab=\'$key\', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45)\n+#if $cluster_cond.cluster:\n+    hclust_fun = function(x) hclust(x, method=\'$cluster_cond.clustering\')\n+    dist_fun = function(x) dist(x, method=\'$cluster_cond.distance\')\n+    #if $cluster_cond.cluster_cols_rows=="rows":\n+        heatmap.2(linput, dendrogram="row", Colv=FALSE, Rowv=TRUE,\n+            distfun=dist_fun, hclustfun=hclust_fun, scale = \'$scale\', labRow = rlabs, labCol = clabs,\n+            col=colfunc(50), trace="none", density.info = "none", margins=c(8,8),\n+            main = \'$title\', key.xlab=\'$key\', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45)\n+    #elif $cluster_cond.cluster_cols_rows=="columns":\n+        heatmap.2(linput, dendrogram="column", Colv=TRUE, Rowv=FALSE,\n+            distfun=dist_fun, hclustfun=hclust_fun, scale = \'$scale\', labRow = rlabs, labCol = clabs,\n+            col=colfunc(50), trace="none", density.info = "none", margins=c(8,8),\n+            main = \'$title\', key.xlab=\'$key\', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45)\n+    #else\n+        heatmap.2(linput,\n+            distfun=dist_fun, hclustfun=hclust_fun, scale = \'$scale\', labRow = rlabs, labCol = clabs,\n+            col=colfunc(50), trace="none", density.info = "none", margins=c(8,8),\n+            main = \'$title\', key.xlab=\'$key\', keysize=1, cexCol=0.8, cexRow = 0.8, srtCol=45)\n+    #end if\n #else\n     hea'..b'        <option value="both" selected="true">Cluster rows and columns</option>\n+                    <option value="rows">Cluster rows and not columns</option>\n+                    <option value="columns">Cluster columns and not rows</option>\n+                </param>\n+                <param name="distance" type="select" label="Distance method" help="The method used to compute the distance (dissimilarity) between both rows and columns. Default: Euclidean" >\n+                    <option value="euclidean" selected="true">Euclidean</option>\n+                    <option value="maximum">Maximum</option>\n+                </param>\n+                <param name="clustering" type="select" label="Clustering method" help="The method used to compute the hierarchical clustering. Default: Complete" >\n+                    <option value="complete" selected="true">Complete</option>\n+                    <option value="average">Average</option>\n+                </param>\n+            </when>\n+            <when value=""/>\n+        </conditional>\n         <param name="labels" type="select" label="Labeling columns and rows" >\n-            <option value="both" selected="True">Label my columns and rows</option>\n+            <option value="both" selected="true">Label my columns and rows</option>\n             <option value="rows">Label rows and not columns</option>\n             <option value="columns">Label columns and not rows</option>\n             <option value="none">Do not label rows or columns</option>\n         </param>\n         <param name="colorscheme" type="select" label="Coloring groups" >\n-            <option value="whrd" selected="True">White to red</option>\n+            <option value="whrd" selected="true">White to red</option>\n             <option value="whblu">White to blue</option>\n             <option value="blwhre">Blue to white to red</option>\n         </param>\n         <param name="scale" type="select" label="Data scaling" >\n-            <option value="none" selected="True">Do not scale my data</option>\n+            <option value="none" selected="true">Do not scale my data</option>\n             <option value="row">Scale my data by row</option>\n             <option value="column">Scale my data by column</option>\n         </param>\n     </inputs>\n     <outputs>\n-        <data name="output1" format="pdf" from_work_dir="Rplot.pdf"/>\n+        <data name="output1" format="pdf"/>\n     </outputs>\n     <tests>\n         <test>\n             <param name="input1" value="mtcars.txt"/>\n-            <output name="output1" file="ggplot_heatmap2_result1.pdf" compare="sim_size"/>\n+            <param name="cluster" value="true"/>\n+            <output name="output1" file="result1.pdf" compare="sim_size"/>\n+        </test>\n+        <test>\n+            <param name="input1" value="mtcars.txt"/>\n+            <param name="cluster" value=""/>\n+            <output name="output1" file="result2.pdf" compare="sim_size"/>\n         </test>\n     </tests>\n     <help><![CDATA[\n-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. \n+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.\n \n-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. \n-\n-This wrapper employs the heatmap.2 function of R.\n+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.\n     ]]></help>\n     <citations>\n     </citations>\n'
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 macros.xml
--- a/macros.xml Sat Jul 28 03:44:29 2018 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,291 +0,0 @@\n-<?xml version="1.0"?>\n-<macros>\n-    <xml name="requirements">\n-        <requirements>\n-            <requirement type="package" version="@VERSION@">r-ggplot2</requirement>\n-            <yield />\n-        </requirements>\n-    </xml>\n-    <token name="@VERSION@">2.2.1</token>\n-\n-    <token name="@R_INIT@"><![CDATA[\n-        ## Setup R error handling to go to stderr\n-        options(show.error.messages=F, error=function(){cat(geterrmessage(), file=stderr()); q("no",1,F)})\n-\n-        ## Unify locale settings\n-        loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")\n-    ]]></token>\n-\n-    <token name="@TRANSFORM@"><![CDATA[\n-        #if $adv.transform == "log2"\n-            input["value"] <- log2(input["value"])\n-        #elif $adv.transform == "log2plus1"\n-            input["value"] <- log2(input["value"]+1)\n-        #elif $adv.transform == "log10"\n-            input["value"] <- log10(input["value"])\n-        #elif $adv.transform == "log10plus1"\n-            input["value"] <- log10(input["value"]+1)\n-        #end if\n-    ]]></token>\n-\n-    <token name="@XY_SCALING@"><![CDATA[\n-        #Choose between automatically scaled x and y axis or user defined\n-        #if $adv.scaling.plot_scaling == "Automatic"\n-            gg_scalex = NULL\n-            gg_scaley = NULL\n-        #else\n-            gg_scalex = xlim($adv.scaling.xaxismin, $adv.scaling.xaxismax)\n-            gg_scaley = ylim($adv.scaling.yaxismin, $adv.scaling.yaxismax)\n-            cat("\\n xaxismin: ", $adv.scaling.xaxismin)\n-            cat("\\n xaxismax: ", $adv.scaling.xaxismax)\n-            cat("\\n yaxismin: ", $adv.scaling.yaxismin)\n-            cat("\\n yaxismax: ", $adv.scaling.yaxismax)\n-        #end if\n-    ]]></token>\n-\n-    <token name="@THEME@"><![CDATA[\n-        ## Choose theme for plot\n-        #if $adv.theme == "bw"\n-            gg_theme = theme_bw()\n-        #else\n-            gg_theme = NULL\n-        #end if\n-    ]]></token>\n-\n-    <token name="@LEGEND@"><![CDATA[\n-        ## Show/hide legend\n-        #if $adv.legend == "yes"\n-            gg_legend = theme(legend.position="right")\n-        #else\n-            gg_legend = theme(legend.position="none")\n-            cat("\\n no legend")\n-        #end if\n-    ]]></token>\n-    <token name="@SAVE_OUTPUT@"><![CDATA[\n-        ## output options need to be in out section\n-        gg_width <- as.double(\'$out.width_output_dim\')\n-        gg_height <- as.double(\'$out.height_output_dim\')\n-        gg_unit <- \'$out.unit_output_dim\'\n-        gg_dpi <- as.double(\'$out.dpi_output_dim\')\n-        gg_add_device <- \'$out.additional_output_format\'\n-        output1 <- \'$output1\'\n-        output2 <- \'$output2\'\n-\n-        ## ggsave to png\n-        ggsave(filename = output1, plot = plot_out, width = gg_width, height = gg_height, units = gg_unit, dpi = gg_dpi, device = "png")\n-        if(gg_add_device != "none"){\n-          ggsave(filename = output2, plot = plot_out, width = gg_width, height = gg_height, units = gg_unit, dpi = gg_dpi, device = gg_add_device)\n-        }\n-    ]]></token>\n-    <xml name="read_complex_input">\n-        <param name="input1" type="data" format="tabular" label="Select table"/>\n-        <conditional name="inputdata">\n-            <param name="input_type" type="select" label="Select input dataset options" help="specific dataset input for reading">\n-                <option value="with_header" selected="true">Dataset with header</option>\n-                <option value="with_rownames">Dataset with row names</option>\n-                <option value="with_header_rownames">Dataset with header and row names</option>\n-                <option value="no_header_rownames">Dataset without header or row names</option>\n-            </param>\n-            <when value="with_header">\n-                <param name="header" type="hidden" value="TRUE"/>\n-                <param name="row_names_index" type="hidden" value="0"/>\n-                <param name="sample_name_orientation" type="select" display="radio" multiple="'..b'ption>\n-            <option value="YlGn">Yellow to green (discrete, max=9 colors)</option>\n-            <option value="Reds">Shades of red from light to dark (discrete, max=9 colors)</option>\n-            <option value="RdPu">Red to purple (discrete, max=9 colors)</option>\n-            <option value="Purples">Shades of purple from light to dark (discrete, max=9 colors)</option>\n-            <option value="PuRd">Purple to red (discrete, max=9 colors)</option>\n-            <option value="PuBuGn">Purple to blue to green (discrete, max=9 colors)</option>\n-            <option value="PuBu">Purple to blue(discrete, max=9 colors)</option>\n-            <option value="OrRd">Orange to red (discrete, max=9 colors)</option>\n-            <option value="Oranges">Shades of orange from light to dark (discrete, max=9 colors)</option>\n-            <option value="Greys">Shades of grey from light to dark (discrete, max=9 colors)</option>\n-            <option value="Greens">Shades of greens from light to dark (discrete, max=9 colors)</option>\n-            <option value="GnBu">Green to blue (discrete, max=9 colors)</option>\n-            <option value="BuPu">Blue to purple (discrete, max=9 colors)</option>\n-            <option value="BuGn">Blue to green (discrete, max=9 colors)</option>\n-            <option value="Blues">Shades of blue from light to dark (discrete, max=9 colors)</option>\n-            <option value="Set1">Set 1 - predefined color pallete (discrete, max=9 colors)</option>\n-            <option value="Set2">Set 2 - predefined color pallete (discrete, max=8 colors)</option>\n-            <option value="Set3">Set 3 - predefined color pallete (discrete, max=12 colors)</option>\n-            <option value="Pastel1">Pastel 1 - predefined pastel color pallete (discrete, max=9 colors)</option>\n-            <option value="Pastel2">Pastel 2 - predefined pastel color pallete (discrete, max=8 colors)</option>\n-            <option value="Paired">Paired - predefined color pallete (discrete, max=12 colors)</option>\n-            <option value="Dark2">Dark 2 - predefined color pallete (discrete, max=12 colors)</option>\n-            <option value="Accent">Accent - predefined color pallete (discrete, max=12 colors)</option>\n-            <option value="Spectral">Spectral - Red to yellow to purple (discrete, max=11 colors)</option>\n-            <option value="RdYlGn">Red to yellow to green (discrete, max=11 colors)</option>\n-            <option value="RdYlBu">Red to yellow to blue (discrete, max=11 colors)</option>\n-            <option value="RdGy">Red to grey (discrete, max=11 colors)</option>\n-            <option value="RdBu">Red to blue (discrete, max=11 colors)</option>\n-            <option value="PuOr">Purple to orange (discrete, max=11 colors)</option>\n-            <option value="PRGn">Purple to green (discrete, max=11 colors)</option>\n-            <option value="BrBG">Brown to teal (discrete, max=11 colors)</option>\n-        </param>\n-    </xml>\n-    <xml name="additional_output">\n-        <data name="output1" format="png" label="${tool.name} on ${on_string}: png"/>\n-        <data format="pdf" name="output2" label="${tool.name} on ${on_string}: ${out.additional_output_format}">\n-            <change_format>\n-                <when input="out.additional_output_format" value="svg" format="svg" />\n-                <when input="out.additional_output_format" value="eps" format="eps" />\n-                <when input="out.additional_output_format" value="ps" format="ps" />\n-                <when input="out.additional_output_format" value="tex" format="txt" />\n-                <when input="out.additional_output_format" value="jpeg" format="jpg" />\n-                <when input="out.additional_output_format" value="tiff" format="tiff" />\n-                <when input="out.additional_output_format" value="bmp" format="bmp" />\n-            </change_format>\n-            <filter>out[\'additional_output_format\'] != "none"</filter>\n-        </data>\n-    </xml>\n-</macros>\n'
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 test-data/ggplot_heatmap2_result1.pdf
b
Binary file test-data/ggplot_heatmap2_result1.pdf has changed
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 test-data/ggplot_heatmap_result1.pdf
b
Binary file test-data/ggplot_heatmap_result1.pdf has changed
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 test-data/ggplot_histogram_result1.pdf
b
Binary file test-data/ggplot_histogram_result1.pdf has changed
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 test-data/ggplot_pca_result1.pdf
b
Binary file test-data/ggplot_pca_result1.pdf has changed
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 test-data/ggplot_point_result1.pdf
b
Binary file test-data/ggplot_point_result1.pdf has changed
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 test-data/ggplot_violin_result1.pdf
b
Binary file test-data/ggplot_violin_result1.pdf has changed
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 test-data/result1.pdf
b
Binary file test-data/result1.pdf has changed
b
diff -r 4955e9bb96d1 -r ca7cb0eaad62 test-data/result2.pdf
b
Binary file test-data/result2.pdf has changed