gt2num: Convert VCF GT fields to numeric format

Description Usage Arguments Details Value See Also

View source: R/gt2num.R

Description

Convert VCF GT fields to numeric format

Usage

1
gt2num(genomat)

Arguments

genomat

A matrix of VCF-style genotype calls, with SNPs in rows, and samples/individuals in columns

Details

This function will convert a matrix of genotype calls from a VCF file into numeric format. It will convert homozygous reference allele calls to 0, heterozygous calls to 1, and homozygous alternate allele calls to 2. Note that the output IS NOT necessarily in minor-allele dosage format. See ?flip_alleles for more details. Loci with more than two alleles will be removed and reported. An input matrix of the required format can be generated with vcfR::extract.gt(), with bcftools query, or manually in R.

Value

A list containing the following elements:

See Also

flip_alleles


etnite/bwardr documentation built on April 14, 2021, 7:04 p.m.