Summarizing trees before MCMCTree completes run

460 views
Skip to first unread message

Carl Oliveros

unread,
Apr 20, 2017, 11:43:50 AM4/20/17
to PAML discussion group
Hi,

Is there a way to summarize the trees in an MCMCTree run before it finishes as it does in the end of the run when it produces a Figtree file? I am running an MCMC and I think I am quite happy with the run and don't think I need to finish the rest of the number of generations.  Being able to summarize trees mid-run would also be useful if for some reason your analysis unexpectedly stops.  MCMCTree does not write out a separate tree file during the course of an MCMC but writes the node ages in the log.  It's hard to know which of the labels in the log correspond to which node.

Any suggestions?

Cheers
Carl


Ziheng

unread,
Apr 28, 2017, 11:59:49 AM4/28/17
to PAML discussion group
you copy the files into a different folder.
then change print = 1 into print = -1 and run mcmctree.
it will then read and summarize the mcmc sample, rather than run the mcmc algorithm to generate the sample.  this also allows you to combine the mcmc samples from multiple runs of the same analyses to produce one posterior summary.
do a short run of 10 minutes to confirm first.
best,
ziheng

Pierre Arnal

unread,
Apr 25, 2018, 11:48:20 AM4/25/18
to PAML discussion group
Hi Ziheng or anyone,

I try to get a tree before the end of the analysis using your tip but it did not work.

I get some very long branches (and others negative).

To be sure my calibration are not a mess, I tried a 1M generations run and it worked. But when I stopped at 800k generations it gave me a very strange tree (attached).

Does anyone get something similar ?

I use a Sun Grid Engine (SGE) cluster. Do you think it might explains the bug ?



FigTree.tre

Ziheng

unread,
Jul 31, 2018, 1:55:20 PM7/31/18
to PAML discussion group
i just tried with my copy of the program on a small dataset.  i killed the job half and used print = -1 to summarize the sample and it is fine.  i am not sure what's happening in your case.  is it possible that the MCMC sample file mcmc.txt is corrupted.  Does the new version make any difference if you are using an earlier version?
ziheng


Pierre Arnal

unread,
Jul 31, 2018, 3:38:09 PM7/31/18
to PAML discussion group
Hi,

Thanks for your answer.

I download the files on my local computer and the summarize procedure worked... Couldnt find how to do it on the cluster. But I'm fine with that solution ;)

Pierre

Ziheng

unread,
Aug 1, 2018, 10:43:00 AM8/1/18
to PAML discussion group
sounds like some problems with the file system.  you can ask a system administrator about it if that is easy.  
otherwise try a small file/small dataset and see whether the problem appears.
dealing with large files on a university file system can be slow and problematic.
ziheng

Ray Cui

unread,
Mar 25, 2019, 4:51:46 AM3/25/19
to PAML discussion group
Dear Prof. Yang,

       What is the proper way of combine two independent runs? Do I just concatenate the two mcmc.txt files together? In that case, how do I set the number of burnin samples in the configuration .ctl file? Thank you for your help!

Best Regards,
Rongfeng Cui

Ziheng

unread,
Mar 30, 2019, 5:25:28 AM3/30/19
to PAML discussion group
when print = -1, the program ignores burnin, nsample etc.
you append the second file at the end of the first, and so on.  if the last line in the first file is incomplete, you need to delete that last line.  if the second file has a header line, the header line has to be deleted.
ziheng

Reply all
Reply to author
Forward
0 new messages