lmaurits / BEASTling

A linguistics-focussed command line tool for generating BEAST XML files.
BSD 2-Clause "Simplified" License
20 stars 6 forks source link

Monophyly and calibration can lead to impossible starting trees #186

Closed Anaphory closed 6 years ago

Anaphory commented 6 years ago

Because calibrations add monophyly constraints and because those language groups are not enforced to be compatible with each other, we can have the situation where beastling runs without error, but beast says

Error 110 parsing the xml input file

validate and intialize error: 333: Don't know how to generate a Random Tree for taxon sets that intersect, but are not inclusive. Taxonset null and timor_tapMRCA

Error detected about here:
  <beast>
      <run id='mcmc' spec='MCMC'>
          <init id='startingTree' spec='beast.evolution.tree.ConstrainedRandomTree'>

Minimal example follows as test as soon as I get round to it.

Anaphory commented 6 years ago

What on earth is taxon set null? I assumed it was an unnamed taxonset. We don't have unnamed taxonsets!

lmaurits commented 6 years ago

Not sure if we have discussed this previously or not, but lately I have been wondering if we should have a way to impose calibrations without this also adding monophyly constraints...

So basically the ideal fix here is to programmatically test whether the clades implied by each calibration are consistent with the whole-tree monophyly constraints (whether those be user-provided or from Glottolog)?

If, in the process of solving this, we end up with a nice, neat function for testing monophyly consistency, we should make use of that to close #20 (our oldest currently open Issue!), which is still open after nearly two years because the idea of writing some kind of general consistency checker like this always seemed like a tedious chore to me...

Anaphory commented 6 years ago

Not sure if we have discussed this previously or not, but lately I have been wondering if we should have a way to impose calibrations without this also adding monophyly constraints...

Even if not explicitly discussed, yes, it was implied somewhere.

lmaurits commented 6 years ago

I just pushed some commits which I am hoping will handle this (i.e. BEASTling will throw an error if calibrations are provided for taxonsets which are not consistent with the global monophyly constraints). Could you confirm that this catches your particular case? Thinking about how to catch this problem made my head hurt and I give no guarantee that my solution is perfect.

lmaurits commented 6 years ago

Did this work?