I’d like to query multiple genetic variants (100s) for pheWAS trait associations using UKBB, FinnGen, and GWAS catalog. Is it best to use an API approach or download the entire dataset from the Open Targets Genetics portal? If the former, is the GraphiQL only linked to the PheWAS catalog or all pheWAS datasets? If the latter, what is the data table I would want to download?
Unfortunately, due to the size and scope of our PheWAS plot data, we are unable to provide the raw data in downloadable datasets.
You can access the data through our GraphQL API, using the pheWAS endpoint and passing the variant in our variant format of chromosome + _ + position + _ + reference allele + _ + alternative/effect allele format (e.g. 12_130461363_C_A).
For example, to get the PheWAS data for 12_130461363_C_A, you would construct the following GraphQL query:
It is important to note that our GraphQL API only returns trait associations from UK Biobank, FinnGen, and GWAS Catalog where the p-value is < 0.005 and this threshold cannot be adjusted.
Hi. In my attempts to implement the solution in R, I’m encountering errors with the pheWAS API query. If someone please help me get it up and running, I would be very grateful.
Hi, the only problem with your query is that the API of the Genetics Portal has a different address: https://api.genetics.opentargets.org/graphql/ your query looks like this. Please let us know if my answer was not fully resolving the issue.