Skip to contents

Output-only convenience: parses variant IDs and re-emits them in a single format. By default produces the canonical format ("chr{N}:{pos}:{A2}:{A1}"); pass a convention to preserve the input format instead.

Usage

normalizeVariantId(ids, chrPrefix = TRUE, convention = NULL)

Arguments

ids

A character vector of variant IDs in any supported format.

chrPrefix

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

convention

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

Value

A character vector of re-formatted variant IDs. Unparseable ids (e.g. rsIDs) are returned unchanged.

Details

This normalizes only the textual format (chr prefix and field separators); it does NOT reorder alleles, so it is not a matching/identity operation – two records that differ by a ref/alt swap remain distinct strings. For identity, match on the (chrom, pos, ref, alt) tuple via the variant matcher; use this only for display, file output, or relabeling for name-based downstream consumers.