Troubles rooting Mrbayes consensus tree output

148 views
Skip to first unread message

Raquel Pereira

unread,
Jun 1, 2022, 9:07:07 AM6/1/22
to ggtree
HI I have obtained a majority consensus tree output from MrBayes.

The I tried to root my tree but so far I have been unsuccessful.
I tried:
mbtree2<-ape::root(mbtree, outgroup = mbtree@phylo$tip.label[48], edgelabel = TRUE)

Error in `dplyr::inner_join()`: ! Can't join on `x$node` x `y$node` because of incompatible types. `x$node` is of type <character>>. `y$node` is of type <integer>>. Traceback: 1. ape::root(mbtree, outgroup = mbtree@phylo$tip.label[48], edgelabel = TRUE) 2. root.treedata(mbtree, outgroup = mbtree@phylo$tip.label[48], . edgelabel = TRUE) 3. update_data(phy@data, node_map) 4. dplyr::inner_join(data, node_map, by = c(node = "old")) %>% dplyr::select(c("new", . cn)) %>% dplyr::rename(node = .data$new) 5. dplyr::rename(., node = .data$new) 6. dplyr::select(., c("new", cn)) 7. dplyr::inner_join(data, node_map, by = c(node = "old")) 8. inner_join.data.frame(data, node_map, by = c(node = "old")) 9. join_mutate(x, y, by = by, type = "inner", suffix = suffix, na_matches = na_matches, . keep = keep) 10. join_rows(x_key, y_key, type = type, na_equal = na_equal, error_call = error_call) 11. tryCatch(matches <- vec_match(x_key, y_split$key, na_equal = na_equal), . vctrs_error_incompatible_type = function(cnd) { . rx <- "^[^$]+[$]" . x_name <- sub(rx, "", cnd$x_arg) . y_name <- sub(rx, "", cnd$y_arg) . bullets <- c(glue("Can't join on `x${x_name}` x `y${y_name}` because of incompatible types."), . i = glue("`x${x_name}` is of type <{x_type}>>.", . x_type = vec_ptype_full(cnd$x)), i = glue("`y${y_name}` is of type <{y_type}>>.", . y_type = vec_ptype_full(cnd$y))) . abort(bullets, call = error_call) . }) 12. tryCatchList(expr, classes, parentenv, handlers) 13. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 14. value[[3L]](cond) 15. abort(bullets, call = error_call) 16. signal_abort(cnd, .file)


mbtree2<-ape::root(mbtree, outgroup = c(48)) (same error as above)

mbtree2<-ape::root(mbtree, outgroup = c(45,46))

Error in root.phylo(tree, outgroup = outgroup, node = node, edgelabel = edgelabel, : the specified outgroup is not monophyletic Traceback: 1. ape::root(mbtree, outgroup = c(45, 46)) 2. root.treedata(mbtree, outgroup = c(45, 46)) 3. root(tree, outgroup = outgroup, node = node, edgelabel = edgelabel, . ...) 4. root.phylo(tree, outgroup = outgroup, node = node, edgelabel = edgelabel, . ...) 5. stop("the specified outgroup is not monophyletic")
which(mbtree@phylo$tip.label =="Amphilectus_fucorum_coxIZMAPOR1981

But they are monophyletic I've open in figtree without changing the it and they are.

mbtree2<-ape::root(mbtree, outgroup = mbtree@phylo$tip.label[c(45,46)],edgelabel = TRUE) (same error as above)

Also:
ape::root.phylo(mbtree, outgroup = outgrp): object not of class "phylo"
Error in ape::root.phylo(mbtree, outgroup = outgrp): object not of class "phylo" Traceback: 1. ape::root.phylo(mbtree, outgroup = outgrp) 2. stop("object not of class \"phylo\"")


ggtree::reroot
Error: 'reroot' is not an exported object from 'namespace:ggtree' Traceback:


I'm at lost how to solve the issue and anyhelp will be welcome




all_loci.nexus.con.tre

Juan Monroy-Nieto

unread,
Jun 2, 2022, 2:46:53 PM6/2/22
to ggtree
I just tried it with `ape::root.phylo(x, outgroup = 48)` and it works just fine. In my experience, not class phylo should prompt you to double check that (A) you object exists. In your case you use mbtree and mbtree2 so that might be the issue and (B) that `class(mbtree)` contains "phylo".

Thank you for sharing your tree, this makes it easy to troubleshoot.
Reply all
Reply to author
Forward
0 new messages