Learn R Programming

pophelper (version 1.2.0)

analyseRuns: Analyse STRUCTURE, TESS or MATRIX runs. Wrapper around several smaller functions.

Description

A single function to analyse STRUCTURE, TESS or MATRIX runs. Performs tabulate, summarise, evanno method, clumpp export, plots runs and converts runs to an R object.

Usage

analyseRuns(files = NULL, evannoMethod = TRUE, clumppExport = TRUE,
  plotRuns = TRUE, runsToDf = TRUE, imgoutput = "sep", poplab = NA,
  popcol = NA, writetable = TRUE, sorttable = TRUE, quiet = FALSE)

Arguments

files

A character or character vector of one or more STRUCTURE, TESS or MATRIX run files

evannoMethod

A logical indicating if evanno method should be performed. Applies only to STRUCTURE runs.

clumppExport

A logical indicating if files must be exported for clumpp.

plotRuns

A logical indicating if selected files should be exported as barplots.

runsToDf

A logical indicating if selected files should be converted and returned as an R object (dataframe or a list).

imgoutput

A character indicating if files are plotted as separate image files ("sep") or joined into a single image ("join").

poplab

A character vector of population labels equal to length of individuals. Each pop name must repeat to the number of individuals present in each pop.

popcol

A character vector of colours (representing populations) for colouring clusters. If NA, colours are automatically generated. K 1 to 12 are custom unique colours while K>12 are coloured by function rich.color().

writetable

A logical T or F. Setting to TRUE writes the output table to the working directory.

sorttable

A logical indicating if the output table must be sorted. Sorts table by loci, ind and K when available.

quiet

A logical indicating if messages must be printed

Value

If a single file is selected, a single dataframe is returned. If multiple files are selected, a list with multiple dataframes is returned.

Details

The function analyseRuns is a wrapper around several other pophelper functions. All arguments for all these other functions are not available. If more arguments/options are required, consider running the functions separately.

Examples

Run this code
# NOT RUN {
#structure files
slist <- list.files(path=system.file("files/structure",package="pophelper"),full.names=TRUE)
analyseRuns(slist)

#tess files
tlist <- list.files(path=system.file("files/tess",package="pophelper"),full.names=TRUE)
analyseRuns(tlist)

#admixture files
alist <- list.files(path=system.file("files/admixture",package="pophelper"),full.names=TRUE)
analyseRuns(alist)
# }

Run the code above in your browser using DataLab