If you are an R first time user, please download and install R (and RStudio) in your computer.
Download and install R from CRAN https://cran.r-project.org/
Download and install RStudio from https://www.rstudio.com/
Once you have R/RStudio installed, you can enter the following command in R console to install the package from CRAN.
install.packages("assignPOP")
Or, install via Github site (which requires the package devtools
pre-installed).
install.packages("devtools")
library(devtools)
install_github("alexkychen/assignPOP")
Note: When you install the package via Github, you may need to install additional packages before the assignPOP can be successfully installed. Follow the hints that R provides and then re-run install_github("alexkychen/assignPOP")
.
library(assignPOP)
####The assignPOP package includes the following functions.####
Function | Return | Description |
---|---|---|
read.Genepop() |
A list object including data matrix | Read genetic data in GENEPOP format |
read.Structure() |
A list object including data matrix | Read genetic data in STRUCTURE format |
reduce.allele() |
A list object including data matrix | Reduce low variance loci |
compile.data() |
A list object including data matrix | Concatenate genetic and non-genetic data |
assign.MC() |
Output results in text files | Perform population assignment using Monte-Carlo cross-validation |
assign.kfold() |
Output results in text files | Perform population assignment using K-fold cross-validation |
assign.X() |
Output results in text files | Assign unknown individuals to source populations |
accuracy.MC() |
A data frame and text file | Calculate assignment accuracy from Monte-Carlo cross-validation results |
accuracy.kfold() |
A data frame and text file | Calculate assignment accuracy from K-fold cross-validation results |
accuracy.plot() |
ggplot2 graph | Make assignment accuracy box plots |
membership.plot() |
ggplot2 graph | Make membership probability stacked bar plots |
assign.matrix() |
Contingency tables | Print mean and standard deviation across assignment tests |
check.loci() |
Output results in a text file | Identify informative loci used in resampling cross-validation |
Enter ?
followed by a function name in R console (e.g.,?read.Genepop
) to see the help page.