git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@126053 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Package: ggtree |
2 | 2 |
Type: Package |
3 | 3 |
Title: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data |
4 |
-Version: 1.7.5 |
|
4 |
+Version: 1.7.7 |
|
5 | 5 |
Authors@R: c( |
6 | 6 |
person("Guangchuang", "Yu", email = "guangchuangyu@gmail.com", role = c("aut", "cre", "cph")), |
7 | 7 |
person("Tommy Tsan-Yuk", "Lam", email = "tylam.tommy@gmail.com", rol = c("aut", "ths")), |
... | ... |
@@ -1,5 +1,16 @@ |
1 |
+CHANGES IN VERSION 1.7.7 |
|
2 |
+------------------------ |
|
3 |
+ o update citation info <2017-01-20, Fri> |
|
4 |
+ |
|
5 |
+CHANGES IN VERSION 1.7.6 |
|
6 |
+------------------------ |
|
7 |
+ o inset support reverse scale <2017-01-05, Thu> |
|
8 |
+ + https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/bioc-ggtree/_JPfm71Z8nM/6gL93oxHFQAJ |
|
9 |
+ |
|
1 | 10 |
CHANGES IN VERSION 1.7.5 |
2 | 11 |
------------------------ |
12 |
+ o disable labeling collapsed node as tip <2017-01-03, Tue> |
|
13 |
+ + https://groups.google.com/forum/#!topic/bioc-ggtree/nReqJatMvJQ |
|
3 | 14 |
o fortify.phylo4d via converting phylo4d to treedata object <2016-12-28, Wed> |
4 | 15 |
o improve viewClade function, use coord_cartesian instead of xlim <2016-12-28, Wed> |
5 | 16 |
o remove codes that move to treeio and now ggtree depends treeio <2016-12-20, Tue> |
... | ... |
@@ -33,12 +33,13 @@ get_taxa_name <- function(tree_view=NULL, node) { |
33 | 33 |
##' @author Guangchuang Yu |
34 | 34 |
viewClade <- function(tree_view=NULL, node, xmax_adjust=0) { |
35 | 35 |
tree_view %<>% get_tree_view |
36 |
+ xd <- tree_view$data$branch.length[node]/2 |
|
36 | 37 |
|
37 | 38 |
cpos <- get_clade_position(tree_view, node=node) |
38 | 39 |
xmax <- ggplot_build(tree_view)$layout$panel_ranges[[1]]$x.range[2] |
39 | 40 |
|
40 | 41 |
## tree_view+xlim(cpos$xmin, xmax + xmax_adjust) + ylim(cpos$ymin, cpos$ymax) |
41 |
- tree_view + coord_cartesian(xlim=c(cpos$xmin, xmax), ylim=c(cpos$ymin, cpos$ymax)) |
|
42 |
+ tree_view + coord_cartesian(xlim=c(cpos$xmin-xd, xmax), ylim=c(cpos$ymin, cpos$ymax), expand=FALSE) |
|
42 | 43 |
} |
43 | 44 |
|
44 | 45 |
|
... | ... |
@@ -65,7 +66,7 @@ collapse <- function(tree_view=NULL, node) { |
65 | 66 |
|
66 | 67 |
sp <- get.offspring.df(df, node) |
67 | 68 |
sp.df <- df[sp,] |
68 |
- df[node, "isTip"] <- TRUE |
|
69 |
+ ## df[node, "isTip"] <- TRUE |
|
69 | 70 |
sp_y <- range(sp.df$y, na.rm=TRUE) |
70 | 71 |
ii <- which(df$y > max(sp_y)) |
71 | 72 |
if (length(ii)) { |
... | ... |
@@ -109,7 +110,7 @@ expand <- function(tree_view=NULL, node) { |
109 | 110 |
return(tree_view) |
110 | 111 |
} |
111 | 112 |
df <- tree_view$data |
112 |
- df[node, "isTip"] <- FALSE |
|
113 |
+ ## df[node, "isTip"] <- FALSE |
|
113 | 114 |
sp_y <- range(sp.df$y) |
114 | 115 |
ii <- which(df$y > df$y[node]) |
115 | 116 |
df[ii, "y"] <- df[ii, "y"] + diff(sp_y) |
... | ... |
@@ -9,10 +9,14 @@ |
9 | 9 |
##' @param hjust horizontal adjustment |
10 | 10 |
##' @param vjust vertical adjustment |
11 | 11 |
##' @param x x position, one of 'node' and 'branch' |
12 |
+##' @param reverse_x whether x axis was reversed by scale_x_reverse |
|
13 |
+##' @param reverse_y whether y axis was reversed by scale_y_reverse |
|
12 | 14 |
##' @return tree view with insets |
13 | 15 |
##' @export |
14 | 16 |
##' @author Guangchuang Yu |
15 |
-inset <- function(tree_view, insets, width=0.1, height=0.1, hjust=0, vjust=0, x="node") { |
|
17 |
+inset <- function(tree_view, insets, width=0.1, height=0.1, hjust=0, vjust=0, |
|
18 |
+ x="node", reverse_x=FALSE, reverse_y=FALSE) { |
|
19 |
+ |
|
16 | 20 |
df <- tree_view$data[as.numeric(names(insets)),] |
17 | 21 |
x <- match.arg(x, c("node", "branch", "edge")) |
18 | 22 |
|
... | ... |
@@ -25,6 +29,10 @@ inset <- function(tree_view, insets, width=0.1, height=0.1, hjust=0, vjust=0, x= |
25 | 29 |
|
26 | 30 |
xx <- xx - hjust |
27 | 31 |
yy <- yy - vjust |
32 |
+ if (reverse_x) |
|
33 |
+ xx <- -xx |
|
34 |
+ if (reverse_y) |
|
35 |
+ yy <- -yy |
|
28 | 36 |
|
29 | 37 |
for (i in seq_along(insets)) { |
30 | 38 |
tree_view %<>% subview(insets[[i]], |
... | ... |
@@ -7,7 +7,7 @@ |
7 | 7 |
citation <- paste0("If you use ", pkgname, " in published research, please cite:\n", |
8 | 8 |
"Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam. ", |
9 | 9 |
"ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. ", |
10 |
- "Methods in Ecology and Evolution 2016, doi:10.1111/2041-210X.12628") |
|
10 |
+ "Methods in Ecology and Evolution 2017, 8(1):28-36, doi:10.1111/2041-210X.12628") |
|
11 | 11 |
|
12 | 12 |
packageStartupMessage(paste0(msg, citation)) |
13 | 13 |
} |
... | ... |
@@ -45,7 +45,8 @@ The `ggtree` package extending the `ggplot2` package. It based on grammar of gra |
45 | 45 |
|
46 | 46 |
Please cite the following article when using `ggtree`: |
47 | 47 |
|
48 |
-__G Yu__, DK Smith, H Zhu, Y Guan, TTY Lam^\*^. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. __*Methods in Ecology and Evolution*__. _accepted_ |
|
48 |
+__G Yu__, DK Smith, H Zhu, Y Guan, TTY Lam^\*^. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. __*Methods in Ecology and Evolution*__. 2017, 8(1):28-36. |
|
49 |
+ |
|
49 | 50 |
|
50 | 51 |
`r badge_doi("10.1111/2041-210X.12628", "green")` |
51 | 52 |
`r badge_citation("HtEfBTGE9r8C", "7268358477862164627", "green")` |
... | ... |
@@ -2,9 +2,9 @@ |
2 | 2 |
ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data |
3 | 3 |
=========================================================================================================================== |
4 | 4 |
|
5 |
-[](https://bioconductor.org/packages/ggtree) [](https://github.com/GuangchuangYu/ggtree) [](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) <img src="logo.png" align="right" /> |
|
5 |
+[](https://bioconductor.org/packages/ggtree) [](https://github.com/GuangchuangYu/ggtree) [](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) <img src="logo.png" align="right" /> |
|
6 | 6 |
|
7 |
-[](http://www.repostatus.org/#active) [](https://codecov.io/gh/GuangchuangYu/ggtree) [](https://github.com/GuangchuangYu/ggtree/commits/master) [](https://github.com/GuangchuangYu/ggtree/network) [](https://github.com/GuangchuangYu/ggtree/stargazers) [](https://awesome-r.com/#awesome-r-graphic-displays) |
|
7 |
+[](http://www.repostatus.org/#active) [](https://codecov.io/gh/GuangchuangYu/ggtree) [](https://github.com/GuangchuangYu/ggtree/commits/master) [](https://github.com/GuangchuangYu/ggtree/network) [](https://github.com/GuangchuangYu/ggtree/stargazers) [](https://awesome-r.com/#awesome-r-graphic-displays) |
|
8 | 8 |
|
9 | 9 |
[](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#archives) [](https://bioconductor.org/checkResults/devel/bioc-LATEST/ggtree/) [](https://travis-ci.org/GuangchuangYu/ggtree) [](https://ci.appveyor.com/project/GuangchuangYu/ggtree) [](http://bioconda.github.io/recipes/bioconductor-ggtree/README.html) |
10 | 10 |
|
... | ... |
@@ -16,9 +16,9 @@ The `ggtree` package extending the `ggplot2` package. It based on grammar of gra |
16 | 16 |
|
17 | 17 |
Please cite the following article when using `ggtree`: |
18 | 18 |
|
19 |
-**G Yu**, DK Smith, H Zhu, Y Guan, TTY Lam<sup>\*</sup>. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. ***Methods in Ecology and Evolution***. *accepted* |
|
19 |
+**G Yu**, DK Smith, H Zhu, Y Guan, TTY Lam<sup>\*</sup>. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. ***Methods in Ecology and Evolution***. 2017, 8(1):28-36. |
|
20 | 20 |
|
21 |
-[](http://dx.doi.org/10.1111/2041-210X.12628) [](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627) [](https://www.altmetric.com/details/10533079) |
|
21 |
+[](http://dx.doi.org/10.1111/2041-210X.12628) [](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627) [](https://www.altmetric.com/details/10533079) |
|
22 | 22 |
|
23 | 23 |
------------------------------------------------------------------------ |
24 | 24 |
|
... | ... |
@@ -51,30 +51,30 @@ For details, please visit our project website, <https://guangchuangyu.github.io/ |
51 | 51 |
|
52 | 52 |
### Download stats |
53 | 53 |
|
54 |
-[](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) |
|
54 |
+[](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) |
|
55 | 55 |
|
56 |
- +----------------------+----------------------+----------------------+----------------------+-+ |
|
57 |
- | * | |
|
56 |
+ ++---------------------+---------------------+---------------------+---------------------+----+ |
|
57 |
+ | * | |
|
58 | 58 |
| | |
59 |
+ | * | |
|
59 | 60 |
| * | |
60 |
- | * | |
|
61 | 61 |
1500 + + |
62 | 62 |
| | |
63 | 63 |
| | |
64 |
- | * | |
|
65 |
- | * * | |
|
66 |
- | * * | |
|
67 |
- 1000 + * + |
|
64 |
+ | * | |
|
65 |
+ | * * * | |
|
66 |
+ | * * | |
|
67 |
+ 1000 + * + |
|
68 | 68 |
| | |
69 |
- | * * | |
|
70 |
- | * * | |
|
71 |
- | * * | |
|
69 |
+ | * * | |
|
70 |
+ | * * | |
|
71 |
+ | * * | |
|
72 | 72 |
| | |
73 |
- 500 + * + |
|
74 |
- | * * | |
|
73 |
+ 500 + * + |
|
74 |
+ | * * | |
|
75 | 75 |
| * | |
76 | 76 |
| * | |
77 | 77 |
| | |
78 |
- 0 + * * * + |
|
79 |
- +----------------------+----------------------+----------------------+----------------------+-+ |
|
80 |
- 2015 2015.5 2016 2016.5 2017 |
|
78 |
+ 0 + * * * + |
|
79 |
+ ++---------------------+---------------------+---------------------+---------------------+----+ |
|
80 |
+ 2015 2015.5 2016 2016.5 2017 |
... | ... |
@@ -10,17 +10,17 @@ citEntry( |
10 | 10 |
as.person("Yi Guan"), |
11 | 11 |
as.person("Tommy Tsan-Yuk Lam") |
12 | 12 |
), |
13 |
- year = "accepted", |
|
13 |
+ year = "2017", |
|
14 | 14 |
journal = "Methods in Ecology and Evolution", |
15 |
- volume = "", |
|
16 |
- issue = "", |
|
15 |
+ volume = "8", |
|
16 |
+ issue = "1", |
|
17 | 17 |
number = "", |
18 |
- pages = "", |
|
18 |
+ pages = "28-36", |
|
19 | 19 |
doi = "10.1111/2041-210X.12628", |
20 | 20 |
PMID = "", |
21 |
- url = "", |
|
21 |
+ url = "http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12628/abstract", |
|
22 | 22 |
textVersion = paste("Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam.", |
23 | 23 |
"ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data.", |
24 |
- "Methods in Ecology and Evolution 2016 accepted, doi:10.1111/2041-210X.12628") |
|
24 |
+ "Methods in Ecology and Evolution 2017, 8(1):28-36") |
|
25 | 25 |
) |
26 | 26 |
|
... | ... |
@@ -5,7 +5,7 @@ |
5 | 5 |
\title{inset} |
6 | 6 |
\usage{ |
7 | 7 |
inset(tree_view, insets, width = 0.1, height = 0.1, hjust = 0, |
8 |
- vjust = 0, x = "node") |
|
8 |
+ vjust = 0, x = "node", reverse_x = FALSE, reverse_y = FALSE) |
|
9 | 9 |
} |
10 | 10 |
\arguments{ |
11 | 11 |
\item{tree_view}{tree view} |
... | ... |
@@ -21,6 +21,10 @@ inset(tree_view, insets, width = 0.1, height = 0.1, hjust = 0, |
21 | 21 |
\item{vjust}{vertical adjustment} |
22 | 22 |
|
23 | 23 |
\item{x}{x position, one of 'node' and 'branch'} |
24 |
+ |
|
25 |
+\item{reverse_x}{whether x axis was reversed by scale_x_reverse} |
|
26 |
+ |
|
27 |
+\item{reverse_y}{whether y axis was reversed by scale_y_reverse} |
|
24 | 28 |
} |
25 | 29 |
\value{ |
26 | 30 |
tree view with insets |
... | ... |
@@ -40,9 +40,10 @@ library("ggtree") |
40 | 40 |
|
41 | 41 |
|
42 | 42 |
# Citation |
43 |
+ |
|
43 | 44 |
If you use `ggtree` in published research, please cite: |
44 | 45 |
|
45 |
-__G Yu__, DK Smith, H Zhu, Y Guan, TTY Lam^\*^. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. __*Methods in Ecology and Evolution*__. _accepted_. doi:[10.1111/2041-210X.12628](http://dx.doi.org/10.1111/2041-210X.12628) |
|
46 |
+__G Yu__, DK Smith, H Zhu, Y Guan, TTY Lam^\*^. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. __*Methods in Ecology and Evolution*__. 2017, 8(1):28-36. doi:[10.1111/2041-210X.12628](http://dx.doi.org/10.1111/2041-210X.12628) |
|
46 | 47 |
|
47 | 48 |
|
48 | 49 |
# Introduction |