1

I am trying to use Dendextend to draw a tanglegram (tangle tree) to interpret the segment-virus reassortment. The newick trees,which I get from other phylogenetic software (like Mrbayes/Raxml),as the input tree files for Dendextend. The newick format like this

(((EPI1010115:0.00072624,EPI1054126:0.00249360):0.000004,EPI1082012:0.00074391));

Here is the R code

rm(list=ls()) 
library(dendextend)
library(viridis)
library(dplyr)
library(DECIPHER)
library(phylogram)

dend1 <- ReadDendrogram("HA_cd99.newick")
dend2 <- ReadDendrogram("NA_cd99.newick")

dend2_corrected <- untangle_step_rotate_1side(dend1, dend2)[[1]]
tanglegram(dend1, dend2_corrected)

I got a lot of warning like this

Warning message in setmid(x, type = type):
"midcache() of non-binary dendrograms only partly implemented"

And an error

Warning message in flip_leaves(dend, leaves1, leaves2):
"NAs introduced by coercion"
Error in weights_for_order[order_x[order]] <- weights: NAs are not allowed in subscripted assignments

I didn't get any output figure. Can anyone give me some clues to figure this issue out? Thanks a lot!

Biodeer
  • 21
  • 5
  • Start by doing something like dend1 <- as.dendrogram(dend1) and then plot(dend1). I'm guessing your input tree has many leafs with 0 height or something like that. In which point I suggest you modify it a bit, since the input for all these functions need to be a binary tree. – Tal Galili May 31 '20 at 18:09

0 Answers0