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!