inbreedR (version 0.3.0)

convert_raw: Genotype format converter

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

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) f

Value

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

Examples

Run this code
# Mouse microsatellite data with missing values coded as NA
data(mouse_msats)
genotypes <- convert_raw(mouse_msats)
head(genotypes)

Run the code above in your browser using DataCamp Workspace