Skip to contents

Converts variant IDs from any supported string format or data.frame into a standardized data.frame with integer chrom, integer pos, and character allele columns (A2, A1). Supports colon-separated ("chr1:100:A:G"), underscore-separated ("1_100_A_G"), with or without "chr" prefix, and with optional build suffix (":b38" or "_b38"). The detected input convention is stored as an attribute.

Usage

parse_variant_id(ids)

Arguments

ids

A character vector of variant IDs, or a data.frame with columns "chrom", "pos", and allele columns (A2/A1 or ref/alt or any 4-column layout).

Value

A data.frame with columns "chrom" (integer), "pos" (integer), "A2" (character), "A1" (character). The detected convention is stored as attr(result, "convention").