Browse code

jplace

guangchuang yu authored on 27/07/2017 03:46:36
Showing 3 changed files

... ...
@@ -2,7 +2,7 @@ Package: ggtree
2 2
 Type: Package
3 3
 Title: an R package for visualization and annotation of phylogenetic trees with
4 4
     their covariates and other associated data
5
-Version: 1.9.2
5
+Version: 1.9.3
6 6
 Authors@R: c(
7 7
 	   person("Guangchuang", "Yu", email = "guangchuangyu@gmail.com", role = c("aut", "cre", "cph")),
8 8
 	   person("Tommy Tsan-Yuk", "Lam", email = "tylam.tommy@gmail.com", rol = c("aut", "ths")),
... ...
@@ -1,3 +1,7 @@
1
+CHANGES IN VERSION 1.9.3
2
+------------------------
3
+ o update fortify.jplace to support number of placement (nplace) <2017-07-27, Thu>
4
+
1 5
 CHANGES IN VERSION 1.9.2
2 6
 ------------------------
3 7
  o add bg_line and height parameter in msaplot <2017-07-26, Wed>
... ...
@@ -371,7 +371,13 @@ fortify.jplace <- function(model, data,
371 371
     df <- extract.treeinfo.jplace(model, layout, ladderize, right, mrsd=mrsd, ...)
372 372
     place <- get.placements(model, by="best")
373 373
 
374
-    df <- df %add2% place
374
+    nplace <- split(place, place$edge_num) %>% lapply(nrow)
375
+    nplace.df <- data.frame(edgeNum = names(nplace), nplace=unlist(nplace))
376
+
377
+    ## df <- merge(df, place, by.x="edgeNum", by.y="edge_num", all.x=TRUE)
378
+    df <- merge(df, nplace.df, by.x="edgeNum", by.y="edgeNum", all.x=TRUE)
379
+
380
+    df$nplace[is.na(df$nplace)] <- 0
375 381
 
376 382
     df <- scaleY(model@phylo, df, yscale, layout, ...)
377 383