Closed hina-shah closed 1 month ago
Hi @hina-shah - at the moment, the get_associations
method works better if you use biolink curie versions of the category and predicate names, e.g. ["biolink:ChemicalEntity"] vs. ["chemical entity"].
def test_get_associations_gene_to_chemical(toolkit):
associations = toolkit.get_associations(
subject_categories=["biolink:ChemicalEntity"],
predicates=["biolink:affects"],
object_categories=["biolink:GeneOrGeneProduct"],
# we don't bother testing the 'format' flag simply in confidence
# that the associated code is already well tested in other contexts
formatted=True
)
assert associations
assert "biolink:ChemicalAffectsGeneAssociation" in associations
print(associations)
We can use this issue to check for non-curie versions of the biolink components and add this feature. :) But as a work around, use the full curie and let me know if that works better for you?
Thanks @sierra-moxon !!
We are trying to use
get_associations()
and are getting some unexpected results.A couple of examples I tried:
tk.get_associations( subject_categories = ["chemical entity"], predicates = ["affects"], object_categories= ["gene or gene product"] )
, and was expecting a"chemical affects gene association"
to be returned, but instead got an empty list.Similarly for:
tk.get_associations( subject_categories = ["gene"], predicates = ["member of"], object_categories= ["gene family"] )
I was expecting to get"gene to gene family association"
, but got an empty list as well.Is this the right usage for this function?