make.spacemix.map: Plots the output of a SpaceMix analysis

View source: R/space.mix.MCMC.R

make.spacemix.mapR Documentation

Plots the output of a SpaceMix analysis

Description

This function plots the output of a SpaceMix analysis. Users can specify whether they wish to also visualize the names of the samples, the credible ellipses of estimated sample geogenetic and admixture source location coordinates, as well as whether they wish to visualize the sources of admixture at all.

Usage

make.spacemix.map(spacemix.map.list, text = FALSE, ellipses = TRUE,
  source.option = TRUE, xlim = NULL, ylim = NULL)

Arguments

spacemix.map.list

This is the name of the list produced using the function make.spacemix.map.list. This list should already be loaded into R's working memory.

text

This option (TRUE or FALSE) specifies whether sample names should be printed on the plotted figure at the locations of the MAP parameter estimates for each sample's geogenetic location and that of its admixture source location.

ellipses

This option (TRUE or FALSE) specifies whether bivariate credible interval ellipses should be plotted for sample geogenetic locations and admixture source locations.

source.option

This option (TRUE or FALSE) specifies whether the sources of admixture for each sample will be plotted, with accompanying admixture arrows.

xlim

This vector of length 2 gives the minimum and maximum x-value of the plotting window. Default is NULL, in which case the xlim used will be the minimum and maximum credible ellipse x-coordinates.

ylim

This vector of length 2 gives the minimum and maximum y-value of the plotting window. Default is NULL, in which case the xlim used will be the minimum and maximum credible ellipse y-coordinates.

Value

This function plots the output of a SpaceMix analysis. If specified, sample names are plotted at the MAP estimates of their geogenetic and admixture source locations. Ellipses with solid margins denote credible intervals on the posterior distributions of sample geogenetic locations, while those with dashed margins denote credible intervals on the posterior distributions of sample admixture source locations. The source.option specifies whether admixture source locations are drawn, as well as whether admixture arrows are drawn. Admixture arrows are drawn from a source of admixture to its target. The opacity of the admixture arrows (and credible ellipses on admixture source locations) is proportional to the amount of admixture drawn (i.e., samples with more admixture have darker arrows and ellipses). The return value of this function is invisible.

Examples


#load example spacemix.map.list object
data(example.spacemix.map.list)

#make SpaceMix output map
#	without plotting admixture sources, and with sample names plotted
make.spacemix.map(example.spacemix.map.list,source=FALSE,text=TRUE)


gbradburd/SpaceMix documentation built on Oct. 19, 2022, 12:43 p.m.