mismatches | R Documentation |
Calculates the number of mismatches between parental and offspring genotypes, assuming the genotypes of spouses are unknown. Primarily intended to be used inside the function getXlist
where potential parents can be excluded based on the number of mismatches. Dominant markers do not produce mismatches.
mismatches(X.list, G, mm.tol=999)
X.list |
list of design matrices for each offspring derived using |
G |
list of genotype objects, the rows of which must refer to the id vector |
mm.tol |
maximum number of mismatches that are tolerated before exclusion |
list of design matrices of the form X.list
, but containing the number of mismatches between parents and offspring. Potential parents that exceed the number of mismatches specified by mm.tol
are removed from the vectors of potential parents: restdam.id
and restsire.id
.
If a GdataPed
object is passed to getXlist
then the number of mismatches will be calculated by default.
Jarrod Hadfield j.hadfield@ed.ac.uk
MCMCped
## 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) X.list<-getXlist(PdP) # creates design matrices for offspring (in this case indivdiual "5") X.list.MM<-mismatches(X.list, G=genotypes$Gobs, mm.tol=0) # genetic likelihoods are arranged sires within dams X.list.MM$X$"5"$mmD # number of mismatches between offspring "5" and dams "1" and "3" X.list.MM$X$"5"$mmS # number of mismatches between offspring "5" and sires "4" and "5" X.list.MM$X$"5"$restdam.id X.list.MM$X$"5"$dam.id # dams with mismatches are excluded mismatch (mm.tol=0) X.list.MM$X$"5"$restsire.id X.list.MM$X$"5"$sire.id # sires with mismatches are excluded mismatch (mm.tol=0) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.