dot-label_gt: 'label_gt' for changing genotypes in alleles format to labels

.label_gtR Documentation

'label_gt' for changing genotypes in alleles format to labels

Description

It turns a vector of Genotypes to a vector of Labels consist of 'Homo_ref', 'Homo_alt', and 'Het' given the known genotypes for reference and alternative strains.

Usage

.label_gt(s_gt, ref, alt, failed = "Fail")

Arguments

s_gt

s_gt, a vector of genotypes for one sample across markers

ref

ref, a vector of genotypes for reference strain across markers

alt

alt, a vector of genotypes for alternative strain across markers

failed

what was used for encoding failed genotype calling such as "Fail" in example

Details

This function takes the a sample's genotype across each SNP marker in alleles and compare with genotypes of in-bred reference and alternative strains to. If the sample's genotype for a particular SNP marker is the same with the reference strain, it is labelled as Homo_ref homogeneous reference for a particular SNP marker; if the sample's genotype is the same with the alternative strain it is labelled as Homo_alt homogeneous alternative for a particular SNP marker; if the sample's genotype is heterozygous then it is labeled as Het heterozygous for this particular genotypes. If it does not fall in any of the three cases, it is labelled as the string specified by the argument 'missing'.

Note that the wrong/failed genotype is labelled as the string in 'missing' after this function. If there is a different label for failed genotype, provide the label using the 'missing' argument.

Value

a vector of labels Homo_ref, Homo_alt, Het indicating the progeny's genotypes across markers

Author(s)

Ruqian Lyu


ruqianl/comapr documentation built on Oct. 27, 2023, 5:12 a.m.