legalG | R Documentation |
A function for checking whether a set of genotypes have a positive probability given the pedigree. If not, a legal configuration is found using heuristic methods. Missing genotypes are also replaced with compatible genotypes.
legalG(G, A, ped, time_born=NULL, marker.type="MSW")
G |
list of |
A |
list of allele frequencies |
ped |
pedigree with id in the first column, dam in the second, and sire in the third. The genotypes must be in the same order as the id column |
time_born |
an optional vector for ordering a pedigree more efficiently (see |
marker.type |
|
G |
a list of |
legal |
logical; TRUE if the the genotype configuration passed to |
Jarrod Hadfield j.hadfield@ed.ac.uk
Marshall, T. C. et al (1998) Molecular Ecology 7 5 639-655 Kalinowski S.T. et al (2007) Molecular Ecology 16 5 1099-1106 Hadfield J. D. et al (2009) in prep
MCMCped
## Not run: data(WarblerG) A<-extractA(WarblerG[,16:17]) pedigree<-matrix(NA, 8,3) pedigree[,1]<-1:8 pedigree[,2][5:8]<-c(1,1,2,2) pedigree[,3][5:8]<-c(3,3,4,4) G<-simgenotypes(A, E1=0, E2=0.3, ped=pedigree, no_dup=1) newG<-legalG(G=G$Gobs,A=A,ped=pedigree) newG$valid # The input genotypes had a zero probability given the pedigree # (because of genotype error) but the output genotypes have # positive probability legalG(newG$G,A,pedigree)$valid ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.