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_stat
calculates Fst/Fst^max (a normalized measure of
variability) for a Q matrix.Q_bootstrap
generates 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_plot
plots Q matrices using ggplot2
.Q_simulate
generates 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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.