Skip to contents

Flags each variant by the homopolymer region in which its position falls, based on predefined mitochondrial homopolymer intervals.

Usage

annotate_variants_homopolymer(variant_annotation)

Arguments

variant_annotation

A data.frame or tibble containing at least a column named Variants, where each entry is of the form "<pos>_<ref>_<alt>".

Value

The input variant_annotation with an added column:

homopolymer

Character; the label of the homopolymer region (from mito_homopolymer\$V4) containing the variant position, or NA if none.

Details

The function loads the mito_homopolymer data frame, which must contain columns V2 (start), V3 (end), and V4 (region label). For each variant position, it finds the first homopolymer interval that contains that position and assigns its label; otherwise, NA.