make.spacemix.map.list: Post-processes SpaceMix output for plotting

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

make.spacemix.map.listR Documentation

Post-processes SpaceMix output for plotting

Description

This function post-processes the output of a SpaceMix analysis to create a list object that can be used or reference later for easy visualization of SpaceMix results.

Usage

make.spacemix.map.list(MCMC.output.file, geographic.locations, name.vector,
  color.vector, quantile = 0.95, burnin = 0)

Arguments

MCMC.output.file

This is the full path, given as a character argument (i.e., in quotes), of the MCMC_output R object generated by a SpaceMix analysis.

geographic.locations

This is a k x 2 matrix in which the ith row gives the geographic coordinates (i.e., longitude and latitude) of the ith sample.

name.vector

This is a character vector of length k in which each element gives the name of the corresponding sample.

color.vector

This is a vector of colors of length k in which each element gives the color in which the corresponding sample should be plotted.

quantile

This value determines the size of the credible interval calculated for model parameters. A value of 0.95 denotes the 95% credible interval.

burnin

This value determines how many sampled iterations of the MCMC to discard as ‘burn-in.’ A value of 200 means that the first 200 sampled iterations of the MCMC will be discarded when calculating credible intervals.

Value

This function returns a list that can be used for plotting and visualization of SpaceMix output. The components of this list are:

  • MCMC.output - This is a list of the output of the SpaceMix analysis, containing all the elements of the output .Robj file.

  • geographic.locations - This is a k x 2 matrix in which the ith row gives the geographic coordinates (i.e., longitude and latitude) of the ith sample.

  • name.vector - This is a character vector of length k in which each element gives the name of the corresponding sample.

  • color.vector - This is a vector of colors of length k in which each element gives the color in which the corresponding sample should be plotted.

  • quantile - This value determines the size of the credible interval calculated for model parameters.

  • best.iter - This is the index of the sampled MCMC iteration with the largest posterior probability. We refer to parameter estimates in that iteration as the maximum a posteriori (MAP) estimates.

  • admix.source.color.vector - This is a vector of faded colors (the same as given in color.vector), for which the extent of fading is determined by the admixture proportion. These colors, for which the opacity is proportional to the estimated admixture proportion, are used in plotting the admixture sources and admixture arrows.

  • k - This is the number of samples in the analysis.

  • MAPP.geogen.coords - This is the Procrustes-transformed MAP geogenetic location coordinates.

  • MAPP.admix.source.coords - This is the Procrustes-transformed MAP admixture source location coordinates.

  • procrustes.coord.posterior.lists - This is a list of the Procrustes-transformed location parameter coordinates.

    • geogen.coords.list - A list of length N, where I is the number of sampled MCMC iterations. The ith element of the list contains the Procrustes- transformed geogenetic location coordinates in the ith sampled iteration of the MCMC. As a whole, this list represents the posterior distribution of geogenetic location parameters for all samples.

    • admix.source.coords.list - A list of length N, where I is the number of sampled MCMC iterations. The ith element of the list contains the Procrustes- transformed admixture source location coordinates in the ith sampled iteration of the MCMC. As a whole, this list represents the posterior distribution of admixture source location parameters for all samples.

  • pp.geogen.location.matrices - A list of length k in which the ith element is the Procrustes- transformed posterior distribution of geogenetic location coordinates for the ith sample.

  • pp.admix.source.location.matrices - A list of length k in which the ith element is the Procrustes- transformed posterior distribution of admixture source location coordinates for the ith sample.

  • pp.geogen.ellipses - A list of length k in which the ith element gives the boundaries of the 95% credible ellipse of the Procrustes-transformed posterior distribution of geogenetic location coordinates of the ith sample.

  • pp.admix.source.ellipses - A list of length k in which the ith element gives the boundaries of the 95% credible ellipse of the Procrustes-transformed posterior distribution of admixture source location coordinates of the ith sample.


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