OpenTargets: How to filter by pathway?

38
February 04, 2019, at 8:30 PM

I am using the OpenTargets library as described here.

Using the website/interface, I can search for diabetes, and filter to only keep the genes in the pathway type 'Metabolism' and then sort by 'overall association score', as in this picture:

I would like to do the same method, using their API. With the below code, I can get a list of diabetes-related genes back, and rank by association score:

from opentargets import OpenTargetsClient
ot = OpenTargetsClient()
target_list = []
ass_for_disease = ot.get_associations_for_disease('diabetes')
for a in ass_for_disease:
    target = a['id']
    score = float(a['association_score']['overall'])
    if score == 1.0:
        target_list.append(target.strip().split('-')[0])
print(target_list) 

However, I cannot find out how to do the additional filter of only retaining genes in 'Metabolism' pathways.

Does someone know what extra filter I should use here to get this to work?

READ ALSO
How to create the duplicate widget?

How to create the duplicate widget?

I'm trying create new TabbedPanelItem with properties already created widgetBut i'm getting new empty widget or replace exist

32
Parse 2 difference Soap Response PHP

Parse 2 difference Soap Response PHP

I'm new in php, how to parse 2 difference response from soap xml ?

16
How to create custom resource views in laravel-nova?

How to create custom resource views in laravel-nova?

I have created an "Resource" (for "Invoice" Model), and i want to customise its "create & update" page instead of nova's default

19
ob_start newsletter script stopped working after switching servers

ob_start newsletter script stopped working after switching servers

I have a script (see below) that I use to send emails to subscribersThe script worked fine until I switched to a new server

47