fillX.G {MasterBayes}R Documentation

Mendelian Transition Probalities

Description

This function is primarily intended for use within getXlist, and fills in the design matrices of the model with the genetic likelihoods. The model of genotyping error is taken from CERVUS (Kalinowski, 2006; Marshall, 1998).

Usage

fillX.G(X.list, A, G, E2=0.005)

Arguments

X.list list of design matrices for each offspring derived using getXlist
A list of allele frequencies
G list of genotype objects; rows must correspond to individuals in the vector X.list$id
E2 per-allele genotyping error rate. E2(2-E2) is the per-genotype rate defined in Kalinowski (2006)
... further arguments to be passed

Value

list of design matrices of the form X.list containing genetic likelihoods for each offspring.

Note

If a GdataPed object is passed to getXlist then the genetic likelihoods will be calculated by default.

Author(s)

Jarrod Hadfield j.hadfield@sheffield.ac.uk

References

Kalinowski S.T. et al (2006) Molecular Ecology in press

See Also

getXlist

Examples

data(WarblerG)
A<-extractA(WarblerG)

ped<-matrix(NA, 5,3)
ped[,1]<-1:5
ped[,2]<-c(rep(NA, 4), 1)
ped[,3]<-c(rep(NA, 4), 2)

genotypes<-simgenotypes(A, ped=ped)

sex<-c("Female", "Male", "Female", "Male","Female")
offspring<-c(0,0,0,0,1)

data<-data.frame(id=ped[,1], sex, offspring)

res1<-expression(varPed(x="offspring", restrict=0))

PdP<-PdataPed(formula=list(res1), data=data)
GdP<-GdataPed(G=genotypes$Gobs, id=genotypes$id)

X.list<-getXlist(PdP)
# creates design matrices for offspring (in this case indivdiual "5")

X.list.G<-fillX.G(X.list, A=A, G=genotypes$Gobs, E2=0.005)
# genetic likelihoods are arranged sires within dams 

X.list.G$X$"5"$dam.id
X.list.G$X$"5"$sire.id

# so for this example we have parental combinations 
# ("1","2"), ("1","4"), ("3","2"), ("2","4"):

X.list.G$X$"5"$G

# The true parents have the highest likelihood in this case


[Package MasterBayes version 1.0 Index]