Plot an ancestry matrix for individuals and(or) populations.
Source:R/Ancestry_barchart.R
Ancestry_barchart.Rd
Plot an ancestry matrix for individuals and(or) populations.
Usage
Ancestry_barchart(
anc.mat,
pops,
K,
plot.type = "all",
col,
ind.order = NULL,
pop.order = NULL
)
Arguments
- anc.mat
Data frame or character string that supplies the input data. If it is a character string, the file should be a csv. The first column should be the names of each sample/population, followed by the estimated contribution of each cluster to that individual/pop.
- pops
Data frame or character string that supplies the input data. If it is a character string, the file should be a csv. The columns should be named Sample, containing the sample IDs; Population indicating the population assignment of the individual, population and sample names must be the same type (i.e., both numeric or both characters); Long, indicating the longitude of the sample; Lat, indicating the latitude of the sample.
- K
Numeric.The number of genetic clusters in your data set, please contact the package authors if you need help doing this.
- plot.type
Character string. Options are all, individual, and population. All is default and recommended, this will plot a barchart for both the individuals and populations.
- col
Character vector indicating the colors you wish to use for plotting.
- ind.order
Character vector indicating the order to plot the individuals in the individual ancestry bar chart.
- pop.order
Chracter vector indicating the order to plot the populations in the population ancesyry bar chart.