Skip to contents

Looked up by rsID, which is what gnomAD's variant query takes.

Usage

gnomad_frequency(rsid, dataset = GNOMAD_DATASET, ...)

Arguments

rsid

A dbSNP rsID.

dataset

The gnomAD dataset.

...

Passed to biohttp::post_json().

Value

A biohttp envelope whose data is the list described in gnomad_parse_frequency().

An rsID does not identify an allele

7:g.140753336A>T and 7:g.140753336A>C both map to rs113488022. Any lookup routed through an rsID is therefore lossy, and it fails silently while looking entirely plausible. The canonical key is (assembly, chromosome, position, ref, alt).

This function is faithful to what gnomAD's variant query accepts, so the limitation is gnomAD's rather than this package's. Know about it before you rely on the answer for a multi-allelic site.

References

Chen et al. (2024). A genomic mutational constraint map using variation in 76,156 human genomes. Nature 625(7993), 92-100. doi:10.1038/s41586-023-06045-0

Service documentation: https://gnomad.broadinstitute.org/

Examples

# \donttest{
biohttp::body_or_null(gnomad_frequency("rs113488022"))
#> $variant_id
#> [1] "7-140753336-A-T"
#> 
#> $dataset
#> [1] "gnomad_r4"
#> 
#> $exome
#> $exome$af
#> [1] 1.369283e-06
#> 
#> $exome$ac
#> [1] 2
#> 
#> $exome$an
#> [1] 1460618
#> 
#> 
#> $genome
#> NULL
#> 
#> $populations
#> # A tibble: 9 × 5
#>   pop       label                         ac      an          af
#>   <chr>     <chr>                      <dbl>   <dbl>       <dbl>
#> 1 sas       South Asian                    1   86244 0.0000116  
#> 2 nfe       European (non-Finnish)         1 1111098 0.000000900
#> 3 remaining Remaining                      0   60330 0          
#> 4 amr       Admixed American               0   44684 0          
#> 5 fin       European (Finnish)             0   53382 0          
#> 6 mid       Middle Eastern                 0    5746 0          
#> 7 asj       Ashkenazi Jewish               0   26098 0          
#> 8 eas       East Asian                     0   39610 0          
#> 9 afr       African / African-American     0   33426 0          
#> 
# }