A (tentative) primer on discrete ancestral area reconstruction in Beast

137 views
Skip to first unread message

zany...@gmail.com

unread,
May 6, 2024, 7:18:23 AM5/6/24
to beast-users
Hi everyone,

This is not a question but rather a hopefully useful post on discrete state ancestral area reconstruction in Beast. The tutorials for this type of analysis here:

Rabies virus in bat populations: https://beast.community/workshop_discrete_diffusion 

deal with single-locus datasets where each of the tips in the tree have a single state. I wanted to assemble an XML for simultaneous tree inference and (discrete) ancestral area reconstruction with (1) a multi-locus target-capture data set with multiple samples per species and (2) where each of the tips have one or multiple states.

To address (1), I used the StarBEAST2 template in Beauti 2.7.6 to set up the XML. The tutorials above recommend using the standard BEAST template for setting up XMLs, but this template lacks the "taxon sets" tab that allows the user to assign samples to species. I tried to edit the taxonsets in the XML after setting it up in the BEAST standard template, but then had parsing problems in BEAST where the number of leaves and number of tips in the species tree were unequal.

To address (2), I found a post by another beast-user that helped a lot. To set up the discrete states where each tip has one or several states, add a discrete trait as a partition in Beauti as usual, but assign only one state to each tip to begin with (but make sure that all possible states appear at least once in the discrete state partition). Then, edit the trait information in the XML in a text editor, e.g.:

                        <traitSet id="traitSet.Trait" spec="beast.base.evolution.tree.TraitSet" taxa="@taxonsuperset" traitname="discrete">
S1=A_B_C,
S2=B_C,
S3=A_B</traitSet>

                        <userDataType id="traitDataType.Trait" spec="beast.base.evolution.datatype.UserDataType" codeMap=" A=0, B=1, C=2, A_B_C=0 1 2, B_C=1 2, ? = 0 1 2 " codelength="-1" states="3"/>

Where polymorphic state B_C above is coded as comprising both states 1 and 2.

Hope this helps!

Zaynab




 

zany...@gmail.com

unread,
May 6, 2024, 7:22:31 AM5/6/24
to beast-users
Correction, the codeMap above should also include A_B=0 1, after B_C=1 2,

Cristhiam Cerpas

unread,
May 6, 2024, 2:07:44 PM5/6/24
to beast...@googlegroups.com
Thanks Zany, really nice info.
best
Cristhiam

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/beast-users/98247ed0-546a-421b-a4b2-fc75f0dcf7b5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages