createDatamatrix: Create data matrix with possible genotype combinations for...

View source: R/createDatamatrix.R

createDatamatrixR Documentation

Create data matrix with possible genotype combinations for specified individuals

Description

A data matrix of genotypes for known individuals and all possible genotypes for unknown individuals is created.

Usage

createDatamatrix(locus, knownGenos, idsU = NULL)

Arguments

locus

A Familias locus containing information about the alleles

knownGenos

List of known genotypes. Each element is a vector with genotype for one individual. The elements must be named

idsU

Vector of indices for unknown individuals

Value

A data matrix of genotypes where each row corresponds to an individual.

Author(s)

Guro Dorum

See Also

Familias::FamiliasLocus and relMix.

Examples

#Define alleles and frequencies
alleles <- 1:2
afreq <- c(0.5,0.5)
#Create locus object
locus <- Familias::FamiliasLocus(frequencies=afreq,name="M1",allelenames= alleles)
#Known genotypes of alleged father and mother, child's genotype is uknown
gAF <- c(1,1)
gMO <- c(1,1)
datamatrix <- createDatamatrix(locus,knownGenos=list(AF=gAF,MO=gMO),idsU=c("CH"))

gdorum/relMix documentation built on April 17, 2024, 8:49 p.m.