Browse code

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 23d2bf194cee19e455e16165b0e6bd064863b5a0

Merge branch 'master' of github.com:GuangchuangYu/ggtree


Commit id: ec0aa5ca9ac8aace3eac8a149f34d4ae8999430c

o edgeNum2nodeNum for converting edge number to node number for EPA/pplacer output <2015-06-04, Thu>



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

g.yu authored on 04/06/2015 09:51:15
Showing 2 changed files

... ...
@@ -1,5 +1,6 @@
1 1
 CHANGES IN VERSION 1.1.8
2 2
 ------------------------
3
+ o edgeNum2nodeNum for converting edge number to node number for EPA/pplacer output <2015-06-04, Thu>
3 4
  o mv scale_x_gheatmap to scale_x_ggtree, which also support msaplot <2015-06-02, Tue>
4 5
  o add mask function <2015-06-02, Tue>
5 6
  
... ...
@@ -294,6 +294,14 @@ extract.treeinfo.jplace <- function(object, layout="phylogram", ladderize=TRUE,
294 294
     return(df)
295 295
 }
296 296
 
297
+## convert edge number to node number for EPA/pplacer output
298
+edgeNum2nodeNum <- function(jp, edgeNum) {
299
+    edges <- attr(jp@phylo, "edgeNum")
300
+    nodes <- jp@phylo$edge[,1]
301
+
302
+    idx <- sapply(edgeNum, function(ee) which(edges==ee))
303
+    nodes[idx]
304
+}
297 305
 
298 306
 is.character_beast <- function(stats3, cn) {
299 307
     for (i in 1:nrow(stats3)) {