encode_genotype_vec {eHDPrep}R Documentation

Encode a genotype/SNP vector

Description

Standardises homozygous SNP alleles (e.g. recorded as 'A') to two character form (e.g. 'A/A') and orders heterozygous SNP alleles alphabetically (e.g. "GA" becomes "A/G"). The SNP values are then converted from a character vector to an ordered factor, ordered by SNP allele frequency (e.g. most frequent SNP allele is 1, second most frequent value is 2, and least frequent values is 3). This method embeds the numeric relationship between the SNP allele frequencies while preserving value labels.

Usage

encode_genotype_vec(x)

Arguments

x

input vector containing genotype data

Value

Ordered factor, ordered by allele frequency in variable


[Package eHDPrep version 1.3.3 Index]