Turn the colocated variants of a VEP element into a table row
Source:R/vep.R
vep_parse_colocated.RdPure. A VEP element lists the known variants at the same site under
colocated_variants: the dbSNP record, and COSMIC and HGMD entries beside
it. The dbSNP record is the one carrying population frequencies and
clinical significance, so that is the record read. When several dbSNP
records are listed, the one with frequencies wins.
Value
A one-row tibble of rsid, gnomadg_af, gnomade_af,
gnomadg_af_max, gnomade_af_max, and clin_sig, all NA when the
element has no dbSNP record.
Details
Frequencies are only present when af, af_gnomade or af_gnomadg was
requested, see vep_default_options(). gnomadg_af_max and
gnomade_af_max are the largest per-population frequency of that source,
which is what a rarity filter wants rather than the overall frequency.
clin_sig is the significance of the element's own allele where VEP
reports it per allele, so the alleles of a multi-allelic site do not share
one answer.
References
McLaren et al. (2016). The Ensembl Variant Effect Predictor. Genome Biology 17, 122. doi:10.1186/s13059-016-0974-4
Service documentation: https://rest.ensembl.org/
Examples
element <- list(
allele_string = "G/C",
colocated_variants = list(list(
id = "rs1042522",
frequencies = list(C = list(gnomadg = 0.62, gnomadg_afr = 0.38)),
clin_sig = list("benign")
))
)
vep_parse_colocated(element)
#> # A tibble: 1 × 6
#> rsid gnomadg_af gnomade_af gnomadg_af_max gnomade_af_max clin_sig
#> <chr> <dbl> <dbl> <dbl> <dbl> <chr>
#> 1 rs1042522 0.62 NA 0.38 NA benign