Closed xiangpin closed 1 year ago
as.phylo
find.spt
https://github.com/YuLab-SMU/ProjectYulab/issues/10
library(treeio) library(ggtree) library(igraph) library(ggplot2) set.seed(123) g <- sample_gnp(888, 3/200) spt <- find.spt(g, 6, V(g)) Nnode(spt, internal.only = FALSE) p <- ggtree(spt, layout = 'radial') + geom_nodepoint(color='orange', size=3) + geom_tippoint(color='orange', size=3) + ggtitle("spt") g2 <- mst(g) mst.tree <- as.phylo(g2) p2 <- ggtree(mst.tree, layout = 'radial') + geom_nodepoint(color='orange', size=3) + geom_tippoint(color='orange', size=3) + ggtitle('mst') p + p2
This is the first version, next, the weight of network edges might need to be considered as the branch.length of spt.
branch.length
Description
as.phylo
for tree network.find.spt
to find the shortest path tree with specific node to other some nodes.Related Issue
https://github.com/YuLab-SMU/ProjectYulab/issues/10
Example
This is the first version, next, the weight of network edges might need to be considered as the
branch.length
of spt.