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:
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