Sure thing!
The documentation for MCMCtreeR::priorPosterior gives the usage as:
priorPosterior(MCMCPrior, MCMCPosterior = NULL, inputTree,
return.density = FALSE, rootCalibration = NULL)
where
MCMCPrior is the "prior of MCMC file from MCMCtree analysis using data=0" and inputTree is "phylogeny in MCMCtree format used in MCMCtree analysis".
The example on the man page is
priorPosterior(MCMCPrior,
# MCMCPosterior=MCMCtree.output$MCMCtree.posterior,
# path.to.input.tree)
.
I have tried:
library(MCMCtreeR)
priorPosterior(MCMCPrior='datafree-m-ir_run-0.trace', inputTree='calibration_topo.trees')
# As well as reading in the trace first:
priors <- mcmc(read.table('datafree-m-ir_run-0.trace', header=T))
priorPosterior(MCMCPrior=priors, inputTree='calibration_topo.trees')
And also reading the tree in first and using it is a variable instead of using the path to the input tree as the help page suggests.
All methods give me the error:
"Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 2 did not have 2 elements".
This seems to result from the fact that the code for priorPosterior( ) reads the tree as a table:
s <- utils::read.table(inputTree, row.names = 1)[, 2]
s <- strsplit(as.character(s), "'")[[1]]
But of course, the tree is not a table.
While I know it would be best to be able to provide the trace file too for troubleshooting, I will say that there seem to be no issues with the trace being read as an MCMC object, or with just directing priorPosterior() to the trace filepath.
Thanks!