I’d like to get the genome and exome total number for each ancestry group through api. I have tested the api data, I can get the exome statistics but i can’t get the genome data:
API_URL = " https://gnomad.broadinstitute.org/api "
\# gnomAD v4 群体映射
POPULATION_NAMES = {
"afr": "African/African American",
"amr": "Admixed American",
"asj": "Ashkenazi Jewish",
"eas": "East Asian",
"fin": "European (Finnish)",
"nfe": "European (non-Finnish)",
"sas": "South Asian",
"mid": "Middle Eastern",
"remaining": "Remaining",
"XX": "XX (Female)",
"XY": "XY (Male)",
}
\# GraphQL 查询(基于 gnomad_python_api)
QUERY = """
query GeneVariants($geneSymbol: String!, $referenceGenome: ReferenceGenomeId!, $datasetId: DatasetId!, $transcriptId: String) {
gene(gene_symbol: $geneSymbol, reference_genome: $referenceGenome) {
variants(dataset: $datasetId, transcript_id: $transcriptId) {
variant_id
pos
chrom
ref
alt
hgvsc
hgvsp
exome {
ac
an
ac_hom
ac_hemi
faf95 {
popmax
popmax_population
}
populations {
id
ac
an
ac_hom
}
}
genome {
ac
an
ac_hom
ac_hemi
faf95 {
popmax
popmax_population
}
populations {
id
ac
an
ac_hom
}
}
joint {
ac
an
ac_hom
hemizygote_count
faf95 {
popmax
popmax_population
}
populations {
id
ac
an
ac_hom
}
}
}
}
}
"""
got result: only exome, no genome and joint data:
{
“variant_id”: “2-88452455-CG-C”,
“pos”: 88452455,
“chrom”: “2”,
“ref”: “CG”,
“alt”: “C”,
“hgvsc”: “c.80del”,
“hgvsp”: “p.Pro27ArgfsTer114”,
“exome”: {
“ac”: 2,
“an”: 910772,
“ac_hom”: 0,
“ac_hemi”: 0,
“populations”: [
{
“id”: “remaining”,
“ac”: 0,
“an”: 31806,
“ac_hom”: 0
},
{
“id”: “amr”,
“ac”: 0,
“an”: 3196,
“ac_hom”: 0
},
{
“id”: “fin”,
“ac”: 1,
“an”: 9146,
“ac_hom”: 0
},
{
“id”: “mid”,
“ac”: 0,
“an”: 2002,
“ac_hom”: 0
},
{
“id”: “nfe”,
“ac”: 1,
“an”: 812138,
“ac_hom”: 0
},
{
“id”: “sas”,
“ac”: 0,
“an”: 17968,
“ac_hom”: 0
},
{
“id”: “asj”,
“ac”: 0,
“an”: 7378,
“ac_hom”: 0
},
{
“id”: “eas”,
“ac”: 0,
“an”: 9774,
“ac_hom”: 0
},
{
“id”: “afr”,
“ac”: 0,
“an”: 17364,
“ac_hom”: 0
}
]
},
“genome”: null
}
this is different from the browser showed, how to get the data through api?
