The FSTruct R package provides an Fst-based tool to compare the variability of Q matrices (matrices with rows of ancestry coefficients, the default output of population structure inference programs such a STRUCTURE and ADMIXTURE).
The package includes four functions:
Q_statcalculates Fst/Fst^max (a normalized measure of variability) for a Q matrix.Q_bootstrapgenerates bootstrap replicates of one or more Q matrices along with associated statistics, including Fst/Fst^max, as well as statistical tests to compare bootstrap distributions of Fst/Fst^max .Q_plotplots Q matrices usingggplot2.Q_simulategenerates one or more Q matrices using the Dirichlet distribution.
This package accompanies the paper “FSTruct: an FST-based tool for measuring ancestry variation in inference of population structure” by Maike Morrison, Nicolas Alcala, and Noah Rosenberg. You can access the paper in Molecular Ecology Resources at this link. Q matrix files for data examples that appeared in this paper are available on this GitHub repository, as well.
You can install this package from GitHub with the following R code:
# install.packages("devtools")
devtools::install_github("MaikeMorrison/FSTruct")If you have not used R before: Install
R (not optional) and
RStudio (optional). In the
R or RStudio console, paste install.packages("devtools") and hit enter
to run. Next run
devtools::install_github("MaikeMorrison/FSTruct", dependenceies = TRUE)
to install FSTruct. Then see the introductory
vignette for details on
how to use this package.
For a step-by-step guide to this package, read the introductory vignette.
For details on the functions and their usage, read the FSTruct manual.