Skip to contents

Pure. Takes an already-parsed response body and never touches the network.

Usage

gnomad_parse_constraint(body, symbol = NA_character_)

Arguments

body

A parsed gnomAD GraphQL response body.

symbol

The gene symbol that was queried.

Value

A one-row tibble with symbol, pli, loeuf, oe_lof, oe_mis, mis_z, syn_z, and lof_z. NULL when the gene has no constraint block, which is common and is an answer rather than a fault.

Details

loeuf is gnomAD's oe_lof_upper. The two names are the same number, and the field is called oe_lof_upper in the API but LOEUF everywhere else, including in the ranking models that consume it. Both names appear here so a reader of either can find it.

Examples

body <- list(data = list(gene = list(
  gnomad_constraint = list(pli = 1, oe_lof_upper = 0.23)
)))
gnomad_parse_constraint(body, "BRAF")
#> # A tibble: 1 × 8
#>   symbol   pli loeuf oe_lof oe_mis mis_z syn_z lof_z
#>   <chr>  <dbl> <dbl>  <dbl>  <dbl> <dbl> <dbl> <dbl>
#> 1 BRAF       1  0.23     NA     NA    NA    NA    NA