Discussion:
[R-sig-phylo] midpoint.root Error in phy$edge[, 2] : incorrect number of dimensions
Juan Antonio Balbuena
2018-05-15 15:29:57 UTC
Permalink
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
--
Dr. Juan A. Balbuena
Cavanilles Institute of Biodiversity and Evolutionary Biology
Symbiont Ecology and Evolution Lab
University of Valencia http://www.uv.es/~balbuena
<http://www.uv.es/%7Ebalbuena>
P.O. Box 22085 http://www.uv.es/cophylpaco
<http://www.uv.es/cavanilles/zoomarin/index.htm>
46071 Valencia, Spain
e-mail: ***@uv.es <mailto:***@uv.es>tel. +34 963 543
658    fax +34 963 543 733
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*NOTE!*For shipments by EXPRESS COURIER use the following street address:
C/ Catedrático José Beltrán 2, 46980 Paterna (Valencia), Spain.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-***@r-project.org/
Liam J. Revell
2018-05-15 15:38:01 UTC
Permalink
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/
Post by Juan Antonio Balbuena
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
library(ape)
TreeH <- read.tree("Pf_tree_short.nwk")
TreeH <- midpoint.root(TreeH)
Error in phy$edge[, 2] : incorrect number of dimensions
(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-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.co
Liam J. Revell
2018-05-15 15:39:21 UTC
Permalink
I forgot to post the re-rooted Newick string as promised. It follows:

(((((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.030357599,(((((PfH1:0.001054642,PfH9:0.004127868):0.001063792,PfH10:0.002582213):0.00256691,(PfH62:0.001050343,PfH63:0.004185532):0.005860629):0.01257902,(((((PfH26:0.001054175,PfH33:0.002518196):0.001162092,(PfH29:0.002488133,PfH70:0.003882958):0.001150588):0.000706569,(((PfH28:0.002519167,PfH32:0.002553086):0.0009516619,(PfH31:0.002530325,PfH66:0.002590319):0.00105028):0.0009560662,((PfH30:0.002507623,PfH74:0.002610591):0.001005149,(PfH68:0.002510002,PfH69:0.002556393):0.001053178):0.002324076):0.0004840203):0.0006291873,((PfH67:0.002528606,PfH72:0.00404201):0.001078995,(PfH75:0.005680973,PfH76:0.002538044):0.001066169):0.0003313337):0.002079495,((PfH27:0.001071028,PfH71:0.005683054):0.001274396,PfH73:0.002455681):0.002553291):0.01016512):0.09853968,((PfH3:0.08953517,(((PfH6:0.02378674,((((((PfH34:0.00255086,PfH40:0.00253142):0.001075694,(PfH39:0.002549484,PfH57:0.002551486):0.001030445):0.0008177499,((PfH36:0.002555701,PfH43:0.002524015):0.001047094,(PfH41:0.002543331,PfH45:0.004011249):0.001035931):0.0007855741):0.0009836483,(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):0.0009797,(PfH13:0.002446243,PfH16:0.002441275):0.0009147032):0.0008726904,(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):0.7442934008);


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/
Post by Liam J. Revell
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
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/
Post by Juan Antonio Balbuena
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
library(ape)
TreeH <- read.tree("Pf_tree_short.nwk")
TreeH <- midpoint.root(TreeH)
Error in phy$edge[, 2] : incorrect number of dimensions
(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
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at
_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-ph
Juan Antonio Balbuena
2018-05-15 15:49:19 UTC
Permalink
Thank you very much for your quick response.

I have the tree file in a cloud. When I run the code in one computer I
get the error, whereas in the other one it runs fine. I use Windows 7 in
both. So it is kind of weird.

Any idea of the reason?

All the best,

Juan
Post by Liam J. Revell
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
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/
Post by Juan Antonio Balbuena
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
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
(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
--
Dr. Juan A. Balbuena
Cavanilles Institute of Biodiversity and Evolutionary Biology
Symbiont Ecology and Evolution Lab
University of Valencia http://www.uv.es/~balbuena
<http://www.uv.es/%7Ebalbuena>
P.O. Box 22085 http://www.uv.es/cophylpaco
<http://www.uv.es/cavanilles/zoomarin/index.htm>
46071 Valencia, Spain
e-mail: ***@uv.es <mailto:***@uv.es>tel. +34 963 543
658    fax +34 963 543 733
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*NOTE!*For shipments by EXPRESS COURIER use the following street address:
C/ Catedrático José Beltrán 2, 46980 Paterna (Valencia), Spain.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-***@r-project.org/
Liam J. Revell
2018-05-15 15:52:34 UTC
Permalink
No idea. Are they running different R or package versions?
phytools::midpoint.root has not been updated recently, but other
internally used functions may have been.

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/
Post by Juan Antonio Balbuena
Thank you very much for your quick response.
I have the tree file in a cloud. When I run the code in one computer I
get the error, whereas in the other one it runs fine. I use Windows 7 in
both. So it is kind of weird.
Any idea of the reason?
All the best,
Juan
Post by Liam J. Revell
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
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/
Post by Juan Antonio Balbuena
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
library(ape)
TreeH <- read.tree("Pf_tree_short.nwk")
TreeH <- midpoint.root(TreeH)
Error in phy$edge[, 2] : incorrect number of dimensions
(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-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.
Juan Antonio Balbuena
2018-05-16 06:49:38 UTC
Permalink
Thanks Liam

I will update R and the libraries in both computers and see what happens.

All the best

Juan
Post by Liam J. Revell
No idea. Are they running different R or package versions?
phytools::midpoint.root has not been updated recently, but other
internally used functions may have been.
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/
Post by Juan Antonio Balbuena
Thank you very much for your quick response.
I have the tree file in a cloud. When I run the code in one computer
I get the error, whereas in the other one it runs fine. I use Windows
7 in both. So it is kind of weird.
Any idea of the reason?
All the best,
Juan
Post by Liam J. Revell
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
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/
Post by Juan Antonio Balbuena
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
library(ape)
TreeH <- read.tree("Pf_tree_short.nwk")
TreeH <- midpoint.root(TreeH)
Error in phy$edge[, 2] : incorrect number of dimensions
(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
--
Dr. Juan A. Balbuena
Cavanilles Institute of Biodiversity and Evolutionary Biology
Symbiont Ecology and Evolution Lab
University of Valencia http://www.uv.es/~balbuena
<http://www.uv.es/%7Ebalbuena>
P.O. Box 22085 http://www.uv.es/cophylpaco
<http://www.uv.es/cavanilles/zoomarin/index.htm>
46071 Valencia, Spain
e-mail: ***@uv.es <mailto:***@uv.es>tel. +34 963 543
658    fax +34 963 543 733
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*NOTE!*For shipments by EXPRESS COURIER use the following street address:
C/ Catedrático José Beltrán 2, 46980 Paterna (Valencia), Spain.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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