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

reciprocal queries not matching #317

Closed
andrewsu opened this issue Oct 8, 2021 · 5 comments
Closed

reciprocal queries not matching #317

andrewsu opened this issue Oct 8, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@andrewsu
Copy link
Member

andrewsu commented Oct 8, 2021

I execute this query to find any NamedThing related to xylitol (UMLS:C0043369):

{
   "message": {
       "query_graph": {
           "edges": {
               "e01": {
                   "subject": "n0",
                   "object": "n1"
               }
           },
           "nodes": {
               "n0": {
                   "ids": ["UMLS:C0043369"],
                   "categories": ["biolink:SmallMolecule"]
               },
               "n1": {
                   "categories": ["biolink:NamedThing"]
               }
           }
       }
   }
}

one of the results is Aldehyde Reductase (UMLS:C0002003)

                "UMLS:C0002003": {
                    "categories": [
                        "biolink:Protein"
                    ],
                    "name": "Aldehyde Reductase",
                "e4adf01204f21097e082a304b13da4f2": {
                    "predicate": "biolink:physically_interacts_with",
                    "subject": "UMLS:C0043369",
                    "object": "UMLS:C0002003",
                    "attributes": [
                        ...
                        {
                            "attribute_type_id": "biolink:aggregator_knowledge_source",
                            "value": [
                                "infores:biothings-semmeddb-chemical"
                            ],
                            "value_type_id": "biolink:InformationResource"
                        },
                        {
                            "attribute_type_id": "publications",
                            "value": [
                                "PMID:26264136",
                                "PMID:28188449"
                            ]
                        }
                    ]

But when I query for NamedThings related to Aldehyde Reductase (UMLS:C0002003), I get no results:

{
   "message": {
       "query_graph": {
           "edges": {
               "e01": {
                   "subject": "n0",
                   "object": "n1"
               }
           },
           "nodes": {
               "n0": {
                   "ids": ["UMLS:C0002003"],
                   "categories": ["biolink:Protein"]
               },
               "n1": {
                   "categories": ["biolink:NamedThing"]
               }
           }
       }
   }
}
        "knowledge_graph": {
            "nodes": {},
            "edges": {}
        },
        "results": []
@colleenXu
Copy link
Collaborator

This is related to #227 and was going to be addressed with x-bte annotations of the new SEMMEDDB API

@andrewsu andrewsu added the bug Something isn't working label Oct 20, 2021
@colleenXu
Copy link
Collaborator

colleenXu commented Dec 3, 2021

The records involved in the new semmeddb api are here

However, BTE did not ingest these two records based on the notebook because:

  • Currently there isn't a good way to express negation in Translator, although a PR was recently proposed to handle that
  • the SEMMED semantic type for xylitol is carb (carbohydrate). However, records with this semantic type are currently filtered out (see the heading "Remove semantic types in data but not in SRDEF" here).

However, reverse operations do exist for all operations generated by the semmeddb notebook for the new semmeddb api...

I therefore propose closing this issue... Andrew and I discussed on 12/6.....making the change after the demo to "not remove semantic types that are in the data but not in SRDEF" and working from there...

@colleenXu
Copy link
Collaborator

colleenXu commented Dec 16, 2021

Yao noticed that the data file used "old SEMMED semantic types" from 2013AA, and these semantic types didn't exist in the latest SRDEF file (2018AA).

In response, Andrew said to keep this data

@colleenXu
Copy link
Collaborator

Should be addressed by NCATS-Tangerine/translator-api-registry@aa681a2

@colleenXu
Copy link
Collaborator

colleenXu commented Dec 30, 2021

The query that is the same direction compared to the data now successfully finds this triple, as well as the query in the "reverse" direction. POST to https://api.bte.ncats.io/v1/smartapi/1d288b3a3caf75d541ffaae3aab386c8/query

forward-direction query
{
   "message": {
       "query_graph": {
           "edges": {
               "e01": {
                   "subject": "n0",
                   "object": "n1",
                   "predicates": ["biolink:produces"]
               }
           },
           "nodes": {
               "n0": {
                   "ids": ["UMLS:C0002003"],
                   "categories": ["biolink:Polypeptide"]
               },
               "n1": {
                   "categories": ["biolink:SmallMolecule"]
               }
           }
       }
   }
}
response
                "50c72726686ae3b85be43be067ca39e3": {
                    "predicate": "biolink:produces",
                    "subject": "UMLS:C0002003",
                    "object": "UMLS:C0043369",
                    "attributes": [
                        {
                            "attribute_type_id": "biolink:aggregator_knowledge_source",
                            "value": [
                                "infores:biothings-explorer"
                            ],
                            "value_type_id": "biolink:InformationResource"
                        },
                        {
                            "attribute_type_id": "biolink:primary_knowledge_source",
                            "value": [
                                "infores:semmeddb"
                            ],
                            "value_type_id": "biolink:InformationResource"
                        },
                        {
                            "attribute_type_id": "biolink:aggregator_knowledge_source",
                            "value": [
                                "infores:biothings-semmeddb"
                            ],
                            "value_type_id": "biolink:InformationResource"
                        },
                        {
                            "attribute_type_id": "biolink:publications",
                            "value": [
                                "PMID:28188449"
                            ]
                        },
                        {
                            "attribute_type_id": "biolink:original_object",
                            "value": "C0043369"
                        },
                        {
                            "attribute_type_id": "biolink:original_predicate",
                            "value": "PRODUCES"
                        },
                        {
                            "attribute_type_id": "biolink:original_subject",
                            "value": "C0002003"
                        },
                        {
                            "attribute_type_id": "original_object_name",
                            "value": "Xylitol"
                        },
                        {
                            "attribute_type_id": "original_subject_name",
                            "value": "Aldehyde Reductase"
                        }
                    ]
                },

reverse direction query
{
   "message": {
       "query_graph": {
           "edges": {
               "e01": {
                   "subject": "n1",
                   "object": "n0",
                   "predicates": ["biolink:produced_by"]
               }
           },
           "nodes": {
               "n0": {
                   "ids": ["UMLS:C0002003"],
                   "categories": ["biolink:Polypeptide"]
               },
               "n1": {
                   "categories": ["biolink:SmallMolecule"]
               }
           }
       }
   }
}
response
                "2004c79c178267eb6face02282a9f573": {
                    "predicate": "biolink:produced_by",
                    "subject": "UMLS:C0043369",
                    "object": "UMLS:C0002003",
                    "attributes": [
                        {
                            "attribute_type_id": "biolink:aggregator_knowledge_source",
                            "value": [
                                "infores:biothings-explorer"
                            ],
                            "value_type_id": "biolink:InformationResource"
                        },
                        {
                            "attribute_type_id": "biolink:primary_knowledge_source",
                            "value": [
                                "infores:semmeddb"
                            ],
                            "value_type_id": "biolink:InformationResource"
                        },
                        {
                            "attribute_type_id": "biolink:aggregator_knowledge_source",
                            "value": [
                                "infores:biothings-semmeddb"
                            ],
                            "value_type_id": "biolink:InformationResource"
                        },
                        {
                            "attribute_type_id": "biolink:publications",
                            "value": [
                                "PMID:28188449"
                            ]
                        },
                        {
                            "attribute_type_id": "biolink:original_object",
                            "value": "C0043369"
                        },
                        {
                            "attribute_type_id": "biolink:original_predicate",
                            "value": "PRODUCES"
                        },
                        {
                            "attribute_type_id": "biolink:original_subject",
                            "value": "C0002003"
                        },
                        {
                            "attribute_type_id": "original_object_name",
                            "value": "Xylitol"
                        },
                        {
                            "attribute_type_id": "original_subject_name",
                            "value": "Aldehyde Reductase"
                        }
                    ]
                },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants