Skip to contents

Pure. MyVariant indexes variants by an HGVS g. string, so a caller holding chromosome, position, ref and alt needs this to ask about one.

Usage

myvariant_id(chrom, pos, ref, alt)

Arguments

chrom

A chromosome, with or without a chr prefix.

pos

A 1-based position.

ref, alt

Reference and alternate alleles.

Value

A single string.

This is not variant identity

This formats a variant the way one service wants it written. It is not a canonical variant key and it does not normalize anything. The canonical key is (assembly, chromosome, position, ref, alt), and turning arbitrary input into one is vcfcanon's job, not this package's.

Examples

myvariant_id("17", 7676154, "G", "C")
#> [1] "chr17:g.7676154G>C"
myvariant_id("chr1", 100, "AT", "A")
#> [1] "chr1:g.101_101del"