I'm curious how a PCA for population structure is built from an alignment/BAM or SAM file. How do programs like angsd and ngsCovar actually build a PCA? What exactly makes things come out as different and how can this be determined? If I have 3 alignments that look like this:
>Indiv1 ACGT >Indiv2 ACGC >Indiv3 ACGA
>Indiv1 GACT >Indiv2 GACA >Indiv3 GAGT
>Indiv1 GGTC >Indiv2 GGCT >Indiv3 GCTA
(These example alignments leave out quality scores for simplicity, assume that each has high quality across the board.)
What algorithm or system would be used to graph them on a PCA? How many dimensions would that PCA have? Is it possible to model this by hand so that I can understand what's going on/how it is built?