Description Usage Arguments Examples
Generate a barplot of a Structure or Admixture run.
1 |
x |
an object of type |
populations |
a data.frame that contains the sample number as the first column and the population as the second. |
plot |
if FALSE returns a data.frame for customised plots |
facet |
whether or not to split the barplot by cluster. This is recommended. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Read file using K = 6 and plot results
k6_data <- exampleStructure("barplot")
# Generate standard 'structure' barplot
plotBar(k6_data, facet = FALSE)
# adding group information
set.seed(212)
pops <- data.frame(id = k6_data$ancest_df[,1],
population = sample(letters[1:3], nrow(k6_data$ancest_df), replace = TRUE))
# our facetted structure plot
plotBar(k6_data, pops)
# standard 'structure' bar plot
plotBar(k6_data, pops, facet = FALSE)
#' admixture example
k3_data <- exampleAdmixture()[[3]]
plotBar(k3_data)
|
Extracting population labels from STRUCTURE output.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.