What is the best way to query pheWAS traits for multiple variants?

Hi Open Target Team,

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?

Thank you,

Sarah

Hello @slifong08! :wave:

Welcome to the Open Targets Community! :tada:

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:

query PheWASQuery{
  pheWAS(variantId: "1_154453788_C_T") {
    associations {
      study {
        studyId
        traitReported
        traitCategory
        pmid
        pubDate
        pubAuthor
        source
      }
      pval
      beta
      oddsRatio
      nTotal
      nCases
      eaf
      se
    }
  }
}

Run this query in our GraphQL API playground

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.

Thank you! This is very helpful!

Hi, any further script to clear the format to data.frame? Thanks.