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

Semantic similarity error for same terms #150

Closed
serbulent opened this issue Jan 14, 2020 · 1 comment
Closed

Semantic similarity error for same terms #150

serbulent opened this issue Jan 14, 2020 · 1 comment

Comments

@serbulent
Copy link

serbulent commented Jan 14, 2020

The semantic_similarity function produces division by zero error for same term pair. It might be fixed as below;

def semantic_similarity(go_id1, go_id2, godag, branch_dist=None):
    '''
        Finds the semantic similarity (inverse of the semantic distance)
        between two GO terms.
    '''
    dist = semantic_distance(go_id1, go_id2, godag, branch_dist)
    if dist == 0:
        return 1
    if dist is not None:
        return 1.0 / float(dist)
    return None
@dvklopfenstein
Copy link
Collaborator

Thank you for your interest in GOATOOLS, taking the time to write us and your patience.

I have implemented this fix. Thank you so much for bringing it to our attention.

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

No branches or pull requests

2 participants