gt2refalt: Two-letter genotype from VCF GT

View source: R/utils.R

gt2refaltR Documentation

Two-letter genotype from VCF GT

Description

Get a two-letter genotype from a VCF GT field. Current implementation is quick and dirty, and only accepts 0/0, 0/1, or 1/1. Any other input to gt will return a missing value.

Usage

gt2refalt(gt, ref, alt)

Arguments

gt

The genotype field (must be 0/0, 0/1, or 1/1).

ref

The reference allele.

alt

The alternate allele.

Value

Returnvalue

Examples

gt2refalt(gt="0/0", ref="R", alt="A")
gt2refalt(gt="0/1", ref="R", alt="A")
gt2refalt(gt="1/1", ref="R", alt="A")
gt2refalt(gt="0/2", ref="R", alt="A")
gt2refalt(gt="./.", ref="R", alt="A")


stephenturner/Tmisc documentation built on April 21, 2024, 8:31 a.m.