forked from YuLab-SMU/treedata-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
138 lines (105 loc) · 3.27 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
title: 'Data Integration, Manipulation and Visualization of Phylogenetic Trees'
author: Guangchuang Yu
date: "`r Sys.Date()`"
knit: "bookdown::render_book"
site: bookdown::bookdown_site
output:
bookdown::bs4_book:
bookdown::pdf_book:
dev: "cairo_pdf"
latex_engine: xelatex
bibliography: references.bib
biblio-style: apalike
always_allow_html: yes
toc_appendix: yes
fontsize: "12pt"
mainfont: Times New Roman
sansfont: Arial
monofontoptions: "Scale=0.7"
linestretch: 1.5
toc-depth: 2
link-citations: yes
github-repo: YuLab-SMU/treedata-book
twiter-handle: guangchuangyu
description: "Master ggtree package suit to handle tree with data."
documentclass: book
papersize: A4
classoption: twoside
highlight_bw: yes
geometry: "left=35mm,right=35mm,top=25mm,bottom=25mm"
---
```{r include=FALSE}
library(conflicted)
library(ape)
library(Biostrings)
## library(OutbreakTools)
library(igraph)
library(phylobase)
library(emojifont)
library(cowplot)
library(ggplot2)
library(dplyr)
library(kableExtra)
library(tidytree)
library(treeio)
library(ggtree)
conflict_prefer("expand", "ggtree")
conflict_prefer("mask", "treeio")
conflict_prefer("parent", "treeio")
conflict_prefer("ancestor", "treeio")
conflict_prefer("get.data", "treeio")
conflict_prefer("drop.tip", "treeio")
conflict_prefer("paste", "base")
conflict_prefer("MRCA", "tidytree")
conflict_prefer("filter", "dplyr")
conflict_prefer("rename", "dplyr")
conflict_prefer("collapse", "dplyr")
conflict_prefer("intersect", "dplyr")
conflict_prefer("union", "dplyr")
conflict_prefer("strsplit", "base")
conflict_prefer("geom_errorbarh", "ggplot2")
conflict_prefer("as.data.frame", "BiocGenerics")
options(width=60)
theme_set(theme_grey())
CRANpkg <- function (pkg) {
cran <- "https://CRAN.R-project.org/package"
fmt <- "[%s](%s=%s)"
sprintf(fmt, pkg, cran, pkg)
}
Biocpkg <- function (pkg) {
sprintf("[%s](http://bioconductor.org/packages/%s)", pkg, pkg)
}
Githubpkg <- function (user, pkg) {
gh <- "https://github.com"
fmt <- "[%s](%s/%s/%s)"
sprintf(fmt, pkg, gh, user, pkg)
}
badge_version <- function(pkg, color="green") {
v <- packageVersion(pkg)
url <- paste0("https://github.com/YuLab-SMU/", pkg)
badger::badge_custom(pkg, v, color, url)
}
## based on https://bookdown.org/yihui/rmarkdown-cookbook/fig-process.html
svg2png <- function(path, options) {
if (!grepl('[.]svg$', path)) return(path)
output <- sub(".svg$", ".png", path)
system2("convert", paste("-density 150", path, output))
file.remove(path)
return(output)
}
## manual setting. the ropenscilabs/icon package will set up everything for you.
## fontawesome supports
## htmltools::tagList(rmarkdown::html_dependency_font_awesome())
library(knitr)
opts_chunk$set(message=FALSE, warning=FALSE, eval=TRUE,
echo=TRUE, cache=TRUE, dev='svg')
```
# Welcome {-}
<img class="cover" src="book-cover.png" width="210" height="297" /> This is the online work-in-progress book of "Data Integration, Manipulation and Visualization of Phylogenetic Trees". This book gives your all the details of using the ggtree package suit to handle tree with data. The book is written by Guangchuang Yu.
`r if (knitr::is_latex_output()) '-->'`
<!--
<center>
<img src="book-cover.png" style="width:500px;border:2px solid black;"/>
</center>
-->