Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible issue with species overlap threshold #404

Closed
rderelle opened this issue May 14, 2019 · 3 comments
Closed

possible issue with species overlap threshold #404

rderelle opened this issue May 14, 2019 · 3 comments
Labels

Comments

@rderelle
Copy link

there might be a problem with the way the species overlap threshold is implemented.
With default parameters, sos_thr = 0, ete3 reports speciation events in my tree. However, when increasing this threshold, even marginally (e.g. sos_thr = 0.0000001), no speciation event is reported while we would expect to have more (or at least the same number).

If correct, I think the problem comes from here:
https://github.com/etetoolkit/ete/blob/master/ete3/phylo/spoverlap.py

    # If species overlap: duplication
    if score > sos_thr:# and d > 0.0: Removed branch control.
        event.node = current.up
        event.etype = "D"
        event.outparalogs = set([n.name for n in sister_leaves  if n.species == ref_spcs])
        event.orthologs   = set([])
        current.up.add_feature("evoltype","D")
        all_events.append(event)

    # If NO species overlap: speciation
    **elif score == sos_thr:**
        event.node = current.up
        event.etype = "S"
        event.orthologs = set([n.name for n in sister_leaves if n.species != ref_spcs])
        event.outparalogs = set([])
        current.up.add_feature("evoltype","S")
        all_events.append(event)
    else:
        pass # do not add event if distances == 0

I do not quite understand the 'elif score == sos_thr:' ... there should be cases where score < sos_thr (e.g. cases where speciation events appear because the score is below the threshold).

best,
Romain

@jhcepas
Copy link
Member

jhcepas commented May 25, 2019

Hi Romain,
I think you are right. This code comes from early ETE times (2007), and to be honest we never use sos_thr != 0. I will fix it asap

@jhcepas
Copy link
Member

jhcepas commented May 25, 2019

I also noted that this was only affecting to 'get_my_evol_events' but not 'get_descendant_evol_events'

@rderelle
Copy link
Author

Hi Jaime (hope you are doing great),

I haven't used the 'get_descendant_evol_events' function.
At the end, I wrote my own function that is slightly different from the 'get_my_evol_events'. But I wanted to point the issue in case other peoples were interested in using 'get_my_evol_events'.

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants