convert_raw: Genotype format converter

Description Usage Arguments Value Author(s) Examples

View source: R/convert_raw.R

Description

Turns raw genotype data into 0 (homozygote), 1 (heterozygote) and NA (missing), which is the working format for the inbreedR functions. A raw genotype matrix has individuals in rows and each locus in two adjacent columns. Individual ID's can be rownames. Type data(mouse_msats) for an example raw genotype data frame.

Usage

1
convert_raw(genotypes)

Arguments

genotypes

Raw genotype data.frame or matrix. Rows represent individuals and each locus has two adjacent columns. Alleles within loci can be coded as numbers (e.g. microsatellite length) or characters (e.g. "A", "T") See data(mouse_msat) for an example. Missing values should be coded as NA.

Value

data.frame object with 0 (homozygote), 1 (heterozygote) and NA (missing data). Each locus is a column and each individual is a row.

Author(s)

Martin Stoffel ([email protected])

Examples

1
2
3
4
# Mouse microsatellite data with missing values coded as NA
data(mouse_msats)
genotypes <- convert_raw(mouse_msats)
head(genotypes)

inbreedR documentation built on May 1, 2019, 7:32 p.m.