transform_geno: Transform genotypes

Description Usage Arguments Details Value Author(s) Examples

Description

Transform genotypes from two-letter coding to numeric coding.

Usage

1
transform_geno(geno, sep = "/", check = TRUE)

Arguments

geno

A character matrix containing the genotypes.

sep

A character string use to split the genotypes in geno.

check

Should checks be performed?

Details

A genotype must consist of a sequence of three characters, where the mittle character is the seperator as specified in sep. Recoding is performed based on the major allele at the respective locus, i.e., if for instance the major allele is "A", the recoded genotypes of "A/A", "A/B", "B/A" and "B/B" will be, 2, 1, 1, 0, given sep = "/".

Value

A numeric matrix of the same dimensions as geno containing the recoded genotypes.

Author(s)

Dominik Mueller (dominikmueller64@yahoo.de)

Examples

1
2
3
4
geno <- structure(c("A/G", "G/A", "A/A", NA, "A/A", "G/G", NA, "G/G",
                    "G/G", "A/A", "G/G", NA, "C/C", "C/C", "C/A", NA, "C/C", "C/C"),
                 .Dim = c(6L, 3L))
transform_geno(geno, sep = '/')

DominikMueller64/LDtools documentation built on May 6, 2019, 2:51 p.m.