admixtureMap: Generate a pdf with interpolated admixture coefficients for...

View source: R/run_structure.R

admixtureMapR Documentation

Generate a pdf with interpolated admixture coefficients for each K Takes as input a coordinates file and one or more output files ('log_f' files) from structure, or the 'Qlog' file from run_DAPC, run_SNMF, or run_fastStructure, and generates a pdf with plots of admixture interpolated.

Description

Generate a pdf with interpolated admixture coefficients for each K

Takes as input a coordinates file and one or more output files ('log_f' files) from structure, or the 'Qlog' file from run_DAPC, run_SNMF, or run_fastStructure, and generates a pdf with plots of admixture interpolated.

Usage

admixtureMap(
  x = NULL,
  xdir = NULL,
  coords,
  labels = NULL,
  save.as = file.path(getwd(), "admixtureMaps.pdf"),
  userun = 1
)

Arguments

x

Character vector with paths to input files. Ignored if 'xdir' is non-NULL. These are either '.log_f' files generated by STRUCTURE, or a sinle '.Qlog' file generated by 'run_DAPC', 'run_fastStructure', or 'run_SNMF' functions.

xdir

Optional path to the directory containing all STRUCTURE output files plus the '.*_sampleIDs.txt' file generated by run_structure. Default NULL. If supplied, this overides save.as, labels, and x arguments.

coords

Character string with path to coordinates file

labels

Character vector with names of individuals. Default NULL. Ignored if 'xdir' non-NULL.

save.as

Character string with path/name to use for the output PDF file. Default is to save the output in the current directory with the name "admixturePlots.pdf".

userun

Number or numerical vector indicating which runs should be used for admixture plots. Default is 1 (the first run). When multiple runs are used, the mean is used across runs after aligning clusters.

Value

NULL; generates pdf with a barplot of admixture for each K

Examples

create_popfile(xdir="PATH/TO/STRUCTURE/OUTPUT",K=2)

JeffWeinell/misc.wrappers documentation built on Sept. 20, 2023, 12:42 p.m.