# [R-sig-phylo] Problem converting phylo to phylo4

Birgit Lemcke birgit.lemcke at systbot.uzh.ch
Thu Mar 26 17:24:28 CET 2009

```Sorry for delay

#NEXUS

BEGIN TREES;
TRANSLATE
1	A1,
2	B1,
3	C1,
4	D1,
5	E1,
6	F1,
7	G1,
8	A2,
9	B2,
10	C2,
11	D2,
12	E2,
13	F2,
14	G2,
15	A3,
16	B3,
17	C3,
18	D3,
19	E3,
20	F3,
21	G3,
22	A4,
23	B4,
24	C4,
25	D4,
26	E4,
27	F4,
28	G4,
29	A5,
30	B5,
31	C5,
32	D5,
33	E5,
34	F5,
35	G5,
36	A6,
37	B6,
38	C6,
39	D6,
40	E6,
41	F6,
42	G6,
43	A7,
44	B7,
45	C7,
46	D7,
47	E7,
48	F7,
49	G7,
50	A8,
51	B8,
52	C8,
53	D8,
54	E8,
55	F8,
56	G8,
57	A9,
58	B9,
59	C9,
60	D9,
61	E9,
62	F9,
63	G9,,
64	A10,
65	B10,
66	C10,
67	D10,
68	E10,
69	F10,
70	G10,
71	A11,
72	B11,
73	C11,
74	D11,
75	E11,
76	F11,,
77	G11,
78	A12,
79	B12,
80	C12,
81	D12,
82	E12,
83	F12,
84	G12,
85	A13,
86	B13,
87	C13,
88	D13,
89	E13,
90	F13,
91	G13,
92	A14,
93	B14,
94	C14,
95	D14,
96	E14,
97	F14,
98	G14,
99	A15,
100	B15,
101	C15,
102	D15,
103	E15,
104	F15,
105	G15,
106	A16,
107	B16,
108	C16,
109	D16,
110	E16,
111	F16,
112	G16,
113	A17,
114	B17,
115	C17,
116	D17,
117	E17,
118	F17,
119	G17,
120	A18,
121	B18,
122	C18,
123	D18,
124	E18,
125	F18,
126	G18,
127	A19,
128	B19,
129	C19,
130	D19,
131	E19,
132	F19,
133	G19,
134	A20,
135	B20,
136	C20,
137	D20,
138	E20,
139	F20,
140	G20,
141	A21,
142	B21,
143	C21,
144	D21,
145	E21,
146	F21,
147	G21,
148	A22,
149	B22,
150	C22,
151	D22,
152	E22,
153	F22,
154	G22,
155	A23,
156	B23,
157	C23,
158	D23,
159	E23,
160	F23,
161	G23,
162	A24,
163	B24,
164	C24,
165	D24,
166	E24,
167	F24,
168	G24,
169	A25,
170	B25,
171	C25,
172	D25,
173	E25,
174	F25,
175	G25,
176	A26,
177	B26,
178	C26,
179	D26,
180	E26,
181	F26,
182	G26,
183	A27,
184	B27,
185	C27,
186	D27,
187	E27,
188	F27,
189	G27,
190	A28,
191	B28,
192	C28,
193	D28,
194	E28,
195	F28,
196	G28,
197	A29,
198	B29,
199	C29,
200	D29,
201	E29,
202	F29,
203	G29,
204	A30,
205	B30,
206	C30,
207	D30,
208	E30,
209	F30,
210	G30,
211	A31,
212	B31,
213	C31,
214	D31,
215	E31,
216	F31,
217	G31,
218	A32,
219	B32,
220	C32,
221	D32,
222	E32,
223	F32,
224	G32,
225	A33,
226	B33,
227	C33,
228	D33,
229	E33,
230	F33,
231	G33,
232	A34,
233	B34,
234	C34,
235	D34,
236	E34,
237	F34,
238	G34,
239	A35,
240	B35,
241	C35,
242	D35,
243	E35,
244	F35,
245	G35,
246	A36,
247	B36,
248	C36,
249	D36,
250	E36,
251	F36,
252	G36,
253	A37,
254	B37,
255	C37,
256	D37,
257	E37,
258	F37,
259	G37,
260	A38,
261	B38,
262	C38,
263	D38,
264	E38,
265	F38,
266	G38,
267	A39,
268	B39,
269	C39,
270	D39,
271	E39,
272	F39,
273	G39,
274	A40,
275	B40,
276	C40,
277	D40,
278	E40,
279	F40,
280	G40,
281	A41,
282	B41,
283	C41,
284	D41,
285	E41,
286	F41,
287	G41,
288	A42,
289	B42,
290	C42,
291	D42,
292	E42,
293	F42,
294	G42
295	A43,
296	B43,
297	C43
;
TREE	*	UNTITLED	=	[&U]	(1:1.59817,2:1.006277,((3:0.47532,
(((4:0.303187,5:0.467075)0.55:0.05429,6:0.308146)0.57:0.048197,
((((((7:0.037968,8:0.021628)1.00:0.031288,9:0.020411)1.00:0.032744,10:0.
043919)1.00:0.252762,
(((((11:0.027608,12:0.044733)0.99:0.026067,13:0.065287)1.00:0.066574,14:
0.106568)1.00:0.107914,
(15:0.105115,16:0.089327)1.00:0.188324)0.80:0.021326,
(17:0.0312,18:0.057643)1.00:0.290396)1.00:0.07772)0.76:0.018211,
(((19:0.081283,20:0.138276)1.00:0.086272,
(21:0.053736,22:0.051966)1.00:0.18265)1.00:0.067709,
(23:0.184311,24:0.149428)1.00:0.123983)1.00:0.085978)0.53:0.023951,25:0.
290673)1.00:0.072385)1.00:0.080507)1.00:0.52372,
((((((((26:0.086045,27:0.087528)1.00:0.139608,
(((28:0.07058,29:0.167229)1.00:0.054195,30:0.198652)1.00:0.042487,31:0.0
7271)1.00:0.14904)1.00:0.038011,
((((32:0.058755,33:0.046364)1.00:0.033445,34:0.051728)1.00:0.230926,35:0
.208853)0.99:0.035973,
(36:0.057325,37:0.061867)1.00:0.185155)1.00:0.066587)1.00:0.2267,
(((((((((((38:0.08386,39:0.07416)0.99:0.025112,((40:0.136538,
(41:0.046269,42:0.028007)1.00:0.072737)0.70:0.011511,43:0.103185)0.69:0.
014697)1.00:0.133496,
(((44:0.085544,45:0.068133)1.00:0.025349,46:0.100409)1.00:0.102501,47:0.
183071)0.72:0.026033)0.71:0.069782,48:0.178498)1.00:0.166,
(((((49:0.125617,50:0.193906)1.00:0.14229,
((51:0.224153,52:0.243405)0.99:0.038772,53:0.186939)1.00:0.088758)1.00:0
.045331,(((((((54:0.092324,(55:0.06968,
(56:0.077929,57:0.099793)1.00:0.044514)1.00:0.030668)1.00:0.030776,
(58:0.112056,59:0.037568)1.00:0.103984)1.00:0.050686,60:0.117027)1.00:0.
036826,61:0.173045)0.94:0.026239,
((((((62:0.084511,63:0.035057)0.99:0.028123,64:0.053998)0.81:0.022044,
(65:0.091144,66:0.042264)1.00:0.041892)1.00:0.055399,67:0.197164)1.00:0.
072554,((68:0.122111,(69:0.056261,
(70:0.076918,71:0.067697)1.00:0.10923)0.75:0.016946)0.92:0.017116,72:0.1
18687)0.51:0.016682)0.94:0.025688,73:0.103368)1.00:0.02393)1.00:0.050678
,((74:0.206939,(75:0.17658,(76:0.072553,
(77:0.046319,78:0.045815)1.00:0.04353)1.00:0.128525)0.49:0.01426)0.97:0.
023599,
(((79:0.11375,80:0.109493)1.00:0.040306,81:0.149082)1.00:0.037219,82:0.2
08501)1.00:0.047315)1.00:0.106049)0.58:0.017373,
(((83:0.099621,84:0.133867)0.99:0.032939,85:0.034663)1.00:0.112974,
(86:0.10496,
(87:0.09083,88:0.083501)0.65:0.02464)1.00:0.207957)0.99:0.029689)1.00:0.
05797)1.00:0.030557,
((((89:0.094523,90:0.083286)1.00:0.039228,91:0.046451)1.00:0.096172,92:0
.164442)1.00:0.106017,
(((93:0.032931,94:0.028957)1.00:0.073923,95:0.065059)1.00:0.19236,96:0.1
27265)1.00:0.175421)1.00:0.044165)0.69:0.044274,97:0.244515)1.00:0.10536
9)1.00:0.11435,(((((98:0.238223,
(99:0.135671,100:0.231244)1.00:0.094345)0.60:0.015146,(101:0.158425,
(102:0.106553,103:0.206139)1.00:0.0609)1.00:0.067546)0.68:0.026885,104:0
.14359)0.83:0.028964,105:0.233076)1.00:0.131443,
((((106:0.070758,107:0.116775)1.00:0.185421,((108:0.07536,
((109:0.086537,110:0.038154)0.66:0.031044,111:0.100541)0.99:0.028869)1.0
0:0.047067,112:0.105713)1.00:0.050725)1.00:0.050111,
(((113:0.053076,114:0.069631)1.00:0.139676,115:0.219)1.00:0.056782,
(116:0.113633,117:0.059495)1.00:0.123697)1.00:0.084073)0.99:0.016791,
(((118:0.155257,119:0.155095)1.00:0.050336,120:0.204422)0.82:0.02217,
((((((((121:0.120747,122:0.129948)0.71:0.025359,
(123:0.075785,124:0.043193)0.97:0.03925)0.98:0.044608,
((125:0.069886,126:0.103058)0.72:0.025281,127:0.110541)1.00:0.081331)0.5
5:0.014868,
(128:0.128312,129:0.096277)1.00:0.064553)1.00:0.075533,130:0.141055)1.00
:0.036754,
(((((131:0.086489,132:0.073112)0.98:0.052573,133:0.118881)0.49:0.025938,
(134:0.118606,135:0.029604)1.00:0.049776)0.60:0.013153,136:0.097536)1.00
:0.040842,
(137:0.038758,138:0.007651)1.00:0.233661)1.00:0.050338)0.95:0.011721,139
:0.265746)1.00:0.038049,((140:0.105048,141:0.046994)0.98:0.045257,
((142:0.100254,143:0.058553)0.45:0.023976,144:0.094295)1.00:0.049602)1.0
0:0.1088)1.00:0.042823)1.00:0.03703)1.00:0.061081)1.00:0.049813)1.00:0.0
38456,(145:0.161445,146:0.249639)1.00:0.147803)1.00:0.028081,
(147:0.223053,
(148:0.151633,149:0.163834)1.00:0.04052)1.00:0.153599)1.00:0.049039,
(((150:0.070624,151:0.091052)1.00:0.093614,152:0.175801)1.00:0.077432,15
3:0.288919)1.00:0.055229)1.00:0.101776,
(((((((154:0.192265,155:0.168119)1.00:0.109798,156:0.236577)1.00:0.06093
6,(157:0.175034,158:0.154215)0.99:0.041167)0.95:0.017734,
(159:0.20704,160:0.122945)1.00:0.081953)1.00:0.040211,
(((((161:0.047485,162:0.118467)1.00:0.067344,163:0.107509)1.00:0.027273,
(((((164:0.076434,165:0.08212)0.98:0.064322,166:0.053689)0.98:0.05124,16
7:0.129981)0.96:0.033753,168:0.196497)1.00:0.066344,
(169:0.092049,170:0.114445)1.00:0.058251)1.00:0.037971)0.33:0.009913,
((171:0.07417,172:0.056091)1.00:0.03428,
((173:0.097563,174:0.094185)0.78:0.014474,175:0.102768)1.00:0.023196)1.0
0:0.062227)0.75:0.018146,176:0.239737)1.00:0.061019)1.00:0.078551,
(((177:0.045229,178:0.033979)1.00:0.073176,179:0.091068)1.00:0.079463,
((180:0.05413,(181:0.113906,182:0.069981)1.00:0.057894)1.00:0.023206,
(183:0.089561,184:0.035387)1.00:0.146584)1.00:0.072357)1.00:0.146618)1.0
0:0.11148,
((((((((185:0.061161,186:0.040455)1.00:0.070313,187:0.088414)0.90:0.0236
08,
(188:0.027323,189:0.042755)1.00:0.041259)0.50:0.011234,190:0.084552)1.00
:0.107866,((191:0.146779,(((((192:0.057099,193:0.036018)1.00:0.030671,
(194:0.008065,195:0.025363)1.00:0.052965)1.00:0.040467,196:0.053726)0.59
:0.015748,197:0.094938)1.00:0.066708,
((198:0.06911,199:0.023391)1.00:0.023642,
(200:0.051003,201:0.081162)0.98:0.022074)1.00:0.05778)0.89:0.012344)0.46
:0.008882,
((202:0.068333,203:0.043989)1.00:0.048026,204:0.03718)1.00:0.057803)1.00
:0.054447)0.54:0.012388,(((205:0.022673,
(206:0.054827,207:0.064496)0.73:0.015142)0.98:0.021428,208:0.066127)0.99
:0.020613,
(209:0.039187,210:0.045597)1.00:0.032129)1.00:0.033627)1.00:0.089522,
(211:0.051636,212:0.031234)1.00:0.132602)1.00:0.166092,
(213:0.135649,214:0.24121)1.00:0.050238)1.00:0.13183)1.00:0.06791)0.69:0
.01889,
(215:0.238374,216:0.302746)1.00:0.116694)1.00:0.028982)1.00:0.024569,
((((217:0.091276,
(218:0.013976,219:0.053784)1.00:0.052771)1.00:0.216674,
((220:0.124735,221:0.164721)0.81:0.021614,
(222:0.145603,223:0.215916)0.75:0.012907)1.00:0.076792)1.00:0.122341,224
:0.114528)1.00:0.148163,225:0.256362)1.00:0.134126)1.00:0.02148,
(((226:0.227583,
(((227:0.193581,228:0.128398)1.00:0.033438,229:0.224185)0.72:0.010791,
((230:0.119867,231:0.132765)1.00:0.034134,232:0.149692)1.00:0.050891)1.0
0:0.031087)1.00:0.055243,
(((233:0.080788,234:0.076013)1.00:0.087716,235:0.22063)1.00:0.048287,
(236:0.014717,237:0.029134)1.00:0.06344)1.00:0.197942)1.00:0.090235,
(((((238:0.314665,(((239:0.152243,240:0.092148)0.98:0.029049,
(241:0.086177,242:0.055954)1.00:0.021751)1.00:0.099967,
(((243:0.056554,244:0.037242)1.00:0.069345,245:0.121152)1.00:0.098405,
(246:0.125973,
(247:0.093963,248:0.130776)1.00:0.116309)1.00:0.232501)0.83:0.019552)0.3
6:0.008798)0.49:0.010593,249:0.212653)0.94:0.0324,((250:0.284695,
(((251:0.178524,252:0.107265)0.65:0.015039,253:0.187871)1.00:0.098255,
((254:0.083117,255:0.097729)0.91:0.021366,
(256:0.075836,257:0.108346)0.77:0.023029)1.00:0.21429)1.00:0.05092)1.00:
0.061287,((((((258:0.03799,259:0.056857)1.00:0.067393,(260:0.093173,
(261:0.060469,262:0.026668)1.00:0.074055)1.00:0.04015)1.00:0.099608,
((263:0.13344,264:0.116909)0.92:0.020402,
(((265:0.049171,266:0.077114)0.56:0.026163,
(267:0.052553,268:0.039769)0.30:0.011183)1.00:0.040485,269:0.098574)1.00:0.039931)1.00:0.111878)1.00:0.049953,((270:0.229111,(271:0.028697,272:0.083799)1.00:0.171994)1.00:0.093935,(((273:0.111336,((274:0.076224,(275:0.043777,276:0.01912)1.00:0.042246)0.50:0.011328,277:0.105218)1.00:0.03249)0.84:0.013951,278:0.105531)1.00:0.078639,(279:0.110272,280:0.184107)1.00:0.048797)1.00:0.058524)1.00:0.066017)0.58:0.013779,281:0.239764)1.00:0.03753,(282:0.097098,283:0.029877)1.00:0.150917)1.00:0.076154)1.00:0.031835)1.00:0.056173,284:0.438341)0.85:0.033433,285:0.211704)1.00:0.348608)1.00:0.047759)1.00:0.143891,((((286:0.224739,(287:0.094172,288:0.080694)1.00:0.087284)1.00:0.046233,(289:0.312775,(290:0.107466,291:0.056297)1.00:0.10162)1.00:0.026143)1.00:0.061822,(292:0.122983,(293:0.040625,294:0.07182)1.00:0.11786)1.00:0.036304)1.00:0.191722,(295:0.113471,296:0.120711)1.00:0.229614)1.00:0.087078)1.00:0.064621,297:0.469366)1.00:0.444332)1.00:0.476346);
END;

B.
Am 26.03.2009 um 16:41 schrieb Ben Bolker:

>  Could you send/post data (Newick/Nexus) so we can try it out?
>
>  Ben Bolker
>
> Birgit Lemcke wrote:
>> Hello List Members!
>>
>> I tried to convert a tree of class phylo to class phylo4
>>
>> The tree
>> str(tr)
>> List of 5
>>  \$ edge       : int [1:591, 1:2] 298 298 298 299 300 300 301 302 303
>> 303 ...
>>  \$ Nnode      : int 295
>>  \$ tip.label  : chr [1:297] "Baloskion_tetraphyllum"
>> "Sporodanthus_tasmanicus" "Anthochortus_crinalis"
>> "Anthochortus_graminifolius" ...
>>  \$ edge.length: num [1:591] 1.598 1.006 0.476 0.524 0.475 ...
>>  \$ node.label : chr [1:295] "" "1.00" "1.00" "1.00" ...
>>  - attr(*, "class")= chr "phylo"
>>  - attr(*, "origin")= chr "/Users/birgitlemcke/Job/Doktorarbeit/
>> workspace//Users/birgitlemcke/Desktop/Birgits-folder/
>> ConsAllNodesMrBayes.tre"
>>
>>
>> the error message
>>
>> tr <- as(tr, "phylo4")
>> Fehler in checkTree(object) : All labels must be unique
>> Error in checkTree(object) : All labels must be unique
>>
>> checking tip labels
>>
>> length(unique(tr\$tip.label))==length((tr\$tip.label))
>> [1] TRUE
>>
>> Does somebody have an idea what the problem is?
>> The weird thing is that I am pretty sure that I did the same already
>> also with the same data.I feel somewhat helpless.
>>
>>
>> Cheers
>>
>> Birgit
>>
>> =============================
>> Birgit Lemcke
>> Institut of Systematic Botany
>> University of Zurich
>> Zollikerstrasse 107
>> CH-8008 Zürich
>> Switzerland
>> Ph: +41 (0)44 634 8416
>> mail: birgit.lemcke at systbot.uzh.ch
>> =============================
>>
>> _______________________________________________
>> R-sig-phylo mailing list
>> R-sig-phylo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>
>
> --
> Ben Bolker
> Associate professor, Biology Dep't, Univ. of Florida
> bolker at ufl.edu / www.zoology.ufl.edu/bolker
> GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc
>

=============================
Birgit Lemcke
Institut of Systematic Botany
University of Zurich
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8416
mail: birgit.lemcke at systbot.uzh.ch
=============================

```