This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plots two phylogenetic trees face to face

hi,

I have two phylogenetic trees (extension .nex) and need to plot them face to face with links between them.

I have also done a .cvs file with the associations between these two trees.

However, when I try ro run the commands that I have found I got some error message:

two trees

tree.nex <- rtree(40) parasitetree.nex <- rtree(20)

creation of the association matrix:

association <- read.csv("assoc.csv") cophyloplot(tree.nex, parasitetree.nex, assoc = association, length.line = 4, space = 28, gap = 3)

then I get this error:

Error: $ operator is invalid for atomic vectors

If I try with:

trees<-read.tree("Tree.nex") tree.nex<-trees[[1]] parasitetree.nex<-trees[[2]] assoc<-read.csv("assoc.csv") obj<-cophylo(tree.nex,parasitetree.nex,assoc=assoc, print=TRUE)

Then,

Error in cophylo(tree.nex, parasitetree.nex, assoc = assoc, print = TRUE) : tr1 & tr2 should be objects of class "phylo".

Any help is more than welcome :)

ape phytools trees

Not sure about your code solution, but you can do this with Dendroscope. What you're looking for (I think) are tanglegrams.

0 answers

No answers yet.

Log in to answer this question.