I previously posted on how to
infer ancestry for a group of study participants using SNP genotypes. Today, I want to visually plot some of the output in R. Two informative plots that can be generated from the output are a standard plot of the two eigenvectors with percent ancestry overlaid and a triangle (or
ternary) plot with each axis representing percentage of one of the three ancestral populations (ex: European, African, and Asian).
Here is some simple code to plot this in R. There is no base package to plot the triangle plot, so the
plotrix package will need to first be
installed. The
ancestry.txt file is the output file from
SNPWEIGHTS, but other output could be formatted to work as well.
The output should look similar to the plots below.