From: paradis Date: Thu, 18 Nov 2010 01:53:39 +0000 (+0000) Subject: bug fix in mcmc.popsize() X-Git-Url: https://git.donarmstrong.com/?p=ape.git;a=commitdiff_plain;h=50470fdeb74ae1e235e61ed6acfae81dd51f655c bug fix in mcmc.popsize() git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@138 6e262413-ae40-0410-9e79-b911bd7a66b7 --- diff --git a/ChangeLog b/ChangeLog index 94d9816..2858cd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,9 @@ BUG FIXES o dist.nodes() returned duplicated column(s) with unrooted and/or multichotomous trees. + o mcmc.popsize() terminated unexpectedly if the progress bar was + turned off. + CHANGES IN APE VERSION 2.6-1 diff --git a/DESCRIPTION b/DESCRIPTION index f007b94..b9d0974 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ape Version: 2.6-2 -Date: 2010-11-15 +Date: 2010-11-18 Title: Analyses of Phylogenetics and Evolution Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Klaus Schliep, Korbinian Strimmer, Damien de Vienne Maintainer: Emmanuel Paradis diff --git a/R/mcmc.popsize.R b/R/mcmc.popsize.R index 35670a9..22dafff 100644 --- a/R/mcmc.popsize.R +++ b/R/mcmc.popsize.R @@ -1,11 +1,11 @@ -## mcmc.popsize.R (2004-12-02) +## mcmc.popsize.R (2010-11-16) ## Run reversible jump MCMC to sample demographic histories -## Copyright 2004 Rainer Opgen-Rhein and Korbinian Strimmer +## Copyright 2004-2010 Rainer Opgen-Rhein and Korbinian Strimmer ## Portions of this function are adapted from rjMCMC code by -## Karl Broman (see http://www.biostat.jhsph.edu/~kbroman/) +## Karl W Broman (see http://www.biostat.wisc.edu/~kbroman/) ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. @@ -160,14 +160,17 @@ mcmc.popsize <- #BEGIN CALCULATION - for(i in (1:nstep + 1)) { - - #progress bar - if(i %% 100 == 0){ - z<-i/nstep - zt<-(i-100)/(nstep) - polygon(c(zt,zt,z,z), c(1,0,0,1), col="black") - + for(i in (1:nstep + 1)) + { + #progress bar + if(progress.bar==TRUE) + { + if(i %% 100 == 0) + { + z<-i/nstep + zt<-(i-100)/(nstep) + polygon(c(zt,zt,z,z), c(1,0,0,1), col="black") + } } # calculate jump probabilities without given lamda @@ -245,7 +248,8 @@ mcmc.popsize <- } if (i %% thinning == 0& i>burn.in) {count.i<-count.i+1} } - dev.off() + + if(progress.bar==TRUE) dev.off() list(pos=save.pos,h=save.h,loglik=save.loglik, steptype=save.steptype,accept=save.accept) diff --git a/man/mcmc.popsize.Rd b/man/mcmc.popsize.Rd index 2952cbc..5d84e40 100644 --- a/man/mcmc.popsize.Rd +++ b/man/mcmc.popsize.Rd @@ -83,10 +83,10 @@ extract.popsize(mcmc.out, credible.interval=0.95, time.points=200, thinning=1, b } -\author{Rainer Opgen-Rhein (\url{http://www.stat.uni-muenchen.de/~opgen/}) and - Korbinian Strimmer (\url{http://www.stat.uni-muenchen.de/~strimmer/}). +\author{Rainer Opgen-Rhein and + Korbinian Strimmer (\url{http://strimmerlab.org}). Parts of the rjMCMC sampling procedure are adapted from R code by Karl Browman - (\url{http://www.biostat.jhsph.edu/~kbroman/})} + (\url{http://www.biostat.wisc.edu/~kbroman/})} \seealso{ \code{\link{skyline}} and \code{\link{skylineplot}}. }