Mercurial > repos > dfornika > render_tree
annotate render_tree.R @ 2:96406ba2696b draft default tip
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:54:28 -0400 |
parents | 9f0241ee55e8 |
children |
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 |
2
96406ba2696b
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
1
diff
changeset
|
3 library(grid) |
96406ba2696b
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
1
diff
changeset
|
4 |
0
342fe8c2d8bb
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff
changeset
|
5 suppressMessages( |
342fe8c2d8bb
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff
changeset
|
6 library(ggtree) |
342fe8c2d8bb
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff
changeset
|
7 ) |
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 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
|
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 <- 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
|
12 |
342fe8c2d8bb
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff
changeset
|
13 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
|
14 geom_tree() + |
342fe8c2d8bb
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff
changeset
|
15 theme_tree2() + |
2
96406ba2696b
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
1
diff
changeset
|
16 geom_tiplab(size=3, align=TRUE, hjust=-0.1) + ggplot2::xlim(0, 0.08) + |
96406ba2696b
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
1
diff
changeset
|
17 geom_tippoint() + |
96406ba2696b
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
1
diff
changeset
|
18 theme(plot.margin=unit(c(1,1,1,1),"cm")) |
0
342fe8c2d8bb
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff
changeset
|
19 |
342fe8c2d8bb
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff
changeset
|
20 suppressMessages( |
342fe8c2d8bb
planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/render_tree commit 8898f2229ec13917b7d96e20725f3871d9d93e90-dirty
dfornika
parents:
diff
changeset
|
21 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
|
22 ) |