Hi Klaus
You are right. The problem was that my lin4 object was a list. I
have saved the same trees in a text file as
"(S8: 1.0, (((S4: 0.28596, S5: 0.28596): 0.63211, (S10: 0.88214,
((S6: 0.49245, S7: 0.49245): 0.24813, S9: 0.74058): 0.14156):
0.03592): 0.03859, ((S1: 0.16950, S2: 0.16950): 0.61358, S3:
0.78308): 0.17357): 0.04335);"
"((S6: 0.10938, S2: 0.10938): 0.89062, ((S7: 0.79060, ((S4: 0.31389,
S8: 0.31389): 0.31812, (((S1: 0.06153, S3: 0.06153): 0.08642, S10:
0.14795): 0.47444, S9: 0.62238): 0.00962): 0.15860): 0.01336, S5:
0.80396): 0.19604);"
"((S7: 0.98617, (S4: 0.90628, (S3: 0.86179, ((S1: 0.17650, S6:
0.17650): 0.48270, ((S10: 0.28064, S5: 0.28064): 0.06352, (S9:
0.00968, S8: 0.00968): 0.33448): 0.31505): 0.20259): 0.04449):
0.07990): 0.01383, S2: 1.0);"
"(S6: 0.42675, S3: 0.42675): 0.16273, S8: 0.58948): 0.00542, S5:
0.59490): 0.05023, (S4: 0.19208, S7: 0.19208): 0.45305): 0.35486,
(S9: 0.90829, (S10: 0.64179, (S2: 0.36191, S1: 0.36191): 0.27988):
0.26649): 0.09171);"
and
> tree4 <- read.tree(file.choose())
> dist.multiPhylo(tree4)
1 2 3
2 2.452629
3 2.441263 2.362859
4 1.598451 2.050473 2.259690
Excellent!
Thank you very much for your help!
Juan
El 23/01/2014 16:54, Klaus Schliep
escribió:
I also checked it for a multiPhylo object the
function works fine, but not for a list or vector of characters.
On Thu, Jan 23, 2014 at 4:49 PM, Juan
Antonio Balbuena wrote:
Hello
Thank you very much for your interest. Yes, it does read
newick and works with similar trees. So the problem seems
"architectural" instead of not applying the function
correctly.
Cheers
Juan
El 23/01/2014 16:35, Klaus Schliep escribió:
Sorry, should also read newick
format, sorry for my comment.
On Thu, Jan 23, 2014 at
4:30 PM, Klaus Schliep
wrote:
Dear Juan,
lin4 is not an object of class
multiPhylo but vector of characters.
Read in the trees with read.tree from
the ape package.
Regards,
Klaus
On Thu, Jan 23, 2014 at 4:20 PM,
Juan Antonio Balbuena
wrote:
Hello
I would like to compute geodesic
distances from random trees for
comparison and hypothesis testing
with those produced from a given
set of trees. I am using
dist.multiPhylo() in the 'distory'
package, but it seems to be too
compute-intensive. To illustrate
my point:
> lin4 #object consisting of 4 randomly generated trees
[1] "(S8: 1.0, (((S4: 0.28596, S5: 0.28596): 0.63211, (S10: 0.88214, ((S6: 0.49245, S7: 0.49245): 0.24813, S9: 0.74058): 0.14156): 0.03592): 0.03859, ((S1: 0.16950, S2: 0.16950): 0.61358, S3: 0.78308): 0.17357): 0.04335);"
[2] "((S6: 0.10938, S2: 0.10938): 0.89062, ((S7: 0.79060, ((S4: 0.31389, S8: 0.31389)