changeset 0:342fe8c2d8bb draft

planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
author dfornika
date Sat, 29 Jun 2019 00:13:08 -0400
parents
children 9f0241ee55e8
files render_tree.R render_tree.xml test-data/data.csv test-data/tree.nhx test-data/tree.png
diffstat 5 files changed, 82 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/render_tree.R	Sat Jun 29 00:13:08 2019 -0400
@@ -0,0 +1,18 @@
+#!/usr/bin/env Rscript
+
+suppressMessages(
+  library(ggtree)
+)
+
+args = commandArgs(trailingOnly=TRUE)
+
+tree <- read.tree(args[1])
+
+tree_plot <- ggplot(tree, aes(x, y)) + 
+  geom_tree() + 
+  theme_tree2() +
+  geom_tiplab()
+
+suppressMessages(
+  ggsave(args[2], plot=tree_plot, device="png")
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/render_tree.xml	Sat Jun 29 00:13:08 2019 -0400
@@ -0,0 +1,36 @@
+<tool id="render_tree" name="render tree" version="0.1.0">
+    <description>render a newick tree</description>
+    <requirements>
+        <requirement type="package" version="1.16">bioconductor-ggtree</requirement>
+    </requirements>
+    <version_command>echo '0.1.0'</version_command>
+    <command detect_errors="exit_code"><![CDATA[
+        $__tool_directory__/render_tree.R
+          '${tree}'
+          '${image}'
+    ]]></command>
+    <inputs>
+        <param name="tree" type="data" format="nhx" />
+    </inputs>
+    <outputs>
+        <data name="image" format="png" />
+    </outputs>
+    <tests>
+    </tests>
+    <help><![CDATA[
+    ]]></help>
+    <citations>
+      <citation type="bibtex">
+@article{yu2017ggtree,
+  title={ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data},
+  author={Yu, Guangchuang and Smith, David K and Zhu, Huachen and Guan, Yi and Lam, Tommy Tsan-Yuk},
+  journal={Methods in Ecology and Evolution},
+  volume={8},
+  number={1},
+  pages={28--36},
+  year={2017},
+  publisher={Wiley Online Library}
+}
+      </citation>
+    </citations>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/data.csv	Sat Jun 29 00:13:08 2019 -0400
@@ -0,0 +1,9 @@
+taxa,number,fruit
+A,1,apple
+B,2,banana
+C,3,carrot
+D,4,date
+E,5,eggplant
+F,6,fruit
+G,7,grape
+H,8,honeydew
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree.nhx	Sat Jun 29 00:13:08 2019 -0400
@@ -0,0 +1,19 @@
+(
+(
+(
+(
+F:0.00037,
+C:0.00093)
+:0.00242,
+B:0.00448)
+:0.00500,
+(
+E:0.03441,
+D:0.02059)
+:0.00888)
+:0.00307,
+G:0.00154,
+(
+H:0.00000,
+A:0.00000)
+:0.00141);
Binary file test-data/tree.png has changed