DessimozLab / pyham

MIT License
9 stars 5 forks source link

Taxonomy read function broken in OMA Browser REST API #9

Closed ethanbass closed 2 years ago

ethanbass commented 4 years ago

While it's not a problem with pyham per se, I'm not sure who to contact about the OMA API. As pointed out by Olga, querying the oma database returns a 500 error because the taxonomy read function in the API appears to be broken?

Hi Clement, Thanks again for your help. Using the suggested code you provided above:

my_gene_query = 'P53_RAT'
pyham_analysis = pyham.Ham(query_database=my_gene_query, use_data_from='oma')

Gets me the following 500 error:

---------------------------------------------------------------------------
ErrorMessage                              Traceback (most recent call last)
<ipython-input-46-0ce71051f92a> in <module>
----> 1 pyham_analysis = pyham.Ham(query_database=my_gene_query, use_data_from='oma')

~/miniconda3/envs/tabula-microcebus-v2/lib/python3.7/site-packages/pyham/ham.py in __init__(self, tree_file, hog_file, type_hog_file, filter_object, use_internal_name, orthoXML_as_string, tree_format, phyloxml_internal_name_tag, phyloxml_leaf_name_tag, use_data_from, query_database)
    184                 }
    185 
--> 186                 open_tax = client.action(schema, action_phy, params=params_phy)
    187 
    188                 self.tree_file = 'taxonomy_from_oma_open_at_{}.phyloxml'.format(top_level)

~/miniconda3/envs/tabula-microcebus-v2/lib/python3.7/site-packages/coreapi/client.py in action(self, document, keys, params, validate, overrides, action, encoding, transform)
    176         # Perform the action, and return a new document.
    177         transport = determine_transport(self.transports, link.url)
--> 178         return transport.transition(link, self.decoders, params=params, link_ancestors=link_ancestors)

~/miniconda3/envs/tabula-microcebus-v2/lib/python3.7/site-packages/coreapi/transports/http.py in transition(self, link, decoders, params, link_ancestors, force_codec)
    384 
    385         if isinstance(result, Error):
--> 386             raise exceptions.ErrorMessage(result)
    387 
    388         return result

ErrorMessage: <Error: 500 Internal Server Error>
    message: "<h1>Server Error (500)</h1>"

Is the server down?

Originally posted by @olgabot in https://github.com/DessimozLab/pyham/issues/5#issuecomment-590962873

F4llis commented 4 years ago

Hello Ethan,

The server is not down, we manage to make the piece of code above running.

Nevertheless, we are aware that some people may experience problem with this. It seems that the problem is based on python and related dependencies/library install (request, pyopenssl, etc..).

Few similar issues were open on the coreapi library git. I encourage you to have a look at it and notify us if you find the problem so we can provide a solution on the pyham installation help page.

Clement

ethanbass commented 4 years ago

Hi Clement, Thanks for your reply! I think the issue is related to this issue I posted on the pyomadb page (though it appears to be a problem with the API itself from what I can tell). It appears that the API is unable to retrieve large clades, e.g. Chordata. For example this link (https://omabrowser.org/api/taxonomy/Chordata/) returns the 500 server error, but this link (https://omabrowser.org/api/taxonomy/Euarchontoglires/) works fine.

alpae commented 2 years ago

This seems to work now. I'm closing the issue. Feel free to reopen it if you still have problems.