correctGT: correctGT

View source: R/reformat-geno-mt.R

correctGTR Documentation

correctGT

Description

function for formatting and correction genotypes of markers

Usage

correctGT(gt_matrix, ref, alt, failed = "Fail", wrong_label = "Homo_ref")

Arguments

gt_matrix

the input genotype matrix of markers by samples with rownames as marker IDs and column names as sample IDs

ref

a vector of genotypes of the inbred reference strain

alt

a vector of genotypes of the inbred alternative strain

failed

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

wrong_label

what would be considered a wrong genotype label for example Homo_ref which should not be in the possible genotypes of BC1F1 samples

Details

This function changes genotype in alleles to genotype labels, change Homo_ref to Hets/Fail, infer Failed genotype, and change "Failed" to NA for counting crossover later

This function changes genotype in alleles to labels by calling internal functions lable_gt, and changes the wrong genotype Homo_ref to Fail by calling .change_missing.

Value

a genotype data.frame of sample genotypes with dimension as the input 'gt_matrix' with genotypes converted to labels and failed calls are changed to NA.

Author(s)

Ruqian Lyu

Examples

data(snp_geno_gr)
data(parents_geno)
snp_gt_crt <- correctGT(gt_matrix = GenomicRanges::mcols(snp_geno_gr),
                      ref = parents_geno$ref,
                      alt = parents_geno$alt,
                      fail = "Fail",
                      wrong_label = "Homo_ref")

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