xavierdidelot / TransPhylo

Reconstruction of transmission trees using genomic data
http://xavierdidelot.github.io/TransPhylo/
GNU General Public License v2.0
60 stars 22 forks source link

Trouble importing ML tree into TransPhylo #14

Closed salemilab closed 4 years ago

salemilab commented 4 years ago

I have been trying to run TransPhylo on an ML tree, the output from IQTree. I've then transformed the tree file from IQtree into a newick format. For some reason when I try to run:

t <- read.tree('zika_103_ML.nwk') t <- multi2di(t) # remove multifurcations t$edge.length <- pmax(t$edge.length,1/365) # use a day as minimum branch length ptree <- ptreeFromPhylo(t, dateLastSample=2017) plot(ptree) I Then get the error:

Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y'

I am unable to find what this error means in terms on how to fix my tree for the input of Transphylo. Is there anything I can do to fix this?

xavierdidelot commented 4 years ago

TransPhylo needs as input a dated phylogeny, also known as a time-stamped phylogeny. The tree you get from iqtree is not dated and so unsuitable as input for TransPhylo. You could try to build a dated tree using for example BEAST, or you could try to convert your iqtree into a dated tree using for example treedater or BactDating.