Browse code

update docs

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@120612 bc3139a8-67e5-0310-9ffc-ced21a209358

Guangchuang Yu authored on 31/08/2016 06:22:59
Showing 8 changed files

... ...
@@ -7,3 +7,5 @@ TODO.md
7 7
 appveyor.yml
8 8
 Makefile
9 9
 README.Rmd
10
+mkdocs
11
+docs
... ...
@@ -4,3 +4,5 @@ vignettes/.DS_Store
4 4
 *~
5 5
 *.Rhistory
6 6
 .svn
7
+__init__.py
8
+__pycache__
... ...
@@ -6,3 +6,5 @@ TODO.md
6 6
 appveyor.yml
7 7
 .travis.yml
8 8
 README.Rmd
9
+docs
10
+mkdocs
... ...
@@ -1,5 +1,8 @@
1 1
 CHANGES IN VERSION 1.5.11
2 2
 ------------------------
3
+ o gheatmap works with matrix <2016-08-28, Sun>
4
+   + https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/bioc-ggtree/2YLvXHMJJ6U/c4zS7yfGCAAJ
5
+ o support parsing expression in geom_strip <2016-08-18, Thu>
3 6
  o bug fixed in geom_tiplab <2016-08-17, Wed>
4 7
    + https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/bioc-ggtree/Tm9ULK7hd9E/HviXEh3CBwAJ
5 8
  o update citation info, add doi. <2016-08-16, Tue>
... ...
@@ -16,13 +16,15 @@
16 16
 ##' @param hjust hjust
17 17
 ##' @param fill fill label background, only work with geom='label'
18 18
 ##' @param family sans by default, can be any supported font
19
+##' @param parse logical, whether parse label
19 20
 ##' @param ... additional parameter
20 21
 ##' @return ggplot layers
21 22
 ##' @export
22 23
 ##' @author Guangchuang Yu
23 24
 geom_strip <- function(taxa1, taxa2, label=NA, offset=0, offset.text=0,
24 25
                        align=TRUE, barsize=0.5, barextend=0, fontsize=3.88,
25
-                       angle=0, geom="text", hjust=0, fill=NA, family="sans", ...) {
26
+                       angle=0, geom="text", hjust=0, fill=NA, family="sans",
27
+                       parse=FALSE, ...) {
26 28
     mapping <- NULL
27 29
     data <- NULL
28 30
     position <- "identity"
... ...
@@ -46,14 +48,14 @@ geom_strip <- function(taxa1, taxa2, label=NA, offset=0, offset.text=0,
46 48
                                     align=align, size=fontsize, barextend=barextend, angle=angle, family=family,
47 49
                                     mapping=mapping, data=data, geom=geom, hjust=hjust,
48 50
                                     position=position, show.legend = show.legend,
49
-                                    inherit.aes = inherit.aes, na.rm=na.rm, ...)
51
+                                    inherit.aes = inherit.aes, na.rm=na.rm, parse=parse, ...)
50 52
         
51 53
     } else {
52 54
         layer_text <- stat_stripText(taxa1=taxa1, taxa2=taxa2, label=label, offset=offset+offset.text,
53 55
                                     align=align, size=fontsize, barextend=barextend, angle=angle, fill=fill,family=family,
54 56
                                     mapping=mapping, data=data, geom=geom, hjust=hjust,
55 57
                                     position=position, show.legend = show.legend,
56
-                                    inherit.aes = inherit.aes, na.rm=na.rm, ...)
58
+                                    inherit.aes = inherit.aes, na.rm=na.rm, parse=parse, ...)
57 59
     }
58 60
     
