# NOT RUN {
data(Pinf) # Load P. infestans data.
private_alleles(Pinf)
# }
# NOT RUN {
# Analyze private alleles based on the country of interest:
private_alleles(Pinf, alleles ~ Country)
# Number of observed alleles per locus
private_alleles(Pinf, locus ~ Country, count.alleles = TRUE)
# Get raw number of private alleles per locus.
(pal <- private_alleles(Pinf, locus ~ Country, count.alleles = FALSE))
# Get percentages.
sweep(pal, 2, nAll(Pinf)[colnames(pal)], FUN = "/")
# An example of how these data can be displayed.
library("ggplot2")
Pinfpriv <- private_alleles(Pinf, report = "data.frame")
ggplot(Pinfpriv) + geom_tile(aes(x = population, y = allele, fill = count))
# }
Run the code above in your browser using DataLab