gt2num | R Documentation |
Convert VCF GT fields to numeric format
gt2num(genomat)
genomat |
A matrix of VCF-style genotype calls, with SNPs in rows, and samples/individuals in columns |
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.
A list containing the following elements:
genomat Converted numeric genotype matrix
removed_loci Vector of loci removed due to having greater than two alleles
flip_alleles
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.