This function is primarily intended for use within getXlist
, and fills in the design matrices of the model with the genetic likelihoods.
1  fillX.G(X.list, A, G, E1=0.005, E2=0.005, marker.type="MSW")

X.list 
list of design matrices for each offspring derived using 
A 
list of allele frequencies 
G 
list of genotype objects; rows must correspond to individuals in the vector 
E1 
if Wang's (2004) model of genotyping error for codominant markers is used this is the probability of an allele dropping out. If CERVUS's (Kalinowski, 2006; Marshall, 1998) model of genotyping error for codominant markers is used this parameter is not used. If Hadfield's (2009) model of genotyping error for dominant markers is used this is the probability of a dominant allele being scored as a recessive allele. 
E2 
if Wang's (2004) or CERVUS's (Kalinowski, 2006; Marshall, 1998) model of genotyping error for codominant markers are used this is the probability of an allele being missscored. In the CERVUS model errors are not independent for the two alleles within a genotype and so if a genotyping error has occurred at one allele then a genotyping error occurs at the other allele with probability one. Accordingly, 
marker.type 

list of design matrices of the form X.list
containing genetic likelihoods for each offspring.
If a GdataPed
object is passed to getXlist
then the genetic likelihoods will be calculated by default.
Jarrod Hadfield j.hadfield@ed.ac.uk
Marshall, T. C. et al (1998) Molecular Ecology 7 5 639655 Kalinowski S.T. et al (2007) Molecular Ecology 16 5 10991106 Hadfield J. D. et al (2009) in prep
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38  ## Not run:
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
## End(Not run)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.