Hello Juan.

I was able to read your tree & midpoint root it using phytools::midpoint.root no problem. I will paste the tree I created below, but note also that phangorn::midpoint is functionally equivalent & when I run:


tree<-read.tree(text=text) ## from your Newick string
t1<-midpoint.root(tree)
t2<-midpoint(tree)
all.equal.phylo(t1,t2)

I get TRUE.

All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
& Profesor Asociado, Programa de BiologĂ­a
Universidad del Rosario
web: http://faculty.umb.edu/liam.revell/

On 5/15/2018 10:29 AM, Juan Antonio Balbuena wrote:
Hi all

This is really odd. I am using a piece of ode that used to work just fine with the very same file shown below. I changed computer and now get this error:

library(ape)

TreeH <- read.tree("Pf_tree_short.nwk")

TreeH <- midpoint.root(TreeH)
Error in phy$edge[, 2] : incorrect number of dimensions


The file Pf_tree_short.nwk si pretty short, so I can copy its contents here:

(PfH1:0.001054642,PfH9:0.004127868,((((((PfH3:0.08953517,(((PfH6:0.02378674,((((((PfH34:0.00255086,PfH40:0.00253142):0.001075694,(PfH39:0.002549484,PfH57:0.002551486):0.001030445):8.177499E-4,((PfH36:0.002555701,PfH43:0.002524015):0.001047094,(PfH41:0.002543331,PfH45:0.004011249):0.001035931):7.855741E-4):9.836483E-4,(PfH35:0.001056611,PfH38:0.002496405):0.001112379):0.00252234,(PfH37:0.002543709,PfH42:0.001073064):0.002640093):0.002623932,PfH56:0.00276149):0.02310424):0.01273145,PfH48:0.003223183):0.004103919,PfH44:0.006145397):0.06303876):0.04205169,(((((((PfH12:0.001042118,PfH25:0.002470368):9.797E-4,(PfH13:0.002446243,PfH16:0.002441275):9.147032E-4):8.726904E-4,(PfH14:0.002486386,PfH21:0.0025004):0.001079044):0.001147637,(PfH19:0.002508287,PfH22:0.002461656):0.001011963):0.001333315,PfH24:0.00242401):0.002458328,(PfH15:0.003791243,PfH17:0.001056495):0.001058053):0.003886796,PfH23:0.004767665):0.1242874):0.1359654,((((PfH60:0.001068025,PfH84:0.0025608):0.001109104,(PfH81:0.00250909,PfH82:0.002508367):0.001089697):0.001053748,PfH83:0.002545513):0.002170283,(PfH79:0.001092604,PfH80:0.002562978):0.002563944):1.774651):0.09853968,(((((PfH26:0.001054175,PfH33:0.002518196):0.001162092,(PfH29:0.002488133,PfH70:0.003882958):0.001150588):7.06569E-4,(((PfH28:0.002519167,PfH32:0.002553086):9.516619E-4,(PfH31:0.002530325,PfH66:0.002590319):0.00105028):9.560662E-4,((PfH30:0.002507623,PfH74:0.002610591):0.001005149,(PfH68:0.002510002,PfH69:0.002556393):0.001053178):0.002324076):4.840203E-4):6.291873E-4,((PfH67:0.002528606,PfH72:0.00404201):0.001078995,(PfH75:0.005680973,PfH76:0.002538044):0.001066169):3.313337E-4):0.002079495,((PfH27:0.001071028,PfH71:0.005683054):0.001274396,PfH73:0.002455681):0.002553291):0.01016512):0.01257902,(PfH62:0.001050343,PfH63:0.004185532):0.005860629):0.00256691,PfH10:0.002582213):0.001063792);

Any help will be most welcome.


Juan

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to