annotate render_tree.R @ 1:9f0241ee55e8 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:27:55 -0400
parents 342fe8c2d8bb
children 96406ba2696b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
1 #!/usr/bin/env Rscript
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
2
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
3 suppressMessages(
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
4 library(ggtree)
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
5 )
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
6
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
7 args = commandArgs(trailingOnly=TRUE)
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
8
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
9 tree <- read.tree(args[1])
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
10
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
11 tree_plot <- ggplot(tree, aes(x, y)) +
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
12 geom_tree() +
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
13 theme_tree2() +
1
9f0241ee55e8 planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents: 0
diff changeset
14 geom_tiplab(align=TRUE)
0
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
15
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
16 suppressMessages(
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
17 ggsave(args[2], plot=tree_plot, device="png")
342fe8c2d8bb planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff changeset
18 )