grdspcht / ggarg

ggarg: Visualisation of tree-based phylogenetic networks
Other
0 stars 0 forks source link

conversion from evonet to treedata doesnt work #8

Closed arthurKocher closed 1 month ago

arthurKocher commented 5 months ago

but it works if the evonet object was extracted from a treedata object in the first place

example code:

#read retnet in newick format (creates an evonet object by default)
retnet.evonet = read.enewick2("retnet.nwk")
#read retnet in nexus format (creates treedata object by default)
retnet.treedata =read.beast("retnet.nexus")
#convert evonet into treedata
treeio::as.treedata(retnet.evonet) #doesn't work
#extract evonet object from treedata object
retnet.treedata@phylo -> retnet.evonet.2
#and back to treedata
treeio::as.treedata(retnet.evonet.2) #works
#one difference between retnet.evonet and retnet.evonet.2 is the "class" attribute
arthurKocher commented 3 months ago

The new as.treedata.evonet function seems to be working be the resulting object cannot be plotted, e.g.:

retnet2 = read.enewick("../data/retnet2.nwk")
as.treedata.evonet(retnet2) -> retnet2.treedata
ggtree(retnet2.treedata) + theme_tree() + geom_ret()
arthurKocher commented 1 month ago

works now