Description Usage Arguments Author(s) See Also Examples
Plots offspring and parental admiture proportions in the style of STRUCTURE, the popular population genetic software.
1 | LEAPFrOG_plot(Results,PopNames,SampNames=NULL)
|
Results |
Array of dimensions 3*Npopulations*Noffspring. The first row is for the genotyped offspring and the second two for the unobserved parents. Each cell contains an admixture proportion. |
PopNames |
Character vector of length J (number of reference populations), Eg. c("Africa","Asia","Europe"). Order of names should correspond with order of parameters in Results. |
SampNames |
Character vector of sample names, equal to number of rows in Results, or NULL (detault), which will be printed underneath the admixture bars. Most useful when dealing with a small number of samples with distinct identity e.g. c("Hair","Blood","Door Handle","Ballroom","Lead Piping"). If NULL then no labels are printed beneath the plot (more appropriate for simulations or large population samples) |
Daniel Crouch & Michael Weale, Department of Medical and Molecular Genetics, King's College London
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #Example with nonsense data -
#10000 random SNP genotypes
#...and uniform, random allele frequencies from two populations.
library(LEAPFrOG)
#Get LEAPFrOG parameter estimates for 10 simulated individuals
Results=array(dim=c(3,2,10))
for(i in 1:10){
z1=LEAPFrOG(sample(0:2,10000,replace=TRUE),cbind(runif(10000,0,1),runif(10000,0,1)))
Results[1,,i]=z1$m #Offspring
Results[2,,i]=z1$P1 #Parent 'A'
Results[3,,i]=z1$P2 #Parent 'B
}
#Now plot these 10 individuals
LEAPFrOG_plot(Results,PopNames=c("PopA","PopB"))
#With sample names:
names=c("Hair","Blood","Door Handle","Ballroom","Lead Piping")
names=c(names,"Briefcase","Toothbrush","Sock","Shirt","Skin")
LEAPFrOG_plot(Results,PopNames=c("PopA","PopB"),SampNames=names)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.