Polymorphic states for ancestral reconstruction of discrete morphological traits

271 views
Skip to first unread message

Eve Radunz

unread,
Mar 20, 2016, 9:44:46 AM3/20/16
to beast-users
Hi All,

I'm wondering if there's a way to code for polymorphic states in a traits file? I want to do an ancestral reconstruction analysis using discrete morphological data. A lot of my taxa have polymorphic character states.

I have tried coding as the following: 0/1        0&1           {0 1}

For each of these variations I get the following error in BEAUti:
Not all values of same type for "charactername" 

And the values in the traits tab show only the first character state.

Is this possible? How do I code for it in the traits file?

Thanks,

Eve

Santiago Sanchez

unread,
Mar 20, 2016, 11:42:23 AM3/20/16
to beast...@googlegroups.com
Hi Eve,

You can use polymorphic states for ancestral reconstruction. But you have to declare these states as ambiguities in the XML. For instance:

<generalDataType id="general">
           <state code="0"/>
           <state code="1"/>
           <ambiguity code="2" states="01"/>
</generalDataType>

If you search "generalDataType ambiguities", there are several threads in this forum with examples and useful information.

Cheers,
Santiago
--
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 https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

Eve Radunz

unread,
Mar 20, 2016, 8:58:13 PM3/20/16
to beast-users
Thanks Santiago!

I have tried modifying the ambiguity codes and putting them in my .xml file, but I get a parsing error because "document structures must start and end within the same entity." To me it looks fine, but I'm sure I've done something wrong.

I've attached my .xml file - could you take a look?

Thanks
ancestral_state_ITS_ndhF_psbD_3morph.xml

Santiago Sánchez

unread,
Mar 21, 2016, 4:13:00 AM3/21/16
to beast...@googlegroups.com
Hi Eve,

Sure, can you explain to me briefly how many states do you have per trait? and which of them are polymorphic?

Santiago
--
Santiago Sánchez-Ramírez
Environmental Genomics Group
Max Planck Institute for Evolutionary Biology
August-Thienemann-Str. 2
24306 Plön
Germany

Nicola de maio

unread,
Mar 21, 2016, 4:50:07 AM3/21/16
to beast-users
Hi Eve,

In case you are interested in a substitution model including explicitly polymorphisms (ancestral and/or present) you could give a look at the PoMo package in BEAST2.

Cheers,
Nicola

Eve Radunz

unread,
Mar 21, 2016, 9:02:31 AM3/21/16
to beast-users
Hi Santiago,

I've attached my mesquite nexus matrix, I am only using the Discrete matrix. For most characters there are ~3 states, however a few have >6.

Eve
Morphology.nex

Eve Radunz

unread,
Mar 21, 2016, 9:02:56 AM3/21/16
to beast-users
Thanks Nicola - will do!

Santiago Sánchez

unread,
Mar 21, 2016, 10:41:09 AM3/21/16
to beast...@googlegroups.com
Hi Eve,

From your 3 trait XML (Adaxial_leaf_surface, Abaxial_leaf_surface, Corolla_tube_type) and your matrix, it seems that you have 3 states for the first two traits and 4 states for the third, and only the third is polymorphic. There shouldn't be any trouble if you use, 012, for the first two, and 01234, for the third. In this case, you would code you ambiguities/polymorphisms as:

<generalDataType id="general">
           <state code="0"/>
           <state code="1"/>
           <state code="2"/>
  <state code="3"/>
  <state code="4"/>
           <ambiguity code="5" states="04"/>  <!-- polymorphic between 0 and 4 -->
           <ambiguity code="6" states="02"/>  <!-- polymorphic between 0 and 2 -->
</generalDataType>

So, those terminals with "{0 4}" would have "5", and those with "{0 2}" would have "6".

Let me know if this works.

Cheers,
Santiago


--
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 https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

Eve Radunz

unread,
Mar 22, 2016, 9:54:20 PM3/22/16
to beast-users
Hi Santiago,

Worked perfectly - thank you! I've attached a copy of my final .xml file for anyone who is having similar issues to see what the solved file looks like.

Eve
ancestral_state_ITS_ndhF_psbD_discretemorph_edited.xml
Reply all
Reply to author
Forward
0 new messages