ras_read_variant_dictionary: Read a Variant Dictionary for Summary-Statistics...

View source: R/sumstats.R

ras_read_variant_dictionaryR Documentation

Read a Variant Dictionary for Summary-Statistics Harmonisation

Description

Reads a table mapping rsID to (chromosome, position, REF, ALT) on ONE genome build, for use by ras_harmonize_sumstats's dictionary route and by ras_map_ids_to_rsid. Sources include a dbSNP slice, the All of Us Variant Annotation Table, or any delimited file with those columns.

Usage

ras_read_variant_dictionary(src, cols = list(), build = NA_character_)

Arguments

src

data.frame, or a path to a delimited file / VCF.

cols

Optional named overrides for the auto-detected columns, e.g. list(rsid = "dbsnp_rsid"). Names are rsid, chr, pos, ref, alt.

build

Free-text label recorded on the result for provenance, e.g. "GRCh38". Never inferred and never acted upon – it is an audit note, while the build gate does the actual checking.

Details

A plain VCF is accepted: lines beginning ## are skipped and #CHROM is used as the header. An ALT field carrying several comma-separated alleles is expanded to one row per alternate allele, so multi-allelic sites resolve by their alleles rather than by row order.

Value

A data frame with columns RSID, CHR, BP, REF, ALT, KEY (the unordered allele-pair key), with the build label attached as an attribute.

See Also

ras_harmonize_sumstats, ras_map_ids_to_rsid


RAS documentation built on Nov. 3, 2026, 1:07 a.m.