59 61
     list(
... ...
@@ -66,7 +68,7 @@ geom_strip <- function(taxa1, taxa2, label=NA, offset=0, offset.text=0,
66 68
 stat_stripText <- function(mapping=NULL, data=NULL,
67 69
                            geom="text", position="identity",
68 70
                            taxa1, taxa2, label, offset, align, barextend, ...,
69
-                           show.legend=NA, inherit.aes=FALSE, na.rm=FALSE) {
71
+                           show.legend=NA, inherit.aes=FALSE, na.rm=FALSE, parse=FALSE) {
70 72
 
71 73
     if (is.null(label) || is.na(label)) {
72 74
         default_aes <- aes_(x=~x, y=~y, node=~node, label=~label)
... ...
@@ -94,6 +96,7 @@ stat_stripText <- function(mapping=NULL, data=NULL,
94 96
                       align=align,
95 97
                       barextend=barextend,
96 98
                       na.rm=na.rm,
99
+                      parse=parse,
97 100
                       ...)
98 101
           )
99 102
     
... ...
@@ -43,7 +43,7 @@ gheatmap <- function(p, data, offset=0, width=1, low="green", high="red", color=
43 43
     df <- df[df$isTip,]
44 44
     start <- max(df$x) + offset
45 45
     
46
-    dd <- data
46
+    dd <- as.data.frame(data)
47 47
     ## dd$lab <- rownames(dd)
48 48
     lab <- df$label[order(df$y)]
49 49
     dd <- dd[lab, , drop=FALSE]
... ...
@@ -3,9 +3,9 @@ ggtree: an R package for visualization and annotation of phylogenetic trees with
3 3
 
4 4
 [![platform](http://www.bioconductor.org/shields/availability/devel/ggtree.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#archives) [![Build Status](http://www.bioconductor.org/shields/build/devel/bioc/ggtree.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/ggtree/) [![Linux/Mac Travis Build Status](https://img.shields.io/travis/GuangchuangYu/ggtree/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/GuangchuangYu/ggtree) [![AppVeyor Build Status](https://img.shields.io/appveyor/ci/Guangchuangyu/ggtree/master.svg?label=Windows)](https://ci.appveyor.com/project/GuangchuangYu/ggtree) [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-green.svg?style=flat)](http://bioconda.github.io/recipes/bioconductor-ggtree/README.html)
5 5
 
6
-[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![codecov](https://codecov.io/gh/GuangchuangYu/ggtree/branch/master/graph/badge.svg)](https://codecov.io/gh/GuangchuangYu/ggtree) [![Last-changedate](https://img.shields.io/badge/last%20change-2016--08--17-green.svg)](https://github.com/GuangchuangYu/ggtree/commits/master) [![commit](http://www.bioconductor.org/shields/commits/bioc/ggtree.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#svn_source) [![GitHub forks](https://img.shields.io/github/forks/GuangchuangYu/ggtree.svg)](https://github.com/GuangchuangYu/ggtree/network) [![GitHub stars](https://img.shields.io/github/stars/GuangchuangYu/ggtree.svg)](https://github.com/GuangchuangYu/ggtree/stargazers)
6
+[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![codecov](https://codecov.io/gh/GuangchuangYu/ggtree/branch/master/graph/badge.svg)](https://codecov.io/gh/GuangchuangYu/ggtree) [![Last-changedate](https://img.shields.io/badge/last%20change-2016--08--18-green.svg)](https://github.com/GuangchuangYu/ggtree/commits/master) [![commit](http://www.bioconductor.org/shields/commits/bioc/ggtree.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#svn_source) [![GitHub forks](https://img.shields.io/github/forks/GuangchuangYu/ggtree.svg)](https://github.com/GuangchuangYu/ggtree/network) [![GitHub stars](https://img.shields.io/github/stars/GuangchuangYu/ggtree.svg)](https://github.com/GuangchuangYu/ggtree/stargazers)
7 7
 
8
-[![releaseVersion](https://img.shields.io/badge/release%20version-1.4.16-green.svg?style=flat)](https://bioconductor.org/packages/ggtree) [![develVersion](https://img.shields.io/badge/devel%20version-1.5.11-green.svg?style=flat)](https://github.com/GuangchuangYu/ggtree) [![Bioc](http://www.bioconductor.org/shields/years-in-bioc/ggtree.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [![post](http://www.bioconductor.org/shields/posts/ggtree.svg)](https://support.bioconductor.org/t/ggtree/) [![download](http://www.bioconductor.org/shields/downloads/ggtree.svg)](https://bioconductor.org/packages/stats/bioc/ggtree/)
8
+[![releaseVersion](https://img.shields.io/badge/release%20version-1.4.17-green.svg?style=flat)](https://bioconductor.org/packages/ggtree) [![develVersion](https://img.shields.io/badge/devel%20version-1.5.11-green.svg?style=flat)](https://github.com/GuangchuangYu/ggtree) [![Bioc](http://www.bioconductor.org/shields/years-in-bioc/ggtree.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [![post](http://www.bioconductor.org/shields/posts/ggtree.svg)](https://support.bioconductor.org/t/ggtree/) [![download](http://www.bioconductor.org/shields/downloads/ggtree.svg)](https://bioconductor.org/packages/stats/bioc/ggtree/)
9 9
 
10 10
 The `ggtree` package extending the `ggplot2` package. It based on grammar of graphics and takes all the good parts of `ggplot2`. `ggtree` is designed for not only viewing phylogenetic tree but also displaying annotation data on the tree.
11 11
 
... ...
@@ -32,12 +32,6 @@ For details, please visit our project website, <https://guangchuangyu.github.io/
32 32
 
33 33
 [![download](http://www.bioconductor.org/shields/downloads/ggtree.svg)](https://bioconductor.org/packages/stats/bioc/ggtree/) [![total](https://img.shields.io/badge/downloads-12113/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree/) [![month](https://img.shields.io/badge/downloads-1091/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree/)
34 34
 
35
-    If you use ggtree in published research, please cite:
36
-
37
-    Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam.
38
-    ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data.
39
-    Methods in Ecology and Evolution 2016, doi:10.1111/2041-210X.12628
40
-
41 35
          +---------------------------+---------------------------+----------------------------+--------+
42 36
          |                                                                                    *        |
43 37
     1200 +                                                                                             +
... ...
@@ -7,7 +7,7 @@
7 7
 geom_strip(taxa1, taxa2, label = NA, offset = 0, offset.text = 0,
8 8
   align = TRUE, barsize = 0.5, barextend = 0, fontsize = 3.88,
9 9
   angle = 0, geom = "text", hjust = 0, fill = NA, family = "sans",
10
-  ...)
10
+  parse = FALSE, ...)
11 11
 }
12 12
 \arguments{
13 13
 \item{taxa1}{taxa1}
... ...
@@ -38,6 +38,8 @@ geom_strip(taxa1, taxa2, label = NA, offset = 0, offset.text = 0,
38 38
 
39 39
 \item{family}{sans by default, can be any supported font}
40 40
 
41
+\item{parse}{logical, whether parse label}
42
+
41 43
 \item{...}{additional parameter}
42 44
 }
43 45
 \value{