Browse code

update ggtree vignette

guangchuang yu authored on 21/12/2017 07:45:38
Showing 2 changed files

1 1
similarity index 100%
2 2
rename from vignettes/ggtreeUtilities.Rmd
3 3
rename to inst/ggtreeUtilities.Rmd
... ...
@@ -38,7 +38,10 @@ Biocpkg <- function (pkg) {
38 38
 
39 39
 ```
40 40
 
41
-> You can't even begin to understand biology, you can't understand life, unless you understand what it's all there for, how it arose - and that means evolution.
41
+> You can't even begin to understand biology, you can't understand life, unless
42
+> you understand what it's all there for, how it arose - and that means
43
+> evolution.
44
+>
42 45
 > --- Richard Dawkins
43 46
 
44 47
 
... ...
@@ -114,7 +117,12 @@ visualize or annotate phylogenetic tree in `r Biocpkg('ggtree')` [@yu_ggtree:_20
114 117
 
115 118
 # Tree Visualization and Annotation
116 119
 
117
-Tree Visualization in `ggtree` is easy, with one line of command `ggtree(tree_object)`. It supports several layouts, including `rectangular`, `slanted` and `circular` for `Phylogram` and `Cladogram`, `unrooted` layout, time-scaled and two dimentional phylogenies. [Tree Visualization](treeVisualization.html) vignette describes these feature in details.
120
+Tree Visualization in `r Biocpkg('ggtree')` is easy, with one line of command
121
+`ggtree(tree_object)`. It supports several layouts, including *rectangular*,
122
+*slanted*, *circular* and *fan* for *phylogram* and *cladogram*, *equal_angle*
123
+and *daylight* for *unrooted* layout, time-scaled and two dimentional
124
+phylogenies. [Tree Visualization](treeVisualization.html) vignette describes
125
+these feature in details.
118 126
 
119 127
 We implement several functions to manipulate a phylogenetic tree.
120 128
 
... ...
@@ -125,27 +133,73 @@ We implement several functions to manipulate a phylogenetic tree.
125 133
 + selected clade can be rotated by 180 degree using `rotate` function
126 134
 + position of two selected clades (should share a same parent) can be exchanged by `flip` function
127 135
 
136
+
128 137
 Details and examples can be found in [Tree Manipulation](treeManipulation.html) vignette.
129 138
 
130 139
 
131
-Most of the phylogenetic trees are scaled by evolutionary distance (substitution/site), in `ggtree` a phylogenetic tree can be re-scaled by any numerical variable inferred by evolutionary analysis (e.g. species divergence time, *dN/dS*, _etc_). Numerical and category variable can be used to color a phylogenetic tree.
140
+Most of the phylogenetic trees are scaled by evolutionary distance
141
+(substitution/site), in `r Biocpkg('ggtree')` a phylogenetic tree can be
142
+re-scaled by any numerical variable inferred by evolutionary analysis (e.g.
143
+species divergence time, *d~N~/d~S~*, _etc_). Numerical and category variable can be
144
+used to color a phylogenetic tree.
145
+
146
+The `r Biocpkg('ggtree')` package provides several layers to annotate a
147
+phylogenetic tree. These layers are building blocks that can be freely combined
148
+together to create complex tree visualization.
149
+
150
+```{r geoms, echo=FALSE, message=FALSE}
151
+geoms <- matrix(c(
152
+  "geom_balance", "highlights the two direct descendant clades of an internal node",
153
+  "geom_cladelabel", "annotate a clade with bar and text label",
154
+  "geom_cladelabel2", "annotate a clade with bar and text label for unrooted layout",
155
+  "geom_hilight", "highlight a clade with rectangle",
156
+  "geom_hilight_encircle", "highlight a clade with xspline for unrooted layout",
157
+  "geom_label2", "modified version of geom_label, with subsetting supported",
158
+  "geom_nodelab", "layer for node labels, which can be text or image",
159
+  "geom_nodepoint", "annotate internal nodes with symbolic points",
160
+  "geom_point2", "modified version of geom_point, with subsetting supported",
161
+  "geom_range", "bar layer to present uncertainty of evolutionary inference",
162
+  "geom_rootpoint", "annotate root node with symbolic point",
163
+  "geom_segment2", "modified version of geom_segment, with subsetting supported",
164
+  "geom_strip", "annotate associated taxa with bar and (optional) text label",
165
+  "geom_taxalink", "associate two related taxa by linking them with a curve",
166
+  "geom_text2", "modified version of geom_text, with subsetting supported",
167
+  "geom_tiplab", "layer of tip labels, which can be text or image",
168
+  "geom_tiplab2", "layer of tip labels for circular layout",
169
+  "geom_tippoint", "annotate external nodes with symbolic points",
170
+  "geom_tree", "tree structure layer, with multiple layout supported",
171
+  "geom_treescale", "tree branch scale legend"
172
+), ncol=2, byrow=TRUE)
173
+geoms <- as.data.frame(geoms)
174
+colnames(geoms) <- c("Layer", "Description")
175
+knitr::kable(geoms, caption = "Geom layers defined in ggtree.", booktabs = T)
176
+```
177
+
178
+`r Biocpkg('ggtree')` supports creating phylomoji using Emoji fonts, please
179
+refer to `r CRANpkg("emojifont")` package vignette for details. The vignette can
180
+be opened via the following command:
181
+
182
+```r
183
+vignette("phylomoji", package="emojifont")
184
+```
132 185
 
133
-The `ggtree` package provides several layers to annotate a phylogenetic tree, including:
134 186
 
135
-+ `geom_cladelabel` for labelling selected clades
136
-+ `geom_hilight` for highlighting selected clades
137
-+ `geom_range` to indicate uncertainty of branch lengths
138
-+ `geom_strip` for adding strip/bar to label associated taxa (with optional label)
139
-+ `geom_taxalink` for connecting related taxa
140
-+ `geom_tiplab` for adding tip labels
141
-+ `geom_treescale` for adding a legend of tree scale
187
+`r Biocpkg('ggtree')` integrates [phylopic](http://phylopic.org/) database and silhouette images of organisms can
188
+be downloaded and used to annotate phylogenetic directly. `r Biocpkg('ggtree')` also supports
189
+using local or remote images to annotate a phylogenetic tree. For details,
190
+please refer to the `r CRANpkg('ggimage')` package vignette, which can be opened
191
+via the following command:
142 192
 
143 193
 
144
-It supports annotating phylogenetic trees with analyses obtained from R packages and other commonly used evolutionary software. User's specific annotation (e.g. experimental data) can be integrated to annotate phylogenetic trees. `ggtree` provides `write.jplace` function to combine Newick tree file and user's own data to a single `jplace` file that can be parsed and the data can be used to annotate the tree directly in `ggtree`.
194
+```r
195
+vignette("ggtree", package="ggimage")
196
+```
145 197
 
146
-`ggtree` integrates `phylopic` database and silhouette images of organisms can be downloaded and used to annotate phylogenetic directly. `ggtree` also supports using local images to annotate a phylogenetic tree.
147 198
 
148
-Visualizing an annotated phylogenetic tree with numerical matrix (e.g. genotype table), multiple sequence alignment and subplots are also supported in `ggtree`. Examples of annotating phylogenetic trees can be found in the [Tree Annotation](treeAnnotation.html) and [Advance Tree Annotation](advanceTreeAnnotation.html) vignettes.
199
+Visualizing an annotated phylogenetic tree with numerical matrix (e.g. genotype
200
+table), multiple sequence alignment and subplots are also supported in `ggtree`.
201
+Examples of annotating phylogenetic trees can be found in
202
+the [Tree Annotation](treeAnnotation.html) vignette.
149 203
 
150 204
 
151 205
 # Vignette Entry
... ...
@@ -154,14 +208,13 @@ Visualizing an annotated phylogenetic tree with numerical matrix (e.g. genotype
154 208
 + [Tree Visualization](treeVisualization.html)
155 209
 + [Tree Manipulation](treeManipulation.html)
156 210
 + [Tree Annotation](treeAnnotation.html)
157
-+ [Advance Tree Annotation](advanceTreeAnnotation.html)
158 211
 + [Phylomoji](https://cran.r-project.org/web/packages/emojifont/vignettes/phylomoji.html)
159
-+ [Annotating phylogenetic tree with images using ggtree and ggimage](https://cran.r-project.org/web/packages/ggimage/vignettes/ggtree.html)
212
++ [Annotating phylogenetic tree with images](https://cran.r-project.org/web/packages/ggimage/vignettes/ggtree.html)
160 213
 
161 214
 
162 215
 More documents can be found in <https://guangchuangyu.github.io/ggtree>.
163 216
 
164
-## Feedback ##
217
+# Feedback #
165 218
 
166 219
  - For bugs or feature request, please post to [github issue](https://github.com/GuangchuangYu/ggtree/issues).
167 220
  - For user questions, please post to [google group](https://groups.google.com/forum/#!forum/bioc-ggtree).