Browse code

tidytree

guangchuang yu authored on 07/12/2017 11:44:15
Showing49 changed files

... ...
@@ -27,6 +27,7 @@ Imports:
27 27
     scales,
28 28
     tibble,
29 29
     tidyr,
30
+    tidytree,
30 31
     utils
31 32
 Suggests:
32 33
     Biostrings,
... ...
@@ -7,7 +7,8 @@ all: rd readme check clean
7 7
 alldocs: site rd readme
8 8
 
9 9
 rd:
10
-	Rscript -e 'roxygen2::roxygenise(".")'
10
+	Rscript -e 'library(methods); devtools::document()'
11
+# Rscript -e 'roxygen2::roxygenise(".")'
11 12
 
12 13
 readme:
13 14
 	Rscript -e 'rmarkdown::render("README.Rmd")'
... ...
@@ -28,11 +29,11 @@ install:
28 29
 	cd ..;\
29 30
 	R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
30 31
 
31
-check: build
32
+check: rd build
32 33
 	cd ..;\
33 34
 	Rscript -e 'rcmdcheck::rcmdcheck("$(PKGNAME)_$(PKGVERS).tar.gz")'
34 35
 
35
-check2: build
36
+check2: rd build
36 37
 	cd ..;\
37 38
 	R CMD check $(PKGNAME)_$(PKGVERS).tar.gz
38 39
 
... ...
@@ -2,8 +2,6 @@
2 2
 
3 3
 S3method(as.binary,phylo)
4 4
 S3method(as.data.frame,phylo)
5
-S3method(as_data_frame,phylo)
6
-S3method(as_data_frame,treedata)
7 5
 S3method(fortify,multiPhylo)
8 6
 S3method(fortify,obkData)
9 7
 S3method(fortify,phylo)
... ...
@@ -184,13 +182,14 @@ importFrom(methods,setGeneric)
184 182
 importFrom(methods,setOldClass)
185 183
 importFrom(rvcheck,get_fun_from_pkg)
186 184
 importFrom(scales,alpha)
187
-importFrom(tibble,as_data_frame)
188 185
 importFrom(tibble,data_frame)
189 186
 importFrom(tidyr,gather)
187
+importFrom(tidytree,as_data_frame)
190 188
 importFrom(treeio,Nnode)
191 189
 importFrom(treeio,Ntip)
192 190
 importFrom(treeio,as.phylo)
193 191
 importFrom(treeio,as.treedata)
192
+importFrom(treeio,get_tree_data)
194 193
 importFrom(treeio,groupClade)
195 194
 importFrom(treeio,groupOTU)
196 195
 importFrom(utils,modifyList)
197 196
new file mode 100644
... ...
@@ -0,0 +1,63 @@
1
+## not used.
2
+## we don't guess mrsd from tip labels
3
+## user should provide mrsd parameter in ggtree if they want to use time-scaled tree
4
+scaleX_by_time <- function(df, as.Date=FALSE) {
5
+    time <- with(df, gsub(".*[_/]{1}(\\d+\\.*\\d+)$", "\\1", label[isTip])) %>% as.numeric
6
+    latest <- which.max(time)
7
+
8
+    scaleX_by_time_from_mrsd(df, decimal2Date(time[latest]), as.Date)
9
+}
10
+
11
+
12
+scaleX_by_time_from_mrsd <- function(df, mrsd, as.Date) {
13
+    mrsd %<>% as.Date
14
+    date <- Date2decimal(mrsd)
15
+
16
+    df$x <- df$x + date - max(df$x)
17
+    df$branch <- with(df, (x[match(parent, node)] + x)/2)
18
+    ## df$branch <- (df[df$parent, "x"] + df[, "x"])/2
19
+
20
+    if (as.Date) {
21
+        df$x <- decimal2Date(df$x)
22
+        df$branch <- decimal2Date(df$branch)
23
+    }
24
+
25
+    return(df)
26
+}
27
+
28
+
29
+##' convert Date to decimal format, eg "2014-05-05" to "2014.34"
30
+##'
31
+##'
32
+##' @title Date2decimal
33
+##' @param x Date
34
+##' @return numeric
35
+##' @export
36
+##' @author Guangchuang Yu
37
+Date2decimal <- function(x) {
38
+    if (is(x, "numeric")) {
39
+        return(x)
40
+    }
41
+
42
+    if (is(x, "character")) {
43
+        x <- as.Date(x)
44
+    }
45
+    year <- format(x, "%Y")
46
+    y <- x - as.Date(paste0(year, "-01-01"))
47
+    as.numeric(year) + as.numeric(y)/365
48
+}
49
+
50
+##' convert decimal format to Date, eg "2014.34" to "2014-05-05"
51
+##'
52
+##'
53
+##' @title decimal2Date
54
+##' @param x numerical number, eg 2014.34
55
+##' @return Date
56
+##' @export
57
+##' @author Guangchuang Yu
58
+decimal2Date <- function(x) {
59
+    date <- as.Date(paste0(floor(x), "-01-01"))
60
+    date + as.numeric(sub("^\\d+", "0", x)) * 365
61
+}
62
+
63
+
... ...
@@ -8,6 +8,7 @@
8 8
 ##' @return polytomy tree
9 9
 ##' @author Guangchuang
10 10
 ##' @importFrom ape di2multi
11
+##' @importFrom treeio Ntip
11 12
 ##' @export
