SynBioDex / tyto

Use ontology terms in your Python application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Accelerate inference queries

jakebeal opened this issue · comments

Inference queries like is_ancestor_of are really useful, but right now they are quite slow, requiring on the order of seconds per query. I believe this is because they are always resolved with a query over the network. This isn't a big problem for interactive mode, but it severely limits their use in automation.

Can they be accelerated by running queries locally and/or caching?

Example of use case:

def has_plasmid_role(x):
    return any(r for r in x.roles if tyto.SO.plasmid.is_ancestor_of(r) or tyto.SO.vector_replicon.is_ancestor_of(r))

This is used as part of a system for detecting potential circularity for use in calculating sequences, but it's causing even a very small library to take over a minute to run.