naturalis / supersmart

Self-Updating Platform for the Estimation of Rates of Speciation, Migration And Relationships of Taxa
MIT License
17 stars 5 forks source link

weird bbdecompose / cladegraft behavior #86

Closed rvosa closed 8 years ago

rvosa commented 8 years ago

For the butterflies I have a backbone group ((Maniola_telmessia,Hyponephele_lycaon),Maniola_jurtina); that is decomposed into a clade ((M._jurtina,M._chia),M._nurag);, which is then grafted unsuccessfully: dies with division by zero (TreeService line 886), even though the clade tree doesn't have zero-length branches.

There's a couple of weird things about this:

hettling commented 8 years ago

I'm trying to reproduce this. Another thing: Only Hyponephele lycaon ends up in the backbone and in the markers table, although there are 23 species for Hyponephele in the database with in total 68 sequences, which appears weird.

How does the marker table for this clade look like?

rvosa commented 8 years ago

In the input name list only two species of Hyponephele were included - because we're not trying to build the tree for all butterflies, just the Dutch ones. Of those two, only one ends up in the backbone. By itself it's therefore not so surprising that we only have that one species, entangles in Maniola.

rvosa commented 8 years ago

So what appeared to be happening was that I was allowing backbone exemplars with only 1 marker, whereas for the clades I was still going with the default of 2 markers. In this particular case, one of the two exemplars only had one marker, so it was included in the backbone but not in the clade data set. Consequently, when time came to graft - only one exemplar could be found, clade depth could not be computed, hence: division by zero.

It would be good if the clade grafter could detect that it had only found one exemplar so that grafting can't proceed for that clade. Maybe emit an ERROR and continue on to the next clade?

hettling commented 8 years ago

Also note that in the workflow, BACKBONE_MAX_DISTANCE is set after smrt orthologize and therefore has not an effect, probably the default of 0.1 was taken insteda of 0.2 in the workflow.