Hello,
sorry, I forgot to refer where the problem was. On the beginning, I didn't 
check all over thousand trees manually. I found trees on which it was failing 
by simple for loop (could be simpler and more straightforward, I know):
Y <- trees.rooted.nexus
class(Y) <- "multiPhylo"
X <- list()
trees.ultra.nexus <- list()
for (i in 1:length(Y)) {
  trees.ultra.nexus[[i]] <- chronos(Y[[i]])
  X[i] <- i
  }
length(X)
length(trees.ultra.nexus)
Last tree there was the last „good“ one. I then checked to following one and 
it was just one big polytomy without any structure. No surprise it failed. :-) 
After removing several useless „trees“ like that (in several similar steps) 
chronos() worked fine as usual. So if anyone would have similar problem...
Sincerely,
Vojtěch

Dne Ne 9. listopadu 2014 17:43:00 jste napsal(a):
> Hello,
> I have multiPhylo list with consensus trees from MrBayes (*.con.tre). When I
> try to get ultrametric trees by trees.ultra.nexus <-
> lapply(X=trees.rooted.nexus, FUN=chronos, model=“relaxed“) it start running
> and finally it crashes:
> 
> Setting initial dates...
> Fitting in progress... get a first set of estimates
>          Penalised log-lik = -9.32736
> Optimising rates... dates... -9.32736
> Optimising rates... dates... -7.513123
> Done.
> Setting initial dates...
> Fitting in progress... get a first set of estimates
>          Penalised log-lik = -10.31663
> Optimising rates... dates... -10.31663
> Optimising rates... dates... -8.40787
> Done.
> ...
> Setting initial dates...
> Fitting in progress... get a first set of estimates
>          Penalised log-lik = -9.084298
> Optimising rates... dates... -9.084298
> Optimising rates... dates... -3.934602
> Optimising rates... dates... -3.931579
> Done.
> Setting initial dates...
> Fitting in progress... get a first set of estimates
>          Penalised log-lik = -10.27628
> Optimising rates... dates... -10.27628
> Optimising rates... dates... -7.097138
> Done.
> Setting initial dates...
> Fitting in progress... get a first set of estimates
> Error in sapply(A_ki, function(x) sum(tmp[x])) - tmp2 :
>   non-numeric argument to binary operator
> Calls: lapply ... FUN -> nlminb -> gradient -> gradient -> gradient.poisson
> In addition: There were 50 or more warnings (use warnings() to see the first
> 50)
> Error in sapply(A_ki, function(x) sum(tmp[x])) - tmp2 :
>   non-numeric argument to binary operator
> Calls: lapply ... FUN -> nlminb -> gradient -> gradient -> gradient.poisson
> I tried to change parameters, no change... When I display warnings, I see:
> Warning messages:
> 1: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
>   NAs introduced by coercion
> 2: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
>   NAs introduced by coercion
> 3: In nlminb(start.para, f, g, control = opt.ctrl, lower = LOW,  ... :
> ...
> When I tried with trees from *.trprobs files, it worked perfectly. Any idea
> what could be wrong?
> Sincerely,
> Vojtěch
-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
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