if (FALSE) {
library(igraph)
library(ape)
#convert to phylo
phylo = graphToPhylo(graph)
#plot tree using ape
plot(phylo,show.node.label=TRUE)
#store as newick tree
write.tree(phylo,file="tree.newick")
#read in tree from newick file
phylo_r = read.tree("tree.newick")
#convert to igraph
graph_r = phyloToGraph(phylo_r,germline="Germline")
#plot graph - same as before, possibly rotated
plot(graph_r,layout=layout_as_tree)
}
Run the code above in your browser using DataLab