12 13
 as.polytomy <- function(tree, feature, fun) {
13 14
     if (!is(tree, 'phylo')) {
14 15
new file mode 100644
... ...
@@ -0,0 +1,158 @@
1
+##' @importFrom ggplot2 fortify
2
+##' @method fortify treedata
3
+##' @export
4
+fortify.treedata <- function(model, data,
5
+                             layout        = "rectangular",
6
+                             yscale        = "none",
7
+                             ladderize     = TRUE,
8
+                             right         = FALSE,
9
+                             branch.length = "branch.length",
10
+                             mrsd          = NULL,
11
+                             as.Date       = FALSE, ...) {
12
+
13
+    model <- set_branch_length(model, branch.length)
14
+
15
+    fortify.phylo(model, data,
16
+                  layout        = layout,
17
+                  yscale        = yscale,
18
+                  ladderize     = ladderize,
19
+                  right         = right,
20
+                  branch.length = branch.length,
21
+                  mrsd          = mrsd,
22
+                  as.Date       = as.Date, ...)
23
+}
24
+
25
+##' @importFrom ape ladderize
26
+##' @importFrom treeio as.phylo
27
+##' @importFrom treeio Nnode
28
+##' @importFrom tibble data_frame
29
+##' @importFrom dplyr full_join
30
+##' @importFrom tidytree as_data_frame
31
+##' @method fortify phylo
32
+##' @export
33
+fortify.phylo <- function(model, data,
34
+                          layout        = "rectangular",
35
+                          ladderize     = TRUE,
36
+                          right         = FALSE,
37
+                          branch.length = "branch.length",
38
+                          mrsd          = NULL,
39
+                          as.Date       = FALSE,
40
+                          yscale        = "none",
41
+                          ...) {
42
+
43
+    x <- as.phylo(model) ## reorder.phylo(get.tree(model), "postorder")
44
+    if (ladderize == TRUE) {
45
+        x <- ladderize(x, right=right)
46
+    }
47
+
48
+    if (! is.null(x$edge.length)) {
49
+        if (anyNA(x$edge.length)) {
50
+            warning("'edge.length' contains NA values...\n## setting 'edge.length' to NULL automatically when plotting the tree...")
51
+            x$edge.length <- NULL
52
+        }
53
+    }
54
+
55
+    if (is.null(x$edge.length) || branch.length == "none") {
56
+        xpos <- getXcoord_no_length(x)
57
+    } else {
58
+        xpos <- getXcoord(x)
59
+    }
60
+
61
+    ypos <- getYcoord(x)
62
+    N <- Nnode(x, internal.only=FALSE)
63
+    xypos <- data_frame(node=1:N, x=xpos, y=ypos)
64
+
65
+    df <- as_data_frame(model)
66
+
67
+    res <- full_join(df, xypos, by = "node")
68
+
69
+    ## add branch mid position
70
+    res <- calculate_branch_mid(res)
71
+
72
+    if (!is.null(mrsd)) {
73
+        res <- scaleX_by_time_from_mrsd(res, mrsd, as.Date)
74
+    }
75
+
76
+    if (layout == "slanted") {
77
+        res <- add_angle_slanted(res)
78
+    } else {
79
+        ## angle for all layout, if 'rectangular', user use coord_polar, can still use angle
80
+        res <- calculate_angle(res)
81
+    }
82
+    scaleY(as.phylo(model), res, yscale, layout, ...)
83
+}
84
+
85
+##' @importFrom treeio get_tree_data
86
+set_branch_length <- function(tree_object, branch.length) {
87
+    if (branch.length == "branch.length") {
88
+        return(tree_object)
89
+    } else if (branch.length == "none") {
90
+        tree_object@phylo$edge.length <- NULL
91
+        return(tree_object)
92
+    }
93
+
94
+    if (is(tree_object, "phylo")) {
95
+        return(tree_object)
96
+    }
97
+
98
+    tree_anno <- get_tree_data(tree_object)
99
+    tree_anno$node <- as.integer(tree_anno$node)
100
+
101
+    phylo <- as.phylo(tree_object)
102
+
103
+    cn <- colnames(tree_anno)
104
+    cn <- cn[!cn %in% c('node', 'parent')]
105
+
106
+    length <- match.arg(branch.length, cn)
107
+
108
+    if (all(is.na(as.numeric(tree_anno[[length]])))) {
109
+        stop("branch.length should be numerical attributes...")
110
+    }
111
+
112
+    edge <- as_data_frame(phylo$edge)
113
+    colnames(edge) <- c("parent", "node")
114
+
115
+    dd <- full_join(edge, tree_anno, by = "node")
116
+
117
+    dd <- dd[match(edge[['node']], dd[['node']]),]
118
+    len <- unlist(dd[[length]])
119
+    len <- as.numeric(len)
120
+    len[is.na(len)] <- 0
121
+
122
+    phylo$edge.length <- len
123
+
124
+    tree_object@phylo <- phylo
125
+    return(tree_object)
126
+}
127
+
128
+
129
+calculate_angle <- function(data) {
130
+    data$angle <- 360/(diff(range(data$y)) + 1) * data$y
131
+    return(data)
132
+}
133
+
134
+
135
+
136
+scaleY <- function(phylo, df, yscale, layout, ...) {
137
+    if (yscale == "none") {
138
+        return(df)
139
+    }
140
+    if (! yscale %in% colnames(df)) {
141
+        warning("yscale is not available...\n")
142
+        return(df)
143
+    }
144
+    if (is.numeric(df[[yscale]])) {
145
+        y <- getYcoord_scale_numeric(phylo, df, yscale, ...)
146
+        ## if (order.y) {
147
+        ##     y <- getYcoord_scale2(phylo, df, yscale)
148
+        ## } else {
149
+        ##     y <- getYcoord_scale(phylo, df, yscale)
150
+        ## }
151
+    } else {
152
+        y <- getYcoord_scale_category(phylo, df, yscale, ...)
153
+    }
154
+
155
+    df[, "y"] <- y
156
+
157
+    return(df)
158
+}
... ...
@@ -17,8 +17,6 @@
17 17
 inset <- function(tree_view, insets, width=0.1, height=0.1, hjust=0, vjust=0,
18 18
                   x="node", reverse_x=FALSE, reverse_y=FALSE) {
19 19
 
20
-    message("The inset function will be defunct in next release, please use ggimage::geom_subview() instead.")
21
-
22 20
     df <- tree_view$data[as.numeric(names(insets)),]
23 21
     x <- match.arg(x, c("node", "branch", "edge"))
24 22
 
... ...
@@ -764,3 +764,717 @@ getNodesBreadthFirst.df <- function(df){
764 764
 
765 765
 
766 766
 
767
+##' convert tip or node label(s) to internal node number
768
+##'
769
+##'
770
+##' @title nodeid
771
+##' @param x tree object or graphic object return by ggtree
772
+##' @param label tip or node label(s)
773
+##' @return internal node number
774
+##' @importFrom methods is
775
+##' @export
776
+##' @author Guangchuang Yu
777
+nodeid <- function(x, label) {
778
+    if (is(x, "gg"))
779
+        return(nodeid.gg(x, label))
780
+
781
+    nodeid.tree(x, label)
782
+}
783
+
784
+nodeid.tree <- function(tree, label) {
785
+    tr <- get.tree(tree)
786
+    lab <- c(tr$tip.label, tr$node.label)
787
+    match(label, lab)
788
+}
789
+
790
+nodeid.gg <- function(p, label) {
791
+    p$data$node[match(label, p$data$label)]
792
+}
793
+
794
+
795
+reroot_node_mapping <- function(tree, tree2) {
796
+    root <- getRoot(tree)
797
+
798
+    node_map <- data.frame(from=1:getNodeNum(tree), to=NA, visited=FALSE)
799
+    node_map[1:Ntip(tree), 2] <- match(tree$tip.label, tree2$tip.label)
800
+    node_map[1:Ntip(tree), 3] <- TRUE
801
+
802
+    node_map[root, 2] <- root
803
+    node_map[root, 3] <- TRUE
804
+
805
+    node <- rev(tree$edge[,2])
806
+    for (k in node) {
807
+        ip <- getParent(tree, k)
808
+        if (node_map[ip, "visited"])
809
+            next
810
+
811
+        cc <- getChild(tree, ip)
812
+        node2 <- node_map[cc,2]
813
+        if (anyNA(node2)) {
814
+            node <- c(node, k)
815
+            next
816
+        }
817
+
818
+        to <- unique(sapply(node2, getParent, tr=tree2))
819
+        to <- to[! to %in% node_map[,2]]
820
+        node_map[ip, 2] <- to
821
+        node_map[ip, 3] <- TRUE
822
+    }
823
+    node_map <- node_map[, -3]
824
+    return(node_map)
825
+}
826
+
827
+
828
+
829
+##' Get parent node id of child node.
830
+##'
831
+##' @title getParent.df
832
+##' @param df tree data.frame
833
+##' @param node is the node id of child in tree.
834
+##' @return integer node id of parent
835
+getParent.df <- function(df, node) {
836
+    i <- which(df$node == node)
837
+    parent_id <- df$parent[i]
838
+    if (parent_id == node | is.na(parent_id)) {
839
+        ## root node
840
+        return(0)
841
+    }
842
+    return(parent_id)
843
+}
844
+
845
+
846
+getAncestor.df <- function(df, node) {
847
+    anc <- getParent.df(df, node)
848
+    anc <- anc[anc != 0]
849
+    if (length(anc) == 0) {
850
+        # stop("selected node is root...")
851
+      return(0)
852
+    }
853
+    i <- 1
854
+    while(i<= length(anc)) {
855
+        anc <- c(anc, getParent.df(df, anc[i]))
856
+        anc <- anc[anc != 0]
857
+        i <- i+1
858
+    }
859
+    return(anc)
860
+}
861
+
862
+
863
+
864
+##' Get list of child node id numbers of parent node
865
+##'
866
+##' @title getChild.df
867
+##' @param df tree data.frame
868
+##' @param node is the node id of child in tree.
869
+##' @return list of child node ids of parent
870
+getChild.df <- function(df, node) {
871
+    i <- which(df$parent == node)
872
+    if (length(i) == 0) {
873
+        return(0) # it has no children, hence tip node.
874
+    }
875
+    res <- df$node[i]
876
+    res <- res[res != node] ## node may root
877
+    return(res)
878
+}
879
+
880
+get.offspring.df <- function(df, node) {
881
+    sp <- getChild.df(df, node)
882
+    sp <- sp[sp != 0] # Remove root node.
883
+    if (length(sp) == 0) {
884
+        #stop("input node is a tip...")
885
+      return(0)
886
+    }
887
+
888
+    i <- 1
889
+    while(i <= length(sp)) {
890
+        sp <- c(sp, getChild.df(df, sp[i]))
891
+        sp <- sp[sp != 0]
892
+        i <- i + 1
893
+    }
894
+    return(sp)
895
+}
896
+
897
+
898
+
899
+##' extract offspring tips
900
+##'
901
+##'
902
+##' @title get.offspring.tip
903
+##' @param tr tree
904
+##' @param node node
905
+##' @return tip label
906
+##' @author ygc
907
+##' @importFrom ape extract.clade
908
+##' @export
909
+get.offspring.tip <- function(tr, node) {
910
+    if ( ! node %in% tr$edge[,1]) {
911
+        ## return itself
912
+        return(tr$tip.label[node])
913
+    }
914
+    clade <- extract.clade(tr, node)
915
+    clade$tip.label
916
+}
917
+
918
+
919
+
920
+
921
+getParent <- function(tr, node) {
922
+    if ( node == getRoot(tr) )
923
+        return(0)
924
+    edge <- tr[["edge"]]
925
+    parent <- edge[,1]
926
+    child <- edge[,2]
927
+    res <- parent[child == node]
928
+    if (length(res) == 0) {
929
+        stop("cannot found parent node...")
930
+    }
931
+    if (length(res) > 1) {
932
+        stop("multiple parent found...")
933
+    }
934
+    return(res)
935
+}
936
+
937
+
938
+
939
+
940
+getChild <- function(tr, node) {
941
+    # Get edge matrix from phylo object.
942
+    edge <- tr[["edge"]]
943
+    # Select all rows that match "node".
944
+    res <- edge[edge[,1] == node, 2]
945
+    ## if (length(res) == 0) {
946
+    ##     ## is a tip
947
+    ##     return(NA)
948
+    ## }
949
+    return(res)
950
+}
951
+
952
+
953
+getSibling <- function(tr, node) {
954
+    root <- getRoot(tr)
955
+    if (node == root) {
956
+        return(NA)
957
+    }
958
+
959
+    parent <- getParent(tr, node)
960
+    child <- getChild(tr, parent)
961
+    sib <- child[child != node]
962
+    return(sib)
963
+}
964
+
965
+
966
+getAncestor <- function(tr, node) {
967
+    root <- getRoot(tr)
968
+    if (node == root) {
969
+        return(NA)
970
+    }
971
+    parent <- getParent(tr, node)
972
+    res <- parent
973
+    while(parent != root) {
974
+        parent <- getParent(tr, parent)
975
+        res <- c(res, parent)
976
+    }
977
+    return(res)
978
+}
979
+
980
+
981
+isRoot <- function(tr, node) {
982
+    getRoot(tr) == node
983
+}
984
+
985
+getNodeName <- function(tr) {
986
+    if (is.null(tr$node.label)) {
987
+        n <- length(tr$tip.label)
988
+        nl <- (n + 1):(2 * n - 2)
989
+        nl <- as.character(nl)
990
+    }
991
+    else {
992
+        nl <- tr$node.label
993
+    }
994
+    nodeName <- c(tr$tip.label, nl)
995
+    return(nodeName)
996
+}
997
+
998
+
999
+
1000
+get.trunk <- function(tr) {
1001
+    root <- getRoot(tr)
1002
+    path_length <- sapply(1:(root-1), function(x) get.path_length(tr, root, x))
1003
+    i <- which.max(path_length)
1004
+    return(get.path(tr, root, i))
1005
+}
1006
+
1007
+##' path from start node to end node
1008
+##'
1009
+##'
1010
+##' @title get.path
1011
+##' @param phylo phylo object
1012
+##' @param from start node
1013
+##' @param to end node
1014
+##' @return node vectot
1015
+##' @export
1016
+##' @author Guangchuang Yu
1017
+get.path <- function(phylo, from, to) {
1018
+    anc_from <- getAncestor(phylo, from)
1019
+    anc_from <- c(from, anc_from)
1020
+    anc_to <- getAncestor(phylo, to)
1021
+    anc_to <- c(to, anc_to)
1022
+    mrca <- intersect(anc_from, anc_to)[1]
1023
+
1024
+    i <- which(anc_from == mrca)
1025
+    j <- which(anc_to == mrca)
1026
+
1027
+    path <- c(anc_from[1:i], rev(anc_to[1:(j-1)]))
1028
+    return(path)
1029
+}
1030
+
1031
+
1032
+get.path_length <- function(phylo, from, to, weight=NULL) {
1033
+    path <- get.path(phylo, from, to)
1034
+    if (is.null(weight)) {
1035
+        return(length(path)-1)
1036
+    }
1037
+
1038
+    df <- fortify(phylo)
1039
+    if ( ! (weight %in% colnames(df))) {
1040
+        stop("weight should be one of numerical attributes of the tree...")
1041
+    }
1042
+
1043
+    res <- 0
1044
+
1045
+    get_edge_index <- function(df, from, to) {
1046
+        which((df[,1] == from | df[,2] == from) &
1047
+                  (df[,1] == to | df[,2] == to))
1048
+    }
1049
+
1050
+    for(i in 1:(length(path)-1)) {
1051
+        ee <- get_edge_index(df, path[i], path[i+1])
1052
+        res <- res + df[ee, weight]
1053
+    }
1054
+
1055
+    return(res)
1056
+}
1057
+
1058
+##' @importFrom ape reorder.phylo
1059
+getNodes_by_postorder <- function(tree) {
1060
+  tree <- reorder.phylo(tree, "postorder")
1061
+    unique(rev(as.vector(t(tree$edge[,c(2,1)]))))
1062
+}
1063
+
1064
+getXcoord2 <- function(x, root, parent, child, len, start=0, rev=FALSE) {
1065
+    x[root] <- start
1066
+    x[-root] <- NA  ## only root is set to start, by default 0
1067
+
1068
+    currentNode <- root
1069
+    direction <- 1
1070
+    if (rev == TRUE) {
1071
+        direction <- -1
1072
+    }
1073
+
1074
+    while(anyNA(x)) {
1075
+        idx <- which(parent %in% currentNode)
1076
+        newNode <- child[idx]
1077
+        x[newNode] <- x[parent[idx]]+len[idx] * direction
1078
+        currentNode <- newNode
1079
+    }
1080
+
1081
+    return(x)
1082
+}
1083
+
1084
+
1085
+
1086
+
1087
+
1088
+
1089
+getXcoord_no_length <- function(tr) {
1090
+    edge <- tr$edge
1091
+    parent <- edge[,1]
1092
+    child <- edge[,2]
1093
+    root <- getRoot(tr)
1094
+
1095
+    len <- tr$edge.length
1096
+
1097
+    N <- getNodeNum(tr)
1098
+    x <- numeric(N)
1099
+    ntip <- Ntip(tr)
1100
+    currentNode <- 1:ntip
1101
+    x[-currentNode] <- NA
1102
+
1103
+    cl <- split(child, parent)
1104
+    child_list <- list()
1105
+    child_list[as.numeric(names(cl))] <- cl
1106
+
1107
+    while(anyNA(x)) {
1108
+        idx <- match(currentNode, child)
1109
+        pNode <- parent[idx]
1110
+        ## child number table
1111
+        p1 <- table(parent[parent %in% pNode])
1112
+        p2 <- table(pNode)
1113
+        np <- names(p2)
1114
+        i <- p1[np] == p2
1115
+        newNode <- as.numeric(np[i])
1116
+
1117
+        exclude <- rep(NA, max(child))
1118
+        for (j in newNode) {
1119
+            x[j] <- min(x[child_list[[j]]]) - 1
1120
+            exclude[child_list[[j]]] <- child_list[[j]]
1121
+        }
1122
+        exclude <- exclude[!is.na(exclude)]
1123
+
1124
+        ## currentNode %<>% `[`(!(. %in% exclude))
1125
+        ## currentNode %<>% c(., newNode) %>% unique
1126
+        currentNode <- currentNode[!currentNode %in% exclude]
1127
+        currentNode <- unique(c(currentNode, newNode))
1128
+
1129
+    }
1130
+    x <- x - min(x)
1131
+    return(x)
1132
+}
1133
+
1134
+
1135
+
1136
+
1137
+getXcoord <- function(tr) {
1138
+    edge <- tr$edge
1139
+    parent <- edge[,1]
1140
+    child <- edge[,2]
1141
+    root <- getRoot(tr)
1142
+
1143
+    len <- tr$edge.length
1144
+
1145
+    N <- getNodeNum(tr)
1146
+    x <- numeric(N)
1147
+    x <- getXcoord2(x, root, parent, child, len)
1148
+    return(x)
1149
+}
1150
+
1151
+
1152
+
1153
+
1154
+## scale the branch (the line plotted) to the actual value of edge length
1155
+## but it seems not the good idea as if we want to add x-axis (e.g. time-scaled tree)
1156
+## then the x-value is not corresponding to edge length as in rectangular layout
1157
+## getXYcoord_slanted <- function(tr) {
1158
+##     edge <- tr$edge
1159
+##     parent <- edge[,1]
1160
+##     child <- edge[,2]
1161
+##     root <- getRoot(tr)
1162
+
1163
+##     N <- getNodeNum(tr)
1164
+##     len <- tr$edge.length
1165
+##     y <- getYcoord(tr, step=min(len)/2)
1166
+##     len <- sqrt(len^2 - (y[parent]-y[child])^2)
1167
+##     x <- numeric(N)
1168
+##     x <- getXcoord2(x, root, parent, child, len)
1169
+##     res <- data.frame(x=x, y=y)
1170
+##     return(res)
1171
+## }
1172
+
1173
+
1174
+
1175
+## @importFrom magrittr %>%
1176
+##' @importFrom magrittr equals
1177
+getYcoord <- function(tr, step=1) {
1178
+    Ntip <- length(tr[["tip.label"]])
1179
+    N <- getNodeNum(tr)
1180
+
1181
+    edge <- tr[["edge"]]
1182
+    parent <- edge[,1]
1183
+    child <- edge[,2]
1184
+
1185
+    cl <- split(child, parent)
1186
+    child_list <- list()
1187
+    child_list[as.numeric(names(cl))] <- cl
1188
+
1189
+    y <- numeric(N)
1190
+    tip.idx <- child[child <= Ntip]
1191
+    y[tip.idx] <- 1:Ntip * step
1192
+    y[-tip.idx] <- NA
1193
+
1194
+    ## use lookup table
1195
+    pvec <- integer(max(tr$edge))
1196
+    pvec[child] = parent
1197
+
1198
+    currentNode <- 1:Ntip
1199
+    while(anyNA(y)) {
1200
+        ## pNode <- unique(parent[child %in% currentNode])
1201
+        pNode <- unique(pvec[currentNode])
1202
+
1203
+        ## piping of magrittr is slower than nested function call.
1204
+        ## pipeR is fastest, may consider to use pipeR
1205
+        ##
1206
+        ## child %in% currentNode %>% which %>% parent[.] %>% unique
1207
+        ## idx <- sapply(pNode, function(i) all(child[parent == i] %in% currentNode))
1208
+        idx <- sapply(pNode, function(i) all(child_list[[i]] %in% currentNode))
1209
+        newNode <- pNode[idx]
1210
+
1211
+        y[newNode] <- sapply(newNode, function(i) {
1212
+            mean(y[child_list[[i]]], na.rm=TRUE)
1213
+            ##child[parent == i] %>% y[.] %>% mean(na.rm=TRUE)
1214
+        })
1215
+
1216
+        currentNode <- c(currentNode[!currentNode %in% unlist(child_list[newNode])], newNode)
1217
+        ## currentNode <- c(currentNode[!currentNode %in% child[parent %in% newNode]], newNode)
1218
+        ## parent %in% newNode %>% child[.] %>%
1219
+        ##     `%in%`(currentNode, .) %>% `!` %>%
1220
+        ##         currentNode[.] %>% c(., newNode)
1221
+    }
1222
+
1223
+    return(y)
1224
+}
1225
+
1226
+
1227
+getYcoord_scale <- function(tr, df, yscale) {
1228
+
1229
+    N <- getNodeNum(tr)
1230
+    y <- numeric(N)
1231
+
1232
+    root <- getRoot(tr)
1233
+    y[root] <- 0
1234
+    y[-root] <- NA
1235
+
1236
+    edge <- tr$edge
1237
+    parent <- edge[,1]
1238
+    child <- edge[,2]
1239
+
1240
+    currentNodes <- root
1241
+    while(anyNA(y)) {
1242
+        newNodes <- c()
1243
+        for (currentNode in currentNodes) {
1244
+            idx <- which(parent %in% currentNode)
1245
+            newNode <- child[idx]
1246
+            direction <- -1
1247
+            for (i in seq_along(newNode)) {
1248
+                y[newNode[i]] <- y[currentNode] + df[newNode[i], yscale] * direction
1249
+                direction <- -1 * direction
1250
+            }
1251
+            newNodes <- c(newNodes, newNode)
1252
+        }
1253
+        currentNodes <- unique(newNodes)
1254
+    }
1255
+    if (min(y) < 0) {
1256
+        y <- y + abs(min(y))
1257
+    }
1258
+    return(y)
1259
+}
1260
+
1261
+
1262
+getYcoord_scale2 <- function(tr, df, yscale) {
1263
+    root <- getRoot(tr)
1264
+
1265
+    pathLength <- sapply(1:length(tr$tip.label), function(i) {
1266
+        get.path_length(tr, i, root, yscale)
1267
+    })
1268
+
1269
+    ordered_tip <- order(pathLength, decreasing = TRUE)
1270
+    ii <- 1
1271
+    ntip <- length(ordered_tip)
1272
+    while(ii < ntip) {
1273
+        sib <- getSibling(tr, ordered_tip[ii])
1274
+        if (length(sib) == 0) {
1275
+            ii <- ii + 1
1276
+            next
1277
+        }
1278
+        jj <- which(ordered_tip %in% sib)
1279
+        if (length(jj) == 0) {
1280
+            ii <- ii + 1
1281
+            next
1282
+        }
1283
+        sib <- ordered_tip[jj]
1284
+        ordered_tip <- ordered_tip[-jj]
1285
+        nn <- length(sib)
1286
+        if (ii < length(ordered_tip)) {
1287
+            ordered_tip <- c(ordered_tip[1:ii],sib, ordered_tip[(ii+1):length(ordered_tip)])
1288
+        } else {
1289
+            ordered_tip <- c(ordered_tip[1:ii],sib)
1290
+        }
1291
+
1292
+        ii <- ii + nn + 1
1293
+    }
1294
+
1295
+
1296
+    long_branch <- getAncestor(tr, ordered_tip[1]) %>% rev
1297
+    long_branch <- c(long_branch, ordered_tip[1])
1298
+
1299
+    N <- getNodeNum(tr)
1300
+    y <- numeric(N)
1301
+
1302
+    y[root] <- 0
1303
+    y[-root] <- NA
1304
+
1305
+    ## yy <- df[, yscale]
1306
+    ## yy[is.na(yy)] <- 0
1307
+
1308
+    for (i in 2:length(long_branch)) {
1309
+        y[long_branch[i]] <- y[long_branch[i-1]] + df[long_branch[i], yscale]
1310
+    }
1311
+
1312
+    parent <- df[, "parent"]
1313
+    child <- df[, "node"]
1314
+
1315
+    currentNodes <- root
1316
+    while(anyNA(y)) {
1317
+        newNodes <- c()
1318
+        for (currentNode in currentNodes) {
1319
+            idx <- which(parent %in% currentNode)
1320
+            newNode <- child[idx]
1321
+            newNode <- c(newNode[! newNode %in% ordered_tip],
1322
+                         rev(ordered_tip[ordered_tip %in% newNode]))
1323
+            direction <- -1
1324
+            for (i in seq_along(newNode)) {
1325
+                if (is.na(y[newNode[i]])) {
1326
+                    y[newNode[i]] <- y[currentNode] + df[newNode[i], yscale] * direction
1327
+                    direction <- -1 * direction
1328
+                }
1329
+            }
1330
+            newNodes <- c(newNodes, newNode)
1331
+        }
1332
+        currentNodes <- unique(newNodes)
1333
+    }
1334
+    if (min(y) < 0) {
1335
+        y <- y + abs(min(y))
1336
+    }
1337
+    return(y)
1338
+}
1339
+
1340
+
1341
+
1342
+getYcoord_scale_numeric <- function(tr, df, yscale, ...) {
1343
+    df <- .assign_parent_status(tr, df, yscale)
1344
+    df <- .assign_child_status(tr, df, yscale)
1345
+
1346
+    y <- df[, yscale]
1347
+
1348
+    if (anyNA(y)) {
1349
+        warning("NA found in y scale mapping, all were setting to 0")
1350
+        y[is.na(y)] <- 0
1351
+    }
1352
+
1353
+    return(y)
1354
+}
1355
+
1356
+
1357
+.assign_parent_status <- function(tr, df, variable) {
1358
+    yy <- df[[variable]]
1359
+    na.idx <- which(is.na(yy))
1360
+    if (length(na.idx) > 0) {
1361
+        tree <- get.tree(tr)
1362
+        nodes <- getNodes_by_postorder(tree)
1363
+        for (curNode in nodes) {
1364
+            children <- getChild(tree, curNode)
1365
+            if (length(children) == 0) {
1366
+                next
1367
+            }
1368
+            idx <- which(is.na(yy[children]))
1369
+            if (length(idx) > 0) {
1370
+                yy[children[idx]] <- yy[curNode]
1371
+            }
1372
+        }
1373
+    }
1374
+    df[, variable] <- yy
1375
+    return(df)
1376
+}
1377
+
1378
+
1379
+.assign_child_status <- function(tr, df, variable, yscale_mapping=NULL) {
1380
+    yy <- df[[variable]]
1381
+    if (!is.null(yscale_mapping)) {
1382
+        yy <- yscale_mapping[yy]
1383
+    }
1384
+
1385
+    na.idx <- which(is.na(yy))
1386
+    if (length(na.idx) > 0) {
1387
+        tree <- get.tree(tr)
1388
+        nodes <- rev(getNodes_by_postorder(tree))
1389
+        for (curNode in nodes) {
1390
+            parent <- getParent(tree, curNode)
1391
+            if (parent == 0) { ## already reach root
1392
+                next
1393
+            }
1394
+            idx <- which(is.na(yy[parent]))
1395
+            if (length(idx) > 0) {
1396
+                child <- getChild(tree, parent)
1397
+                yy[parent[idx]] <- mean(yy[child], na.rm=TRUE)
1398
+            }
1399
+        }
1400
+    }
1401
+    df[, variable] <- yy
1402
+    return(df)
1403
+}
1404
+
1405
+
1406
+getYcoord_scale_category <- function(tr, df, yscale, yscale_mapping=NULL, ...) {
1407
+    if (is.null(yscale_mapping)) {
1408
+        stop("yscale is category variable, user should provide yscale_mapping,
1409
+             which is a named vector, to convert yscale to numberical values...")
1410
+    }
1411
+    if (! is(yscale_mapping, "numeric") ||
1412
+        is.null(names(yscale_mapping))) {
1413
+        stop("yscale_mapping should be a named numeric vector...")
1414
+    }
1415
+
1416
+    if (yscale == "label") {
1417
+        yy <- df[[yscale]]
1418
+        ii <- which(is.na(yy))
1419
+        if (length(ii)) {
1420
+            df[ii, yscale] <- df[ii, "node"]
1421
+        }
1422
+    }
1423
+
1424
+    ## assign to parent status is more prefer...
1425
+    df <- .assign_parent_status(tr, df, yscale)
1426
+    df <- .assign_child_status(tr, df, yscale, yscale_mapping)
1427
+
1428
+    y <- df[[yscale]]
1429
+
1430
+    if (anyNA(y)) {
1431
+        warning("NA found in y scale mapping, all were setting to 0")
1432
+        y[is.na(y)] <- 0
1433
+    }
1434
+    return(y)
1435
+}
1436
+
1437
+
1438
+add_angle_slanted <- function(res) {
1439
+    x <- res[["x"]]
1440
+    y <- res[["y"]]
1441
+    dy <- (y - y[match(res$parent, res$node)]) / diff(range(y))
1442
+    dx <- (x - x[match(res$parent, res$node)]) / diff(range(x))
1443
+    theta <- atan(dy/dx)
1444
+    theta[is.na(theta)] <- 0 ## root node
1445
+    res$angle <- theta/pi * 180
1446
+
1447
+    branch.y <- (y[match(res$parent, res$node)] + y)/2
1448
+    idx <- is.na(branch.y)
1449
+    branch.y[idx] <- y[idx]
1450
+    res[, "branch.y"] <- branch.y
1451
+    return(res)
1452
+}
1453
+
1454
+
1455
+calculate_branch_mid <- function(res) {
1456
+    res$branch <- with(res, (x[match(parent, node)] + x)/2)
1457
+    if (!is.null(res$branch.length)) {
1458
+        res$branch.length[is.na(res$branch.length)] <- 0
1459
+    }
1460
+    res$branch[is.na(res$branch)] <- 0
1461
+    return(res)
1462
+}
1463
+
1464
+
1465
+re_assign_ycoord_df <- function(df, currentNode) {
1466
+    while(anyNA(df$y)) {
1467
+        pNode <- with(df, parent[match(currentNode, node)]) %>% unique
1468
+        idx <- sapply(pNode, function(i) with(df, all(node[parent == i & parent != node] %in% currentNode)))
1469
+        newNode <- pNode[idx]
1470
+        ## newNode <- newNode[is.na(df[match(newNode, df$node), "y"])]
1471
+
1472
+        df[match(newNode, df$node), "y"] <- sapply(newNode, function(i) {
1473
+            with(df, mean(y[parent == i], na.rm = TRUE))
1474
+        })
1475
+        traced_node <- as.vector(sapply(newNode, function(i) with(df, node[parent == i])))
1476
+        currentNode <- c(currentNode[! currentNode %in% traced_node], newNode)
1477
+    }
1478
+    return(df)
1479
+}
1480
+
... ...
@@ -4,7 +4,7 @@ ggtree: an R package for visualization and annotation of phylogenetic trees with
4 4
 
5 5
 <img src="https://raw.githubusercontent.com/Bioconductor/BiocStickers/master/ggtree/ggtree.png" height="200" align="right" />
6 6
 
7
-[![releaseVersion](https://img.shields.io/badge/release%20version-1.10.0-green.svg?style=flat)](https://bioconductor.org/packages/ggtree) [![develVersion](https://img.shields.io/badge/devel%20version-1.11.2-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) [![total](https://img.shields.io/badge/downloads-22066/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree) [![month](https://img.shields.io/badge/downloads-1218/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree)
7
+[![releaseVersion](https://img.shields.io/badge/release%20version-1.10.0-green.svg?style=flat)](https://bioconductor.org/packages/ggtree) [![develVersion](https://img.shields.io/badge/devel%20version-1.11.3-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) [![total](https://img.shields.io/badge/downloads-22066/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree) [![month](https://img.shields.io/badge/downloads-1218/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree)
8 8
 
9 9
 [![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-2017--12--07-green.svg)](https://github.com/GuangchuangYu/ggtree/commits/master) [![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) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://awesome-r.com/#awesome-r-graphic-displays)
10 10
 
... ...
@@ -344,36 +344,66 @@
344 344
 			<h1>Gallery </h1>
345 345
 
346 346
 			<p><link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css"></p>
347
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2017_science.jpg" /></p>
347
+<div class="figure">
348
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2017_science.jpg" />
349
+
350
+</div>
348 351
 <p><a href="http://dx.doi.org/10.1126/science.aao2136" class="uri">http://dx.doi.org/10.1126/science.aao2136</a></p>
349 352
 <hr />
350
-<p><img src="http://media.springernature.com/lw785/springer-static/image/art%3A10.1186%2Fs40168-017-0331-1/MediaObjects/40168_2017_331_Fig3_HTML.gif" /></p>
353
+<div class="figure">
354
+<img src="http://media.springernature.com/lw785/springer-static/image/art%3A10.1186%2Fs40168-017-0331-1/MediaObjects/40168_2017_331_Fig3_HTML.gif" />
355
+
356
+</div>
351 357
 <p><a href="https://doi.org/10.1186/s40168-017-0331-1" class="uri">https://doi.org/10.1186/s40168-017-0331-1</a></p>
352 358
 <hr />
353
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/syen12249-fig-0002.png" /></p>
359
+<div class="figure">
360
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/syen12249-fig-0002.png" />
361
+
362
+</div>
354 363
 <p><a href="https://doi.org/10.1111/syen.12249" class="uri">https://doi.org/10.1111/syen.12249</a></p>
355 364
 <hr />
356
-<p><img src="http://media.springernature.com/full/springer-static/image/art%3A10.1186%2Fs12915-017-0402-6/MediaObjects/12915_2017_402_Fig2_HTML.gif" /></p>
365
+<div class="figure">
366
+<img src="http://media.springernature.com/full/springer-static/image/art%3A10.1186%2Fs12915-017-0402-6/MediaObjects/12915_2017_402_Fig2_HTML.gif" />
367
+
368
+</div>
357 369
 <p><a href="https://doi.org/10.1186/s12915-017-0402-6" class="uri">https://doi.org/10.1186/s12915-017-0402-6</a></p>
358 370
 <hr />
359
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/fmicb-08-00543-g0002.jpg" /></p>
371
+<div class="figure">
372
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/fmicb-08-00543-g0002.jpg" />
373
+
374
+</div>
360 375
 <p><a href="http://dx.doi.org/10.3389/fmicb.2017.00543" class="uri">http://dx.doi.org/10.3389/fmicb.2017.00543</a></p>
361 376
 <hr />
362
-<p><img src="http://www.frontiersin.org/files/Articles/220056/fmicb-08-00456-HTML-r1/image_m/fmicb-08-00456-g002.jpg" /></p>
377
+<div class="figure">
378
+<img src="http://www.frontiersin.org/files/Articles/220056/fmicb-08-00456-HTML-r1/image_m/fmicb-08-00456-g002.jpg" />
379
+
380
+</div>
363 381
 <p><a href="https://doi.org/10.3389/fmicb.2017.00456" class="uri">https://doi.org/10.3389/fmicb.2017.00456</a></p>
364 382
 <hr />
365
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/40168_2017_232_Fig2_HTML.gif" /></p>
383
+<div class="figure">
384
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/40168_2017_232_Fig2_HTML.gif" />
385
+
386
+</div>
366 387
 <p><a href="http://dx.doi.org/10.1186/s40168-017-0232-3" class="uri">http://dx.doi.org/10.1186/s40168-017-0232-3</a></p>
367 388
 <hr />
368 389
 <p><img src="https://guangchuangyu.github.io/featured_img/ggtree/C2mxyBuUcAEt391.jpg" /> <a href="http://dx.doi.org/10.1111/2041-210X.12628" class="uri">http://dx.doi.org/10.1111/2041-210X.12628</a></p>
369 390
 <hr />
370
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2017-01-21-115646_969x444_scrot.png" /></p>
391
+<div class="figure">
392
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2017-01-21-115646_969x444_scrot.png" />
393
+
394
+</div>
371 395
 <p><a href="http://dx.doi.org/10.1128/AEM.02307-16" class="uri">http://dx.doi.org/10.1128/AEM.02307-16</a></p>
372 396
 <hr />
373
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2016_fcimb-06-00036-g003.jpg" /></p>
397
+<div class="figure">
398
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2016_fcimb-06-00036-g003.jpg" />
399
+
400
+</div>
374 401
 <p><a href="http://dx.doi.org/10.3389%2Ffcimb.2016.00036">http://dx.doi.org/10.3389%2Ffcimb.2016.00036</a></p>
375 402
 <hr />
376
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg" /></p>
403
+<div class="figure">
404
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg" />
405
+
406
+</div>
377 407
 <p><a href="http://dx.doi.org/10.1016/j.meegid.2015.12.006" class="uri">http://dx.doi.org/10.1016/j.meegid.2015.12.006</a></p>
378 408
 
379 409
 
... ...
@@ -19,16 +19,16 @@
19 19
       
20 20
       <guid>https://guangchuangyu.github.io/ggtree/gallery/</guid>
21 21
       <description>http://dx.doi.org/10.1126/science.aao2136
22
-https://doi.org/10.1186/s40168-017-0331-1
23
-https://doi.org/10.1111/syen.12249
24
-https://doi.org/10.1186/s12915-017-0402-6
25
-http://dx.doi.org/10.3389/fmicb.2017.00543
26
-https://doi.org/10.3389/fmicb.2017.00456
27
-http://dx.doi.org/10.1186/s40168-017-0232-3
22
+ https://doi.org/10.1186/s40168-017-0331-1
23
+ https://doi.org/10.1111/syen.12249
24
+ https://doi.org/10.1186/s12915-017-0402-6
25
+ http://dx.doi.org/10.3389/fmicb.2017.00543
26
+ https://doi.org/10.3389/fmicb.2017.00456
27
+ http://dx.doi.org/10.1186/s40168-017-0232-3
28 28
 http://dx.doi.org/10.1111/2041-210X.12628
29
-http://dx.doi.org/10.1128/AEM.02307-16
30
-http://dx.doi.org/10.3389%2Ffcimb.2016.00036
31
-http://dx.doi.org/10.1016/j.meegid.2015.12.006</description>
29
+ http://dx.doi.org/10.1128/AEM.02307-16
30
+ http://dx.doi.org/10.3389%2Ffcimb.2016.00036
31
+ http://dx.doi.org/10.1016/j.meegid.2015.12.006</description>
32 32
     </item>
33 33
     
34 34
   </channel>
... ...
@@ -346,7 +346,7 @@
346 346
 
347 347
 				<p><link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css"> <link rel="stylesheet" href="https://guangchuangyu.github.io/css/academicons.min.css"></p>
348 348
 <p><img src="https://raw.githubusercontent.com/Bioconductor/BiocStickers/master/ggtree/ggtree.png" height="200" align="right" /></p>
349
-<p><a href="https://bioconductor.org/packages/ggtree"><img src="https://img.shields.io/badge/release%20version-1.10.0-blue.svg?style=flat" alt="releaseVersion" /></a> <a href="https://github.com/guangchuangyu/ggtree"><img src="https://img.shields.io/badge/devel%20version-1.11.1-blue.svg?style=flat" alt="develVersion" /></a> <a href="https://bioconductor.org/packages/stats/bioc/ggtree"><img src="https://img.shields.io/badge/downloads-21911/total-blue.svg?style=flat" alt="total" /></a> <a href="https://bioconductor.org/packages/stats/bioc/ggtree"><img src="https://img.shields.io/badge/downloads-1156/month-blue.svg?style=flat" alt="month" /></a></p>
349
+<p><a href="https://bioconductor.org/packages/ggtree"><img src="https://img.shields.io/badge/release%20version-1.10.0-blue.svg?style=flat" alt="releaseVersion" /></a> <a href="https://github.com/guangchuangyu/ggtree"><img src="https://img.shields.io/badge/devel%20version-1.11.3-blue.svg?style=flat" alt="develVersion" /></a> <a href="https://bioconductor.org/packages/stats/bioc/ggtree"><img src="https://img.shields.io/badge/downloads-22066/total-blue.svg?style=flat" alt="total" /></a> <a href="https://bioconductor.org/packages/stats/bioc/ggtree"><img src="https://img.shields.io/badge/downloads-1218/month-blue.svg?style=flat" alt="month" /></a></p>
350 350
 <p>The <code>ggtree</code> package extending the <em>ggplot2</em> package. It based on grammar of graphics and takes all the good parts of <em>ggplot2</em>. <em>ggtree</em> is designed for not only viewing phylogenetic tree but also displaying annotation data on the tree. <em>ggtree</em> is released within the <a href="https://bioconductor.org/packages/ggtree/">Bioconductor</a> project and the source code is hosted on <a href="https://github.com/GuangchuangYu/ggtree"><i class="fa fa-github fa-lg"></i> GitHub</a>.</p>
351 351
 <div id="authors" class="section level2">
352 352
 <h2><i class="fa fa-user"></i> Authors</h2>
... ...
@@ -355,12 +355,15 @@
355 355
 <div id="citation" class="section level2">
356 356
 <h2><i class="fa fa-book"></i> Citation</h2>
357 357
 <p>Please cite the following article when using <code>ggtree</code>:</p>
358
-<p><a href="http://dx.doi.org/10.1111/2041-210X.12628"><img src="https://img.shields.io/badge/doi-10.1111/2041--210X.12628-blue.svg?style=flat" alt="doi" /></a> <a href="https://www.altmetric.com/details/10533079"><img src="https://img.shields.io/badge/Altmetric-333-blue.svg?style=flat" alt="Altmetric" /></a> <a href="https://scholar.google.com.hk/scholar?oi=bibs&amp;hl=en&amp;cites=7268358477862164627"><img src="https://img.shields.io/badge/cited%20by-51-blue.svg?style=flat" alt="citation" /></a></p>
358
+<p><a href="http://dx.doi.org/10.1111/2041-210X.12628"><img src="https://img.shields.io/badge/doi-10.1111/2041--210X.12628-blue.svg?style=flat" alt="doi" /></a> <a href="https://www.altmetric.com/details/10533079"><img src="https://img.shields.io/badge/Altmetric-334-blue.svg?style=flat" alt="Altmetric" /></a> <a href="https://scholar.google.com.hk/scholar?oi=bibs&amp;hl=en&amp;cites=7268358477862164627"><img src="https://img.shields.io/badge/cited%20by-52-blue.svg?style=flat" alt="citation" /></a></p>
359 359
 <p><strong>G Yu</strong>, 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. <strong><em>Methods in Ecology and Evolution</em></strong>. 2017, 8(1):28-36.</p>
360 360
 </div>
361 361
 <div id="featured-articles" class="section level2">
362 362
 <h2><i class="fa fa-pencil"></i> Featured Articles</h2>
363
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg" /></p>
363
+<div class="figure">
364
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg" />
365
+
366
+</div>
364 367
 <p><i class="fa fa-hand-o-right"></i> Find out more on <i class="fa fa-pencil"></i> <a href="https://guangchuangyu.github.io/ggtree/featuredArticles/">Featured Articles</a>.</p>
365 368
 </div>
366 369
 <div id="installation" class="section level2">
... ...
@@ -62,16 +62,16 @@ Gut metagenomes of type 2 diabetic patients have characteristic single-nucleotid
62 62
       
63 63
       <guid>https://guangchuangyu.github.io/ggtree/gallery/</guid>
64 64
       <description>http://dx.doi.org/10.1126/science.aao2136
65
-https://doi.org/10.1186/s40168-017-0331-1
66
-https://doi.org/10.1111/syen.12249
67
-https://doi.org/10.1186/s12915-017-0402-6
68
-http://dx.doi.org/10.3389/fmicb.2017.00543
69
-https://doi.org/10.3389/fmicb.2017.00456
70
-http://dx.doi.org/10.1186/s40168-017-0232-3
65
+ https://doi.org/10.1186/s40168-017-0331-1
66
+ https://doi.org/10.1111/syen.12249
67
+ https://doi.org/10.1186/s12915-017-0402-6
68
+ http://dx.doi.org/10.3389/fmicb.2017.00543
69
+ https://doi.org/10.3389/fmicb.2017.00456
70
+ http://dx.doi.org/10.1186/s40168-017-0232-3
71 71
 http://dx.doi.org/10.1111/2041-210X.12628
72
-http://dx.doi.org/10.1128/AEM.02307-16
73
-http://dx.doi.org/10.3389%2Ffcimb.2016.00036
74
-http://dx.doi.org/10.1016/j.meegid.2015.12.006</description>
72
+ http://dx.doi.org/10.1128/AEM.02307-16
73
+ http://dx.doi.org/10.3389%2Ffcimb.2016.00036
74
+ http://dx.doi.org/10.1016/j.meegid.2015.12.006</description>
75 75
     </item>
76 76
     
77 77
     <item>
... ...
@@ -81,11 +81,9 @@ http://dx.doi.org/10.1016/j.meegid.2015.12.006</description>
81 81
       
82 82
       <guid>https://guangchuangyu.github.io/ggtree/tweets/</guid>
83 83
       <description>Leave me a message on 
84
-Thank you so much @guangchuangyu! #ggtree is the easy way for my phd data analysis &amp;lt;3 love it!
85
-&amp;mdash; Francisco Romero (@pinchehippie) October 17, 2017  Now on https://t.co/50tYJLLZqc - a spotlight on the Top Tools for R Programming:
86
-ggtree made the list!https://t.co/YQv7FeegpM pic.twitter.com/hGn7nBfbEJ
87
-&amp;mdash; LabWorm (@TheLabWorm) September 27, 2017  geom_hilight_encircle for unrooted layout #ggtree #rstats pic.twitter.com/1wIwgwUduf
88
-&amp;mdash; Guangchuang Yu (@guangchuangyu) September 12, 2017  New Post: Plotting a Sequential Binary Partition on a Tree in R @alex_washburne @guangchuangyu https://t.</description>
84
+Also, thanks to @guangchuangyu for the R package ggtree - these visualizations are made possible by the reliability that sweet #rstats package!
85
+&amp;mdash; Alex Washburne (@alex_washburne) November 30, 2017  Thank you so much @guangchuangyu! #ggtree is the easy way for my phd data analysis &amp;lt;3 love it!
86
+&amp;mdash; Francisco Romero (@pinchehippie) October 17, 2017  Now on https://t.co/50tYJLLZqc - a spotlight on the Top Tools for R Programming:</description>
89 87
     </item>
90 88
     
91 89
   </channel>
... ...
@@ -345,7 +345,9 @@
345 345
 
346 346
 			<p><link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css"></p>
347 347
 <p><font size="4"><strong>Leave me a message on <a href="https://twitter.com/hashtag/ggtree"><i class="fa fa-twitter fa-lg"></i></a></strong></font></p>
348
-<p><blockquote class="twitter-tweet"><p lang="en" dir="ltr">Thank you so much <a href="https://twitter.com/guangchuangyu?ref_src=twsrc%5Etfw">@guangchuangyu</a>! <a href="https://twitter.com/hashtag/ggtree?src=hash&amp;ref_src=twsrc%5Etfw">#ggtree</a> is the easy way for my phd data analysis &lt;3 love it!</p>&mdash; Francisco Romero (@pinchehippie) <a href="https://twitter.com/pinchehippie/status/920370392451178496?ref_src=twsrc%5Etfw">October 17, 2017</a></blockquote>
348
+<p><blockquote class="twitter-tweet"><p lang="en" dir="ltr">Also, thanks to <a href="https://twitter.com/guangchuangyu?ref_src=twsrc%5Etfw">@guangchuangyu</a> for the R package ggtree - these visualizations are made possible by the reliability that sweet <a href="https://twitter.com/hashtag/rstats?src=hash&amp;ref_src=twsrc%5Etfw">#rstats</a> package!</p>&mdash; Alex Washburne (@alex_washburne) <a href="https://twitter.com/alex_washburne/status/936241103585517568?ref_src=twsrc%5Etfw">November 30, 2017</a></blockquote>
349
+<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
350
+<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Thank you so much <a href="https://twitter.com/guangchuangyu?ref_src=twsrc%5Etfw">@guangchuangyu</a>! <a href="https://twitter.com/hashtag/ggtree?src=hash&amp;ref_src=twsrc%5Etfw">#ggtree</a> is the easy way for my phd data analysis &lt;3 love it!</p>&mdash; Francisco Romero (@pinchehippie) <a href="https://twitter.com/pinchehippie/status/920370392451178496?ref_src=twsrc%5Etfw">October 17, 2017</a></blockquote>
349 351
 <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
350 352
 <blockquote class="twitter-tweet"><p lang="en" dir="ltr">Now on <a href="https://t.co/50tYJLLZqc">https://t.co/50tYJLLZqc</a> - a spotlight on the Top Tools for R Programming:<br>ggtree made the list!<a href="https://t.co/YQv7FeegpM">https://t.co/YQv7FeegpM</a> <a href="https://t.co/hGn7nBfbEJ">pic.twitter.com/hGn7nBfbEJ</a></p>&mdash; LabWorm (@TheLabWorm) <a href="https://twitter.com/TheLabWorm/status/912971120198012929?ref_src=twsrc%5Etfw">September 27, 2017</a></blockquote>
351 353
 <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
... ...
@@ -19,11 +19,9 @@
19 19
       
20 20
       <guid>https://guangchuangyu.github.io/ggtree/tweets/</guid>
21 21
       <description>Leave me a message on 
22
-Thank you so much @guangchuangyu! #ggtree is the easy way for my phd data analysis &amp;lt;3 love it!
23
-&amp;mdash; Francisco Romero (@pinchehippie) October 17, 2017  Now on https://t.co/50tYJLLZqc - a spotlight on the Top Tools for R Programming:
24
-ggtree made the list!https://t.co/YQv7FeegpM pic.twitter.com/hGn7nBfbEJ
25
-&amp;mdash; LabWorm (@TheLabWorm) September 27, 2017  geom_hilight_encircle for unrooted layout #ggtree #rstats pic.twitter.com/1wIwgwUduf
26
-&amp;mdash; Guangchuang Yu (@guangchuangyu) September 12, 2017  New Post: Plotting a Sequential Binary Partition on a Tree in R @alex_washburne @guangchuangyu https://t.</description>
22
+Also, thanks to @guangchuangyu for the R package ggtree - these visualizations are made possible by the reliability that sweet #rstats package!
23
+&amp;mdash; Alex Washburne (@alex_washburne) November 30, 2017  Thank you so much @guangchuangyu! #ggtree is the easy way for my phd data analysis &amp;lt;3 love it!
24
+&amp;mdash; Francisco Romero (@pinchehippie) October 17, 2017  Now on https://t.co/50tYJLLZqc - a spotlight on the Top Tools for R Programming:</description>
27 25
     </item>
28 26
     
29 27
   </channel>
... ...
@@ -7,34 +7,64 @@ weight: 40
7 7
 
8 8
 
9 9
 <p><link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css"></p>
10
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2017_science.jpg" /></p>
10
+<div class="figure">
11
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2017_science.jpg" />
12
+
13
+</div>
11 14
 <p><a href="http://dx.doi.org/10.1126/science.aao2136" class="uri">http://dx.doi.org/10.1126/science.aao2136</a></p>
12 15
 <hr />
13
-<p><img src="http://media.springernature.com/lw785/springer-static/image/art%3A10.1186%2Fs40168-017-0331-1/MediaObjects/40168_2017_331_Fig3_HTML.gif" /></p>
16
+<div class="figure">
17
+<img src="http://media.springernature.com/lw785/springer-static/image/art%3A10.1186%2Fs40168-017-0331-1/MediaObjects/40168_2017_331_Fig3_HTML.gif" />
18
+
19
+</div>
14 20
 <p><a href="https://doi.org/10.1186/s40168-017-0331-1" class="uri">https://doi.org/10.1186/s40168-017-0331-1</a></p>
15 21
 <hr />
16
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/syen12249-fig-0002.png" /></p>
22
+<div class="figure">
23
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/syen12249-fig-0002.png" />
24
+
25
+</div>
17 26
 <p><a href="https://doi.org/10.1111/syen.12249" class="uri">https://doi.org/10.1111/syen.12249</a></p>
18 27
 <hr />
19
-<p><img src="http://media.springernature.com/full/springer-static/image/art%3A10.1186%2Fs12915-017-0402-6/MediaObjects/12915_2017_402_Fig2_HTML.gif" /></p>
28
+<div class="figure">
29
+<img src="http://media.springernature.com/full/springer-static/image/art%3A10.1186%2Fs12915-017-0402-6/MediaObjects/12915_2017_402_Fig2_HTML.gif" />
30
+
31
+</div>
20 32
 <p><a href="https://doi.org/10.1186/s12915-017-0402-6" class="uri">https://doi.org/10.1186/s12915-017-0402-6</a></p>
21 33
 <hr />
22
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/fmicb-08-00543-g0002.jpg" /></p>
34
+<div class="figure">
35
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/fmicb-08-00543-g0002.jpg" />
36
+
37
+</div>
23 38
 <p><a href="http://dx.doi.org/10.3389/fmicb.2017.00543" class="uri">http://dx.doi.org/10.3389/fmicb.2017.00543</a></p>
24 39
 <hr />
25
-<p><img src="http://www.frontiersin.org/files/Articles/220056/fmicb-08-00456-HTML-r1/image_m/fmicb-08-00456-g002.jpg" /></p>
40
+<div class="figure">
41
+<img src="http://www.frontiersin.org/files/Articles/220056/fmicb-08-00456-HTML-r1/image_m/fmicb-08-00456-g002.jpg" />
42
+
43
+</div>
26 44
 <p><a href="https://doi.org/10.3389/fmicb.2017.00456" class="uri">https://doi.org/10.3389/fmicb.2017.00456</a></p>
27 45
 <hr />
28
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/40168_2017_232_Fig2_HTML.gif" /></p>
46
+<div class="figure">
47
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/40168_2017_232_Fig2_HTML.gif" />
48
+
49
+</div>
29 50
 <p><a href="http://dx.doi.org/10.1186/s40168-017-0232-3" class="uri">http://dx.doi.org/10.1186/s40168-017-0232-3</a></p>
30 51
 <hr />
31 52
 <p><img src="https://guangchuangyu.github.io/featured_img/ggtree/C2mxyBuUcAEt391.jpg" /> <a href="http://dx.doi.org/10.1111/2041-210X.12628" class="uri">http://dx.doi.org/10.1111/2041-210X.12628</a></p>
32 53
 <hr />
33
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2017-01-21-115646_969x444_scrot.png" /></p>
54
+<div class="figure">
55
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2017-01-21-115646_969x444_scrot.png" />
56
+
57
+</div>
34 58
 <p><a href="http://dx.doi.org/10.1128/AEM.02307-16" class="uri">http://dx.doi.org/10.1128/AEM.02307-16</a></p>
35 59
 <hr />
36
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2016_fcimb-06-00036-g003.jpg" /></p>
60
+<div class="figure">
61
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2016_fcimb-06-00036-g003.jpg" />
62
+
63
+</div>
37 64
 <p><a href="http://dx.doi.org/10.3389%2Ffcimb.2016.00036">http://dx.doi.org/10.3389%2Ffcimb.2016.00036</a></p>
38 65
 <hr />
39
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg" /></p>
66
+<div class="figure">
67
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg" />
68
+
69
+</div>
40 70
 <p><a href="http://dx.doi.org/10.1016/j.meegid.2015.12.006" class="uri">http://dx.doi.org/10.1016/j.meegid.2015.12.006</a></p>
... ...
@@ -9,7 +9,7 @@ weight: 1
9 9
 
10 10
 <p><link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css"> <link rel="stylesheet" href="https://guangchuangyu.github.io/css/academicons.min.css"></p>
11 11
 <p><img src="https://raw.githubusercontent.com/Bioconductor/BiocStickers/master/ggtree/ggtree.png" height="200" align="right" /></p>
12
-<p><a href="https://bioconductor.org/packages/ggtree"><img src="https://img.shields.io/badge/release%20version-1.10.0-blue.svg?style=flat" alt="releaseVersion" /></a> <a href="https://github.com/guangchuangyu/ggtree"><img src="https://img.shields.io/badge/devel%20version-1.11.1-blue.svg?style=flat" alt="develVersion" /></a> <a href="https://bioconductor.org/packages/stats/bioc/ggtree"><img src="https://img.shields.io/badge/downloads-21911/total-blue.svg?style=flat" alt="total" /></a> <a href="https://bioconductor.org/packages/stats/bioc/ggtree"><img src="https://img.shields.io/badge/downloads-1156/month-blue.svg?style=flat" alt="month" /></a></p>
12
+<p><a href="https://bioconductor.org/packages/ggtree"><img src="https://img.shields.io/badge/release%20version-1.10.0-blue.svg?style=flat" alt="releaseVersion" /></a> <a href="https://github.com/guangchuangyu/ggtree"><img src="https://img.shields.io/badge/devel%20version-1.11.3-blue.svg?style=flat" alt="develVersion" /></a> <a href="https://bioconductor.org/packages/stats/bioc/ggtree"><img src="https://img.shields.io/badge/downloads-22066/total-blue.svg?style=flat" alt="total" /></a> <a href="https://bioconductor.org/packages/stats/bioc/ggtree"><img src="https://img.shields.io/badge/downloads-1218/month-blue.svg?style=flat" alt="month" /></a></p>
13 13
 <p>The <code>ggtree</code> package extending the <em>ggplot2</em> package. It based on grammar of graphics and takes all the good parts of <em>ggplot2</em>. <em>ggtree</em> is designed for not only viewing phylogenetic tree but also displaying annotation data on the tree. <em>ggtree</em> is released within the <a href="https://bioconductor.org/packages/ggtree/">Bioconductor</a> project and the source code is hosted on <a href="https://github.com/GuangchuangYu/ggtree"><i class="fa fa-github fa-lg"></i> GitHub</a>.</p>
14 14
 <div id="authors" class="section level2">
15 15
 <h2><i class="fa fa-user"></i> Authors</h2>
... ...
@@ -18,12 +18,15 @@ weight: 1
18 18
 <div id="citation" class="section level2">
19 19
 <h2><i class="fa fa-book"></i> Citation</h2>
20 20
 <p>Please cite the following article when using <code>ggtree</code>:</p>
21
-<p><a href="http://dx.doi.org/10.1111/2041-210X.12628"><img src="https://img.shields.io/badge/doi-10.1111/2041--210X.12628-blue.svg?style=flat" alt="doi" /></a> <a href="https://www.altmetric.com/details/10533079"><img src="https://img.shields.io/badge/Altmetric-333-blue.svg?style=flat" alt="Altmetric" /></a> <a href="https://scholar.google.com.hk/scholar?oi=bibs&amp;hl=en&amp;cites=7268358477862164627"><img src="https://img.shields.io/badge/cited%20by-51-blue.svg?style=flat" alt="citation" /></a></p>
21
+<p><a href="http://dx.doi.org/10.1111/2041-210X.12628"><img src="https://img.shields.io/badge/doi-10.1111/2041--210X.12628-blue.svg?style=flat" alt="doi" /></a> <a href="https://www.altmetric.com/details/10533079"><img src="https://img.shields.io/badge/Altmetric-334-blue.svg?style=flat" alt="Altmetric" /></a> <a href="https://scholar.google.com.hk/scholar?oi=bibs&amp;hl=en&amp;cites=7268358477862164627"><img src="https://img.shields.io/badge/cited%20by-52-blue.svg?style=flat" alt="citation" /></a></p>
22 22
 <p><strong>G Yu</strong>, 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. <strong><em>Methods in Ecology and Evolution</em></strong>. 2017, 8(1):28-36.</p>
23 23
 </div>
24 24
 <div id="featured-articles" class="section level2">
25 25
 <h2><i class="fa fa-pencil"></i> Featured Articles</h2>
26
-<p><img src="https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg" /></p>
26
+<div class="figure">
27
+<img src="https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg" />
28
+
29
+</div>
27 30
 <p><i class="fa fa-hand-o-right"></i> Find out more on <i class="fa fa-pencil"></i> <a href="https://guangchuangyu.github.io/ggtree/featuredArticles/">Featured Articles</a>.</p>
28 31
 </div>
29 32
 <div id="installation" class="section level2">
... ...
@@ -8,4 +8,4 @@ weight: 50
8 8
 
9 9
 <p><link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css"></p>
10 10
 <p><font size="4"><strong>Leave me a message on <a href="https://twitter.com/hashtag/ggtree"><i class="fa fa-twitter fa-lg"></i></a></strong></font></p>
11
-<p>{{% tweet "920370392451178496" %}}{{% tweet "912971120198012929" %}}{{% tweet "907543915686793217" %}}{{% tweet "910671384069722112" %}}{{% tweet "903786057182957568" %}}{{% tweet "899635001247059969" %}}{{% tweet "898729425168080897" %}}{{% tweet "891144389715783680" %}}{{% tweet "883301626022375424" %}}{{% tweet "883246854695256064" %}}{{% tweet "877576023109390336" %}}{{% tweet "875594411584782337" %}}{{% tweet "871775262152810496" %}}{{% tweet "867408666852511744" %}}{{% tweet "857665638600507393" %}}{{% tweet "840181267542994944" %}}{{% tweet "839831849736232962" %}}{{% tweet "830023569887391744" %}}{{% tweet "829398997735313408" %}}{{% tweet "824264788456984576" %}}{{% tweet "822383911258890242" %}}{{% tweet "811666431452450816" %}}{{% tweet "811661275889549312" %}}{{% tweet "797041236867686400" %}}{{% tweet "797037016403820546" %}}{{% tweet "794278716859879424" %}}{{% tweet "831952966701678592" %}}{{% tweet "788751417746059264" %}}{{% tweet "693123105707986944" %}}{{% tweet "691762302492790788" %}}{{% tweet "687933344219312128" %}}{{% tweet "684411780412526592" %}}{{% tweet "665188011047563268" %}}{{% tweet "664040586001915904" %}}{{% tweet "639507420054749184" %}}{{% tweet "671673570259509248" %}}{{% tweet "667490462693912576" %}}{{% tweet "660278158663401473" %}}{{% tweet "641251456595685376" %}}{{% tweet "559734740488818688" %}}{{% tweet "559762891478667264" %}}{{% tweet "561514846291001344" %}}{{% tweet "559542705663905793" %}}{{% tweet "561056244782227456" %}}{{% tweet "664085841766195200" %}}{{% tweet "664431087683260416" %}}{{% tweet "667706456045694976" %}}{{% tweet "663937183791759360" %}}{{% tweet "663771499589861376" %}}{{% tweet "667433534756397057" %}}{{% tweet "640573716733169664" %}}{{% tweet "664407764001779712" %}}{{% tweet "630500659960254464" %}}{{% tweet "547497335412899840" %}}{{% tweet "610364467939913728" %}}</p>
11
+<p>{{% tweet "936241103585517568" %}}{{% tweet "920370392451178496" %}}{{% tweet "912971120198012929" %}}{{% tweet "907543915686793217" %}}{{% tweet "910671384069722112" %}}{{% tweet "903786057182957568" %}}{{% tweet "899635001247059969" %}}{{% tweet "898729425168080897" %}}{{% tweet "891144389715783680" %}}{{% tweet "883301626022375424" %}}{{% tweet "883246854695256064" %}}{{% tweet "877576023109390336" %}}{{% tweet "875594411584782337" %}}{{% tweet "871775262152810496" %}}{{% tweet "867408666852511744" %}}{{% tweet "857665638600507393" %}}{{% tweet "840181267542994944" %}}{{% tweet "839831849736232962" %}}{{% tweet "830023569887391744" %}}{{% tweet "829398997735313408" %}}{{% tweet "824264788456984576" %}}{{% tweet "822383911258890242" %}}{{% tweet "811666431452450816" %}}{{% tweet "811661275889549312" %}}{{% tweet "797041236867686400" %}}{{% tweet "797037016403820546" %}}{{% tweet "794278716859879424" %}}{{% tweet "831952966701678592" %}}{{% tweet "788751417746059264" %}}{{% tweet "693123105707986944" %}}{{% tweet "691762302492790788" %}}{{% tweet "687933344219312128" %}}{{% tweet "684411780412526592" %}}{{% tweet "665188011047563268" %}}{{% tweet "664040586001915904" %}}{{% tweet "639507420054749184" %}}{{% tweet "671673570259509248" %}}{{% tweet "667490462693912576" %}}{{% tweet "660278158663401473" %}}{{% tweet "641251456595685376" %}}{{% tweet "559734740488818688" %}}{{% tweet "559762891478667264" %}}{{% tweet "561514846291001344" %}}{{% tweet "559542705663905793" %}}{{% tweet "561056244782227456" %}}{{% tweet "664085841766195200" %}}{{% tweet "664431087683260416" %}}{{% tweet "667706456045694976" %}}{{% tweet "663937183791759360" %}}{{% tweet "663771499589861376" %}}{{% tweet "667433534756397057" %}}{{% tweet "640573716733169664" %}}{{% tweet "664407764001779712" %}}{{% tweet "630500659960254464" %}}{{% tweet "547497335412899840" %}}{{% tweet "610364467939913728" %}}</p>
... ...
@@ -11,6 +11,7 @@ weight: 50
11 11
 
12 12
 
13 13
 ````{r echo=FALSE}
14
+blogdown::shortcode('tweet', '936241103585517568')
14 15
 blogdown::shortcode('tweet', '920370392451178496')
15 16
 blogdown::shortcode('tweet', '912971120198012929')
16 17
 blogdown::shortcode('tweet', '907543915686793217')
17 18
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-../mysoftware/ChIPseeker.md
2 0
\ No newline at end of file
3 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-../mysoftware/DOSE.md
2 0
\ No newline at end of file
3 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-../mysoftware/GOSemSim.md
2 0
\ No newline at end of file
3 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-../mysoftware/ReactomePA.md
2 0
\ No newline at end of file
3 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-../mysoftware/clusterProfiler.md
2 0
\ No newline at end of file
3 1
deleted file mode 100644
... ...
@@ -1,167 +0,0 @@
1
-html_preview: False
2
-output:
3
-  md_document:
4
-    variant: markdown
5
-
6
-<!-- AddToAny BEGIN -->
7
-<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
8
-
9
-<a class="a2a_dd" href="//www.addtoany.com/share"></a>
10
-<a class="a2a_button_facebook"></a> <a class="a2a_button_twitter"></a>
11
-<a class="a2a_button_google_plus"></a>
12
-<a class="a2a_button_pinterest"></a> <a class="a2a_button_reddit"></a>
13
-<a class="a2a_button_sina_weibo"></a> <a class="a2a_button_wechat"></a>
14
-<a class="a2a_button_douban"></a>
15
-
16
-</div>
17
-
18
-<script async src="//static.addtoany.com/menu/page.js"></script>
19
-<!-- AddToAny END -->
20
-<link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css">
21
-
22
-<i class="fa fa-book"></i> Vignettes
23
-
24
--   [ggtree](https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/ggtree.html)
25
--   [Tree Data
26
-    Import](https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/treeImport.html)
27
--   [Tree
28
-    Visualization](https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/treeVisualization.html)
29
--   [Tree
30
-    Annotation](https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/treeAnnotation.html)
31
--   [Tree
32
-    Manipulation](https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/treeManipulation.html)
33
--   [Advance Tree
34
-    Annotation](https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/advanceTreeAnnotation.html)
35
--   [ggtree
36
-    utilities](https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/ggtreeUtilities.html)
37
--   [Phylomoji](https://cran.r-project.org/web/packages/emojifont/vignettes/phylomoji.html)
38
-
39
-<i class="fa fa-wordpress"></i> Blog posts
40
-
41
-### <i class="fa fa-angle-double-right"></i> News and updates
42
-
43
--   [viewing and annotating phylogenetic tree with
44
-    ggtree](https://guangchuangyu.github.io/2014/12/viewing-and-annotating-phylogenetic-tree-with-ggtree)
45
--   [ggtree in Bioconductor
46
-    3.1](https://guangchuangyu.github.io/2015/01/ggtree-in-bioconductor-3.1)
47
--   [BioC 3.1: NEWS of my BioC
48
-    packages](https://guangchuangyu.github.io/2015/04/bioc-31-news-of-my-bioc-packages)
49
--   [BioC 3.2: NEWS of my BioC
50
-    packages](https://guangchuangyu.github.io/2015/10/bioc-32-news-of-my-bioc-packages)
51
--   [News of
52
-    ggtree](https://guangchuangyu.github.io/2015/12/news-of-ggtree)
53
--   [BioC 3.3: NEWS of my BioC
54
-    packages](https://guangchuangyu.github.io/2016/05/bioc-33-news-of-my-bioc-packages/)
55
--   [BioC 3.4: NEWS of my BioC
56
-    packages](https://guangchuangyu.github.io/2016/10/bioc-34-news-of-my-bioc-packages)
57
--   [ggtree paper
58
-    published](https://guangchuangyu.github.io/2016/08/ggtree-paper-published)
59
-
60
-### <i class="fa fa-angle-double-right"></i> Data manipulation
61
-
62
--   [subsetting data in
63
-    ggtree](https://guangchuangyu.github.io/2015/09/subsetting-data-in-ggtree)
64
--   [ggtree supports phylip tree
65
-    format](https://guangchuangyu.github.io/2016/01/ggtree-supports-phylip-tree-format)
66
--   [convert graphic object to tree object using
67
-    treeio](http://guangchuangyu.github.io/2017/01/convert-graphic-object-to-tree-object-using-treeio/)
68
-
69
-### <i class="fa fa-angle-double-right"></i> Tree visualization
70
-
71
--   [ggtree - updating a tree
72
-    view](https://guangchuangyu.github.io/2015/02/ggtree---updating-a-tree-view/)
73
--   [an example of drawing beast tree using
74
-    ggtree](https://guangchuangyu.github.io/2015/04/an-example-of-drawing-beast-tree-using-ggtree)
75
--   [Phylogenetic trees in R using
76
-    ggtree](http://www.molecularecologist.com/2017/02/phylogenetic-trees-in-r-using-ggtree/)
77
-    <i class="fa fa-arrow-left"></i> The Molecular Ecologist
78
-
79
-### <i class="fa fa-angle-double-right"></i> Tree annotation
80
-
81
--   [label edge number in
82
-    ggtree](https://guangchuangyu.github.io/2016/01/label-edge-number-in-ggtree)
83
--   [Edge coloring with user
84
-    data](http://guangchuangyu.github.io/2016/12/edge-coloring-with-user-data/)
85
--   [subview](https://guangchuangyu.github.io/2015/08/subview)
86
--   [Annotate a phylogenetic tree with
87
-    insets](https://guangchuangyu.github.io/2016/01/annotate-a-phylogenetic-tree-with-insets)
88
--   [ggtree annotate phylogenetic tree with local
89
-    images](https://guangchuangyu.github.io/2015/08/ggtree-annotate-phylogenetic-tree-with-local-images)
90
--   [embed images in ggplot2 via subview and annotate a phylogenetic
91
-    tree with images using inset
92
-    function](https://guangchuangyu.github.io/2016/03/embed-images-in-ggplot2-via-subview-and-annotate-a-phylogenetic-tree-with-images-using-inset-function)
93
--   [identify method for
94
-    ggtree](https://guangchuangyu.github.io/2016/06/identify-method-for-ggtree)
95
--   [facet\_plot: a general solution to associate data with phylogenetic
96
-    tree](https://guangchuangyu.github.io/2016/10/facet_plot-a-general-solution-to-associate-data-with-phylogenetic-tree/)
97
--   [align genomic features with phylogenetic
98
-    tree](https://guangchuangyu.github.io/2016/11/align-genomic-features-with-phylogenetic-tree/)
99
--   [xlim\_tree: set x axis limits for only Tree
100
-    panel](https://guangchuangyu.github.io/2016/10/xlim_tree-set-x-axis-limits-for-only-tree-panel/)
101
--   [add layer to specific panel of facet\_plot
102
-    output](https://guangchuangyu.github.io/2016/12/add-layer-to-specific-panel-of-facet_plot-output/)
103
-
104
-### <i class="fa fa-angle-double-right"></i> Tree manipulation
105
-
106
--   [flip and rotate branches in
107
-    ggtree](https://guangchuangyu.github.io/2015/07/flip-and-rotate-branches-in-ggtree)
108
-
109
-### <i class="fa fa-angle-double-right"></i> Application
110
-
111
--   [ggtree for microbiome
112
-    data](https://guangchuangyu.github.io/2016/09/ggtree-for-microbiome-data/)
113
--   [ggtree for outbreak
114
-    data](https://guangchuangyu.github.io/2016/09/ggtree-for-outbreak-data/)
115
--   [ggtree version of
116
-    plotTree](http://guangchuangyu.github.io/2016/12/ggtree-version-of-plottree/)
117
--   [reproducible logo generated by
118
-    ggtree](https://guangchuangyu.github.io/2016/10/reproducible-logo-generated-by-ggtree)
119
-
120
-### <i class="fa fa-angle-double-right"></i> Funny stuff
121
-
122
--   [ggtree with funny
123
-    fonts](https://guangchuangyu.github.io/2015/06/ggtree-with-funny-fonts)
124
--   [comic phylogenetic tree with ggtree and
125
-    comicR](https://guangchuangyu.github.io/2015/09/comic-phylogenetic-tree-with-ggtree-and-comicr)
126
--   [use emoji font in
127
-    R](https://guangchuangyu.github.io/2015/12/use-emoji-font-in-r)
128
-
129
-### <i class="fa fa-angle-double-right"></i> User's feedback
130
-
131
--   [tweets of
132
-    ggtree](https://guangchuangyu.github.io/2016/02/tweets-of-ggtree)
133
--   Join the group chat on
134
-    <a href="https://twitter.com/hashtag/ggtree"><i class="fa fa-twitter fa-lg"></i></a>
135
-    and
136
-    <a href="http://huati.weibo.com/k/ggtree"><i class="fa fa-weibo fa-lg"></i></a>
137
-
138
-<i class="fa fa-hand-o-right"></i> Find out more on
139
-<https://guangchuangyu.github.io/tags/ggtree/>.
140
-
141
-<i class="fa fa-slideshare"></i> Slides
142
-
143
--   [Generating publication quality figures using R &
144
-    ggplot2](https://guangchuangyu.github.io/presentation/2014-ggplot2/)
145
--   [ggtree for visualization and annotation of phylogenetic
146
-    trees](https://guangchuangyu.github.io/presentation/2016-ggtree-chinar/)
147
-
148
-<i class="fa fa-youtube-play"></i> Video
149
-
150
--   [interactive clade
151
-    highlighting](https://www.youtube.com/watch?v=KcF8Ec38mzI)
152
--   [interactive rotating
153
-    clades](https://www.youtube.com/watch?v=lKNn4QlPO0E)
154
--   [interactive clade
155
-    labeling](https://www.youtube.com/watch?v=SmcceRD_jxg)
156
-
157
-<i class="fa fa-gift"></i> Workflow
158
-
159
--   [recreate a tree from a publication (**Bloom** *et al*,
160
-    ***Science*** 2010)](https://rpubs.com/gutijosh9430/124817)
161 0
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-../mysoftware/emojifont.md
2 0
\ No newline at end of file
3 1
deleted file mode 100644
... ...
@@ -1,223 +0,0 @@
1
-html_preview: False
2
-output:
3
-  md_document:
4
-    variant: markdown
5
-
6
-<!-- AddToAny BEGIN -->
7
-<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
8
-
9
-<a class="a2a_dd" href="//www.addtoany.com/share"></a>
10
-<a class="a2a_button_facebook"></a> <a class="a2a_button_twitter"></a>
11
-<a class="a2a_button_google_plus"></a>
12
-<a class="a2a_button_pinterest"></a> <a class="a2a_button_reddit"></a>
13
-<a class="a2a_button_sina_weibo"></a> <a class="a2a_button_wechat"></a>
14
-<a class="a2a_button_douban"></a>
15
-
16
-</div>
17
-
18
-<script async src="//static.addtoany.com/menu/page.js"></script>
19
-<!-- AddToAny END -->
20
-<link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css">
21
-
22
-<i class="fa fa-download"></i> Installation
23
-===========================================
24
-
25
-<i class="fa fa-angle-double-right"></i> Could not find function
26
-
27
-If you got [this
28
-error](https://github.com/GuangchuangYu/ggtree/issues/12), please make
29
-sure you are using the latest R and `ggtree`.
30
-
31
-Packages in Bioconductor, like `ggtree`, have different release policy
32
-compare to CRAN. There are two branches, release and devel, in parallel.
33
-Release branch is more stable and only document improvement and bug
34
-fixes will commit to it. New functions will only commit to `devel`
35
-branch.
36
-
37
-Sometimes I may write blog post to introduce new functions which is not
38
-available in `release` branch, you need to install the `devel` version
39
-of `ggtree` in order to use these new functions.
40
-
41
-You can download the `devel` version of `ggtree` from
42
-<http://bioconductor.org/packages/devel/bioc/html/ggtree.html> and
43
-install it, or install the github version of `ggtree`.
44
-
45
-This also applied to other of my packages, including `GOSemSim`, `DOSE`,
46
-`clusterProfiler`, `ReactomePA` and `ChIPseeker`. If you got the
47
-`could not find function` error, upgrade your installation to latest
48
-release. If the error still exists after upgrading to latest release,
49
-you need to install the devel version.
50
-
51
-<i class="fa fa-text-height"></i> Text & Label
52
-==============================================
53
-
54
-<i class="fa fa-angle-double-right"></i> Tip label truncated
55
-
56
-ggplot2 can't auto adjust xlim based on added text.
57
-
58
-``` {.r}
59
-library(ggtree)
60
-## example tree from https://support.bioconductor.org/p/72398/
61
-tree<-read.tree(text="(Organism1.006G249400.1:0.03977,(Organism2.022118m:0.01337,(Organism3.J34265.1:0.00284,Organism4.G02633.1:0.00468)0.51:0.0104):0.02469);")
62
-ggtree(tree) + geom_tiplab()
63
-```
64
-
65
-This is because the units are in two different spaces (data and pixel).
66
-Users can use xlim to allocate more space for tip label.
67
-
68
-``` {.r}
69
-ggtree(tree) + geom_tiplab() + xlim(0, 0.06)
70
-```
71
-
72
-<i class="fa fa-angle-double-right"></i> Modify (tip) labels
73
-
74
-This could be easily done via the `%<+%` operator to attach the modified
75
-version of the labels and than use `geom_tiplab` to display the modified
76
-version.
77
-
78
-    raxml_file <- system.file("extdata/RAxML", "RAxML_bipartitionsBranchLabels.H3", package="ggtree")
79
-    raxml <- read.raxml(raxml_file)
80
-
81
-    lb = get.tree(raxml)$tip.label
82
-    d = data.frame(label=lb, label2 = paste("AA", substring(lb, 1, 5)))
83
-    ggtree(raxml) %<+% d + geom_tiplab(aes(label=label2))
84
-
85
-see also
86
-[1](https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/bioc-ggtree/tFdFgCJ7gQA/tZ6phSgUDQAJ)
87
-and [2](https://github.com/GuangchuangYu/ggtree/issues/106).
88
-
89
-<i class="fa fa-angle-double-right"></i> Formatting (tip) labels
90
-
91
-If you want to format labels, you need to set `parse=TRUE` in
92
-`geom_text`/`geom_tiplab` and the `label` should be string that can be
93
-parsed into expression and displayed as described in `?plotmath`.
94
-
95
-For example, the tiplabels contains two parts, species name and
96
-accession number and we want to display species name in *italic*, we can
97
-use command like this:
98
-
99
-    ggtree(rtree(30)) + geom_tiplab(aes(subset=node==35), label='paste(italic("species name"), "accession number")', parse=T)
100
-
101
-Another example for formating all tip labels:
102
-
103
-    ggtree(rtree(30)) + geom_tiplab(aes(label=paste0('bold(', label, ')~italic(', node, ')')), parse=TRUE)
104
-
105
-see also
106
-<https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/bioc-ggtree/BA7g-npY1BM>.
107
-
108
-<i class="fa fa-angle-double-right"></i> Avoid overlapping text labels
109
-
110
-User can use [ggrepel](https://cran.r-project.org/web/packages/ggrepel/)
111
-package to repel overlapping text labels.
112
-
113
-For example:
114
-
115
-``` {.r}
116
-library(ggrepel)
117
-library(ggtree)
118
-raxml_file <- system.file("extdata/RAxML", "RAxML_bipartitionsBranchLabels.H3", package="ggtree")
119
-raxml <- read.raxml(raxml_file)
120
-ggtree(raxml) + geom_label_repel(aes(label=bootstrap, fill=bootstrap))
121
-```
122
-
123
-For details, please refer to [ggrepel usage
124
-examples](https://cran.r-project.org/web/packages/ggrepel/vignettes/ggrepel.html).
125
-
126
-<i class="fa fa-angle-double-right"></i> bootstrap values from newick format
127
-
128
-It's quite command to store `bootstrap` value as node label in `newick`
129
-format. Visualizing node label is easy using
130
-`geom_text2(aes(subset = !isTip, label=label))`.
131
-
132
-If you want to only display a subset of `bootstrap` (e.g. bootstrap &gt;
133
-80), you can't simply using
134
-`geom_text2(subset= (label > 80), label=label)` since `label` is a
135
-character vector, which contains node label (bootstrap value) and tip
136
-label (taxa name). If we use
137
-`geom_text2(subset=(as.numeric(label) > 80), label=label)`, it will also
138
-fail since `NAs` were introduced by coercion. We need to convert `NAs`
139
-to logical `FALSE`, this can be done by the following code:
140
-
141
-``` {.r}
142
-nwk <- system.file("extdata/RAxML","RAxML_bipartitions.H3", package='ggtree')
143
-tr <- read.tree(nwk)
144
-ggtree(tr) + geom_text2(aes(label=label, subset = !is.na(as.numeric(label)) & as.numeric(label) > 80))
145
-```
146
-
147
-Another solution is converting the bootstrap value outside `ggtree` as I
148
-recommended in [google
149
-group](https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/bioc-ggtree/hiRBjGaAfI0/Y-2zDpvtAwAJ).
150
-
151
-``` {.r}
152
-q <- ggtree(tr)
153
-d <- q$data
154
-d <- d[!d$isTip,]
155
-d$label <- as.numeric(d$label)
156
-d <- d[d$label > 80,]
157
-
158
-q + geom_text(data=d, aes(label=label))
159
-```
160
-
161
-<i class="fa fa-map-marker"></i> *aesthetic* mapping
162
-====================================================
163
-
164
-<i class="fa fa-angle-double-right"></i> inherit *aes*
165
-
166
-``` {.r}
167
-ggtree(rtree(30)) + geom_point()
168
-```
169
-
170
-For example, we can add symbolic points to nodes with `geom_point()`
171
-directly. The magic here is we don't need to map `x` and `y` position of
172
-the points by providing `aes(x, y)` to `geom_point()` since it was
173
-already mapped by `ggtree` function and it serves as a global mapping
174
-for all layers.
175
-
176
-But what if we provide a `dataset` in a layer and the `dataset` doesn't
177
-contain column of `x` and/or `y`, the layer function also try to map `x`
178
-and `y` and also others if you map them in `ggtree` function. As these
179
-variable is not available in your `dataset`, you will get the following
180
-error:
181
-
182
-    Error in eval(expr, envir, enclos) : object 'x' not found
183
-
184
-This can be fixed by using parameter `inherit.aes=FALSE` which will
185
-disable inheriting mapping from `ggtree` function.
186
-
187
-<i class="fa fa-angle-double-right"></i> use `$` in aes
188
-
189
-NEVER DO THIS.
190
-
191
-see the explaination in the [ggplot2 book
192
-2ed](https://github.com/hadley/ggplot2-book/blob/master/layers.rmd#aesthetic-mappings-secaes):
193
-
194
-> Never refer to a variable with `$` (e.g., `diamonds$carat`) in
195
-> `aes()`. This breaks containment, so that the plot no longer contains
196
-> everything it needs, and causes problems if ggplot2 changes the order
197
-> of the rows, as it does when facetting.
198
-
199
-see also
200
-[1](https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/bioc-ggtree/hViM6vRZF94/MsZT8qRgBwAJ)
201
-and [2](https://github.com/GuangchuangYu/ggtree/issues/106).
202
-
203
-<i class="fa fa-tree"></i> Annotation
204
-=====================================
205
-
206
-<i class="fa fa-angle-double-right"></i> colouring edges by user data
207
-
208
-see my blog post: [Edge coloring with user
209
-data](http://guangchuangyu.github.io/2016/12/edge-coloring-with-user-data/)
210
-and also my answer on
211
-<https://github.com/GuangchuangYu/ggtree/issues/76> and
212
-<https://groups.google.com/forum/#!topic/bioc-ggtree/4GgivKqVjB8>.
213 0
deleted file mode 100644
... ...
@@ -1,98 +0,0 @@
1
-html_preview: False
2
-output:
3
-  md_document:
4
-    variant: markdown
5
-
6
-<!-- AddToAny BEGIN -->
7
-<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
8
-
9
-<a class="a2a_dd" href="//www.addtoany.com/share"></a>
10
-<a class="a2a_button_facebook"></a> <a class="a2a_button_twitter"></a>
11
-<a class="a2a_button_google_plus"></a>
12
-<a class="a2a_button_pinterest"></a> <a class="a2a_button_reddit"></a>
13
-<a class="a2a_button_sina_weibo"></a> <a class="a2a_button_wechat"></a>
14
-<a class="a2a_button_douban"></a>
15
-
16
-</div>
17
-
18
-<script async src="//static.addtoany.com/menu/page.js"></script>
19
-<!-- AddToAny END -->
20
-<link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css">
21
-
22
-[Let us know](https://github.com/GuangchuangYu/featured_img) if you have
23
-published using `ggtree` and your publication will be featured here.
24
-
25
-[![citation](https://img.shields.io/badge/cited%20by-26-blue.svg?style=flat)](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627)
26
-
27
-<link rel='stylesheet' href=https://guangchuangyu.github.io/resume/css/morris.css>
28
-<script src='https://guangchuangyu.github.io/resume/css/jquery.min.js' type='text/javascript'></script>
29
-<script src='https://guangchuangyu.github.io/resume/css/raphael-min.js' type='text/javascript'></script>
30
-<script src='https://guangchuangyu.github.io/resume/css/morris-0.4.2.min.js' type='text/javascript'></script>
31
-<style>
32
-  .rChart {
33
-    display: block;
34
-    margin-left: auto; 
35
-    margin-right: auto;
36
-    width: 800px;
37
-    height: 300px;
38
-  }  
39
-  </style>
40
-<div id="chart41ca67213e2b" class="rChart morris">
41
-
42
-</div>
43
-
44
-<script type='text/javascript'>
45
-    var chartParams = {
46
- "element": "chart41ca67213e2b",
47
-"width":            800,
48
-"height":            400,
49
-"xkey": "year",
50
-"ykeys": [
51
- "cites" 
52
-],
53
-"data": [
54
- {
55
- "year": 2016,
56
-"cites":              1,
57
-"pubid": "HtEfBTGE9r8C" 
58
-},
59
-{
60
- "year": 2017,
61
-"cites":             25,
62
-"pubid": "HtEfBTGE9r8C" 
63
-} 
64
-],
65
-"id": "chart41ca67213e2b",
66
-"labels": "cites" 
67
-},
68
-      chartType = "Bar"
69
-    new Morris[chartType](chartParams)
70
-</script>
71
-<!-- citation:=HtEfBTGE9r8C:=7268358477862164627 -->
72
-<!-- article_citation:=HtEfBTGE9r8C -->
73
-<i class="fa fa-calendar"></i> 2017
74
-
75
-[Phylogenetic analysis of the human antibody repertoire reveals
76
-quantitative signatures of immune senescence and
77
-aging](http://dx.doi.org/10.1073/pnas.1617959114). ***PNAS***, 2017
78
-
79
-[Horses in Denmark Are a Reservoir of Diverse Clones of
80
-Methicillin-Resistant and -Susceptible Staphylococcus
81
-aureus](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5376617/).
82
-***Frontiers in Microbiology***, 2017, 8:543
83
-
84
-[Gut metagenomes of type 2 diabetic patients have characteristic
85
-single-nucleotide polymorphism distribution in *Bacteroides
86
-coprocola*](https://microbiomejournal.biomedcentral.com/articles/10.1186/s40168-017-0232-3).
87
-***Microbiome***, 2017, 5:15
88
-
89
-<i class="fa fa-calendar"></i> 2016
90
-
91
-[Function and Phylogeny of Bacterial Butyryl Coenzyme A:Acetate
92
-Transferases and Their Diversity in the Proximal Colon of
93
-Swine](http://aem.asm.org/content/82/22/6788.short). ***Applied and
94
-Environmental Microbiology***. 2016, 82(22):6788-6798.
95 0
deleted file mode 100644
... ...
@@ -1,174 +0,0 @@
1
-html_preview: False
2
-output:
3
-  md_document:
4
-    variant: markdown
5
-
6
-<!-- AddToAny BEGIN -->
7
-<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
8
-
9
-<a class="a2a_dd" href="//www.addtoany.com/share"></a>
10
-<a class="a2a_button_facebook"></a> <a class="a2a_button_twitter"></a>
11
-<a class="a2a_button_google_plus"></a>
12
-<a class="a2a_button_pinterest"></a> <a class="a2a_button_reddit"></a>
13
-<a class="a2a_button_sina_weibo"></a> <a class="a2a_button_wechat"></a>
14
-<a class="a2a_button_douban"></a>
15
-
16
-</div>
17
-
18
-<script async src="//static.addtoany.com/menu/page.js"></script>
19
-<!-- AddToAny END -->
20
-<link rel="stylesheet" href="https://guangchuangyu.github.io/css/font-awesome.min.css">
21
-
22
-[![citation](https://img.shields.io/badge/cited%20by-26-blue.svg?style=flat)](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627)
23
-
24
-<!-- citation:=HtEfBTGE9r8C:=7268358477862164627 -->
25
-<i class="fa fa-mortar-board"></i> Journal Articles
26
-
27
--   <http://dx.doi.org/10.3389/fmicb.2017.00543>
28
-
29
-![](https://guangchuangyu.github.io/featured_img/ggtree/fmicb-08-00543-g0002.jpg)
30
-
31
-
32
--   <https://doi.org/10.3389/fmicb.2017.00456>
33
-
34
-![](http://www.frontiersin.org/files/Articles/220056/fmicb-08-00456-HTML-r1/image_m/fmicb-08-00456-g002.jpg)
35
-
36
-
37
--   <http://dx.doi.org/10.1186/s40168-017-0232-3>
38
-
39
-![](https://guangchuangyu.github.io/featured_img/ggtree/40168_2017_232_Fig2_HTML.gif)
40
-
41
-
42
--   <http://dx.doi.org/10.1111/2041-210X.12628>
43
-
44
-![](https://guangchuangyu.github.io/featured_img/ggtree/C2mxyBuUcAEt391.jpg)
45
-
46
-
47
--   <http://dx.doi.org/10.1128/AEM.02307-16>
48
-
49
-![](https://guangchuangyu.github.io/featured_img/ggtree/2017-01-21-115646_969x444_scrot.png)
50
-
51
-
52
--   <http://dx.doi.org/10.3389%2Ffcimb.2016.00036>
53
-
54
-![](https://guangchuangyu.github.io/featured_img/ggtree/2016_fcimb-06-00036-g003.jpg)
55
-
56
-
57
--   <http://dx.doi.org/10.1016/j.meegid.2015.12.006>
58
-
59
-![](https://guangchuangyu.github.io/featured_img/ggtree/2015_peiyu_1-s2.0-S1567134815300721-gr1.jpg)
60
-
61
-<i class="fa fa-twitter"></i> Tweets
62
-
63
-<blockquote class="twitter-tweet" data-lang="en">
64
-<p lang="en" dir="ltr">
65
-Adaptive radiation of
66
-<a href="https://twitter.com/hashtag/Darwin?src=hash">\#Darwin</a>'s
67