xavierdidelot / BactDating

Bayesian inference of ancestral dates on bacterial phylogenetic trees
https://xavierdidelot.github.io/BactDating
MIT License
80 stars 15 forks source link

effectiveSize function from coda package cannot read object from #51

Closed hcc14 closed 2 years ago

hcc14 commented 2 years ago

Hi, I was trying to run BactDating and checking the effective size, but it looks like an issue in the conversion to an mcmc object

library(coda) library(BactDating) res = bactdate(unroot(nwk_tree), collectionTime, nbIts=1e5, showProgress = T) mcmc = as.mcmc(res) effectiveSize(mcmc) Error in character(ncol(y)) : invalid 'length' argument

packageVersion("BactDating") [1] ‘1.1.0’ packageVersion("coda") [1] ‘0.19.4’

xavierdidelot commented 2 years ago

It should work if you replace the line 4 with: mcmc=as.mcmc.resBactDating(res)