Skip to contents

One-step convenience function: parses variant IDs in any supported format and re-formats them. By default, outputs the canonical format ("chr{N}:{pos}:{A2}:{A1}"). When a convention object is provided, the output preserves the user's original format automatically.

Usage

normalize_variant_id(ids, chr_prefix = TRUE, convention = NULL)

Arguments

ids

A character vector of variant IDs in any supported format.

chr_prefix

Logical, whether to include "chr" prefix. Default TRUE. Ignored if convention is provided.

convention

Optional list from detect_variant_convention or attr(parse_variant_id(ids), "convention"). When provided, the output format is driven automatically by the detected convention.

Value

A character vector of normalized variant IDs.