biolink-model-toolkit icon indicating copy to clipboard operation
biolink-model-toolkit copied to clipboard

Error in get_descendents with curies

Open cbizon opened this issue 2 years ago • 3 comments

v. 1.1.2

If I lookup descendents of noncoding RNA product it works:

tk.get_descendants("noncoding RNA product")
['noncoding RNA product', 'microRNA', 'siRNA']

But if I use the curie form (which came from a response to tk.get_descendents(...,formatted=True)) then it fails:

tk.get_descendants("biolink:NoncodingRNAProduct")
Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "/opt/anaconda3/envs/redistpf/lib/python3.12/site-packages/bmt/toolkit.py", line 739, in get_descendants
    raise ValueError("not a valid biolink component")

cbizon avatar Nov 06 '23 17:11 cbizon

The types and predicates that I found that have this problem are:

Error with type: biolink:NoncodingRNAProduct
Error with type: biolink:MicroRNA
Error with type: biolink:SiRNA
Error with predicate: biolink:gene_fusion_with
Error with predicate: biolink:genetic_neighborhood_of

I think that on the type side it's not happy when there are consecutive capital letters and on the predicate side when there are underscores in the non-curie name of the predicate. That latter case should probably be changed in the model as well...?

cbizon avatar Nov 06 '23 17:11 cbizon