RTXteam / RTX

Software repo for Team Expander Agent (Oregon State U., Institute for Systems Biology, and Penn State U.)
https://arax.ncats.io/
MIT License
34 stars 20 forks source link

Integrate Multiomics Provider KPs #1451

Closed rtroper closed 3 years ago

rtroper commented 3 years ago

We want to ensure that Multiomics Provider KPs are integrated with Expander Agent. As of now, it appears that Expander Agent might only access Multiomics Provider KPs via BTE (Exploring Agent). Also, note, endpoints for two of our KPs have recently changed:

EHR Risk KP is now: https://api.bte.ncats.io/v1/smartapi/d86a24f6027ffe778f84ba10a7a1861a/query Wellness KP is now: https://api.bte.ncats.io/v1/smartapi/02af7d098ab304e80d6f4806c3527027/query

If these KPs had been integrated with Expander Agent, they'll need to be updated. Other endpoints needing integration are our Drug Response KP and Tumor Gene Mutation KP (see our wiki page for the endpoints).

dkoslicki commented 3 years ago

Calls for volunteers on this @amykglen @finnagin @ShaopengLiu1 @chunyuma. Let me know if you have the bandwidth to do this (after this week, of course). See also #1206 (which we apparently forgot to follow up on)

amykglen commented 3 years ago

Hi @rtroper - do your KPs have TRAPI APIs? That would make integration very easy, but when I checked a while back I couldn't seem to find any TRAPI endpoints.

amykglen commented 3 years ago

ah, I realized I was looking for the "TRAPI" tag in the Smart API registry, which I don't see associated with your KPs, but now seeing the TRAPI info on your wiki page..

amykglen commented 3 years ago

ok - all four Multiomics KPs are now integrated with ARAX! changes are in the NewFmt branch.

some test examples here.

rtroper commented 3 years ago

Wow, that was fast. Thank you!

amykglen commented 3 years ago

I confirmed that the integrations seem to be working as expected on our TRAPI 1.1 endpoint after deployment. some sample queries that utilize the various Multiomics KPs are as follows:

Clinical risk KP: https://arax.ncats.io/NewFmt/?r=10088 Tumor gene mutation KP: https://arax.ncats.io/NewFmt/?r=10090 Drug response KP: https://arax.ncats.io/NewFmt/?r=10092 Wellness KP: https://arax.ncats.io/NewFmt/?r=10093

so I believe this issue is complete. feel free to close the issue @rtroper if you agree!

rtroper commented 3 years ago

Thanks Amy! I've done my own independent tests on all four and three of them look good (clinical risk, tumor gene mutation, and wellness). I haven't been able to get results yet from the drug response KP. I looked at your results for the drug response KP, expanding several results and didn't find any that come from our KP. Here's a query that I think should return results from our drug response KP:

{
    "nodes": {
        "n00": {
            "categories": ["biolink:ChemicalSubstance"],
            "is_set": false
        },
        "n01": {
            "ids": ["NCBIGene:23037"], 
            "categories": ["biolink:Gene"],
            "is_set": false
        }
    },
    "edges": {
        "e01": {
            "subject": "n00",
            "object": "n01",
            "predicates": ["biolink:related_to"]
        }
    }
}

I tested this (above) through the ARAX TRAPI 1.1 user interface and didn't get results from the drug response KP. As a separate test, I submitted this equivalent TRAPI 1.0 query (below) directly to the KP endpoint (https://api.bte.ncats.io/v1/smartapi/adf20dd6ff23dfe18e8e012bde686e31/query) and it returned results:

{
    "message": {
        "query_graph": {
            "nodes": {
                "n00": {
                    "category": "biolink:ChemicalSubstance"
                },
                "n01": {
                    "id": ["NCBIGene:23037"], 
                    "category": "biolink:Gene"
                }
            },
            "edges": {
                "e01": {
                    "subject": "n00",
                    "object": "n01",
                    "predicate": "biolink:related_to"
                }
            }
        }
    }
}

Any ideas what might be going on?

amykglen commented 3 years ago

great! hmm - so it looks to me like it's an issue of predicates - if you send this query to our TRAPI 1.1 endpoint (just uses a different predicate):

{
    "nodes": {
        "n00": {
            "categories": ["biolink:ChemicalSubstance"],
            "is_set": false
        },
        "n01": {
            "ids": ["NCBIGene:23037"], 
            "categories": ["biolink:Gene"],
            "is_set": false
        }
    },
    "edges": {
        "e01": {
            "subject": "n00",
            "object": "n01",
            "predicates": ["biolink:gene_has_variant_that_contributes_to_drug_response_association"]
        }
    }
}

it does use the Drug Response KP: https://arax.ncats.io/NewFmt/?r=10206

the reason why biolink:related_to doesn't yet trigger use of the Drug Response KP for this query is because right now, our KP selection is done explicitly based on what KPs advertise in their /predicates endpoints, and the Drug Response KP only advertises this:

{
    "biolink:ChemicalSubstance":{
      "biolink:Gene":[
        "biolink:gene_has_variant_that_contributes_to_drug_response_association"
      ]
    },
    "biolink:Gene":{
      "biolink:ChemicalSubstance":[
        "biolink:gene_has_variant_that_contributes_to_drug_response_association"
      ]
    }
  }

in my understanding it's a bit of an undecided issue whether category/predicate ancestors should be advertised in /predicates (we do so for our RTX-KG2 KP), but we have it on our to-do list to start inferring this on our end for KP selection, in case KPs aren't advertising such info (#1465).

rtroper commented 3 years ago

Oh, this is perfect, thanks. I thought we had used a different predicate (than related_to), but I couldn't remember what it was. And when I queried directly on the Smart API (note, we use Service Provider tools to deploy Smart APIs and then provide a spec that defines a TRAPI interface), without specifying a predicate, the results that came back only showed related_to for the predicate. And I just didn't think to query the predicates endpoint to get the exact predicate.

Anyway, thanks! I checked out the results you provided and indeed I see results from the drug response KP. Thanks for all your help. Closing this issue.