CGW
14 September 2022 15:48
1
Hi,
How do I format a SQL query in BigQuery of a predefined target list (with ensembl IDs) to return disease associations?
Super grateful for any guidance.
Thanks, CGW
hcornu
15 September 2022 09:14
2
Hi @CGW , and welcome to the Open Targets Community!
Please could you take a look at the following posts, and see if they answer your question?
At Open Targets, we have several ways of accessing our data. In this post, we illustrate how to make the best use of it from the BigQuery workspace.
Batch search using BigQuery
This query is an example of how to extract the drugs that are on the market for a restricted list of targets.
SELECT
targets.approvedSymbol,
targets.id,
ARRAY_AGG(drugs.id) AS drugIds
FROM `open-targets-prod.platform.molecule` AS drugs,
UNNEST(linkedTargets.rows.list) AS linkedTarget
JOIN `open-targets-prod.pl…
Problem
The Open Targets helpdesk recently received the following question:
I have used the older version of the Open Targets Platform (21.02), and the previous API technique, to get targets associated with disease and their overall scores.
But now after updating (to version 21.04) I can’t do it with the new GraphQL API technique. Could you help me with this? How can I get associated targets with disease and their overall scores using the new GraphQL API?
To make it easier, I need to get t…
Hello @anticancer.org.uk !
Welcome to the Open Targets Community!
Thank you for submitting your question about how to access associations data using our GraphQL API. I have responded below and also included two other ways of accessing the data for more systematic and comprehensive queries.
How do I access associations data using the Open Targets Platform GraphQL API?
To access all associations data for a given target or disease/phenotype through our GraphQL API, you you will nee…
There are also some sample queries available in our documentation , as well as in our Google Cloud dataset homepage .
These should help you get started
CGW
20 September 2022 22:25
3
Thanks for the helpful posts provided above. For BigQuery,
what is the best/most efficient way to define ‘Where’ for a target list of 100s (e.g. from a CSV file) as compared to the case below with just a couple of targets?
WHERE drugs.maximumClinicalTrialPhase = 4 AND
targets.approvedSymbol IN (
'ERBB3',
'EGFR'
)
Thanks, CGW
1 Like
hcornu
21 September 2022 14:39
4
Hi @CGW !
For large lists of targets, the most efficient way to query the data is to use our data downloads.
Our amazing Irene Lopez created a parallel post to walk you through this: Get marketed drugs for a set of targets with the data downloads
Here too, there is some information available in the documentation .
For target-disease associations, we have a number of download files available, depending on the information you are looking for. Check out the files we have available here: Open Targets Platform