Issue with Fetching Population Allele Frequency in gnomAD GraphQL API
0
0
Entering edit mode
4 days ago
DareDevil ★ 4.4k

I am trying to fetch variant details, including population allele frequency (af), from the gnomAD database using the GraphQL API. However, the query does not return allele frequency for populations. When I add af under populations, I get the following error:

GraphQLError: Cannot query field 'af' on type 'VariantPopulation'. Did you mean 'ac' or 'an'?

GraphQL request:10:9
 9 |         populations {
10 |         af
   |         ^
11 |         id

My Query:

from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport

# GraphQL query to fetch variant details
query = gql(
"""
query VariantsInGene {
    gene(gene_symbol: "PTH", reference_genome: GRCh38) {
        variants(dataset: gnomad_r4) {
            variant_id
            pos
            exome {
                af
                populations {
                    id
                }
            }
        }
    }
}
"""
)

res = await client.execute_async(query)
  • Fetching allele frequency (af) at the exome level (works fine).
  • Adding af inside populations (causes the error).
  • Checking available fields for VariantPopulation (suggests ac and an, but not af).

How can I retrieve allele frequency (af) per population in gnomAD GraphQL?

If I remove af from query it executes and generate output but no af is retrieved for populations:

allelle frequency api GraphQL gnomad • 181 views
ADD COMMENT

Login before adding your answer.

Traffic: 1575 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6