make.structure.plot: Make STRUCTURE output plot

View source: R/plot.output.R

make.structure.plotR Documentation

Make STRUCTURE output plot

Description

make.structure.plot makes a STRUCTURE-style plot from the output from a conStruct analysis.

Usage

make.structure.plot(
  admix.proportions,
  mar = c(2, 4, 2, 2),
  sample.order = NULL,
  layer.order = NULL,
  sample.names = NULL,
  sort.by = NULL,
  layer.colors = NULL
)

Arguments

admix.proportions

A matrix of admixture proportions, with one row per sample and one column per layer.

mar

A vector of plotting margins passed to par. Default is c(2,4,2,2), which tends to look good.

sample.order

A vector giving the order in which sample admixture proportions are to be plotted, left to right. If NULL, samples are plotted in the order they occur in admix.proportions.

layer.order

A vector giving the order in which layers are plotted, bottom to top. If NULL, layers are plotted in the order they occur in admix.proportions.

sample.names

Vector of names to be plotted under each sample's admixture proportion bar plot. The index of a sample's name should be the same as the index of the sample's row in admix.proportions. If NULL, no names are printed.

sort.by

An integer giving the column index of the admix.proportions matrix to be used in determining sample plotting order. If specified, samples are plotted from left to right in increasing order of their membership in that layer. If NULL, samples are plotted in the order they occur in admix.proportions.

layer.colors

A vector of colors to be used in plotting results for different layers. Users must specify one color per layer. If NULL, the plot will use a pre-specified vector of colors.

Details

This function takes the output from a conStruct analysis and makes a STRUCTURE-style plot, where each sample is represented as a stacked bar plot, and the length of the bar plot segments of each color represent that sample's admixture proportion in that layer.

Value

This function has only invisible return values.

Examples

	
# make STRUCTURE-style plot
	make.structure.plot(admix.proportions = admix.props)

# make STRUCTURE-style plot, sorted by membership in layer 1
make.structure.plot(admix.proportions = admix.props,sort.by=1) 


conStruct documentation built on May 29, 2024, 4:23 a.m.