BEAST2 substitution tree

432 views
Skip to first unread message

Chris Ruis

unread,
Nov 24, 2015, 1:19:43 PM11/24/15
to beast-users
Hi,

I'm using BEAST2 and would like to get my tree in substitution units as well as in time units. In BEAST version 1, there's a box in the MCMC section of BEAUTi called 'create tree log file with branch length in substitutions' which can be checked to output the tree in substitution units. This seems to add the following lines to the xml file:

<logTree id="substTreeFileLog" logEvery="10000" nexusFormat="true" fileName="virus.fasta.(subst).trees" branchLengths="substitutions">

                        <treeModel idref="treeModel"/>                                     

                        <strictClockBranchRates idref="branchRates"/>                      

                        <trait name="rate" tag="rate">                                     

                                <strictClockBranchRates idref="branchRates"/>              

                        </trait> 


In BEAUTi2 distributed with BEAST2, in the treelog section of the MCMC tab, there is a check box on the right hand site. When I click on this a new window appears where there is a check box 'substitutions' which I guess is the equivalent of the 'create tree log file with branch length in substitutions' box in BEAUTi from BEAST version 1. However, checking this box doesn't change anything in the xml, in fact if I open the pop up window again the box is no longer checked. Additionally when I open the pop up window by clicking the box on the right hand side of the treelog in the MCMC tab, a message appears saying 'could not add entry for branchratemodel'.


Is there a way of getting BEAST2 to output a tree in substitution units as well as the time tree? Is there anything that can be added to the xml file to make BEAST2 do this, as with the BEAST version 1 code above? I know I could get the branch lengths in substitutions by multiplying the branch length in years by the branch rate in substitutions/site/year but it seems cleaner to get BEAST2 to do this for me if possible.


Any help would be very gratefully appreciated.

Remco Bouckaert

unread,
Nov 24, 2015, 2:27:54 PM11/24/15
to beast...@googlegroups.com

Hi Chris,

If you set substitutions=“true” in the TreeWithMetaDataLogger in the XML, a tree file with branch rates in substitutions will be generated.

After editing using a text editor, the XML should look something like this (here for a partition called ‘dna’ and relaxed clock):

   <logger id="treelog.t:dna" fileName="$(tree).trees" logEvery="1000" mode="tree">
       <log id="TreeWithMetaDataLogger.t:dna" spec="beast.evolution.tree.TreeWithMetaDataLogger" substitutions="true" branchratemodel="@ExponentialRelaxedClock.c:dna" tree="@Tree.t:dna"/>
   </logger>

You might want to copy the tree logger and create one tree log with time trees, and the other with trees in substitutions (make sure the IDs in the XML are unique).

It should be possible to set the flag in BEAUti, but obviously a bug is preventing you from doing this —  I will look into this.

Cheers,

Remco
--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at http://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

Chris Ruis

unread,
Nov 25, 2015, 8:45:25 AM11/25/15
to beast-users
Hi Remco,

Great, thanks very much for the rapid reply!

Chris

maryam almasi

unread,
Jan 18, 2022, 12:37:25 PM1/18/22
to beast-users
Hi,
I am using Beast v.1.10.4. There is a box with this title   'create tree log file with branch length in substitutions' in "MCMC" tab. could you please explain what is it? what difference does this box  make in results?

Reply all
Reply to author
Forward
0 new messages