thibautjombart / adegenet

adegenet: a R package for the multivariate analysis of genetic markers
169 stars 64 forks source link

PCA result of glPca is quite different from plink #327

Open cpwater opened 2 years ago

cpwater commented 2 years ago

I tried to plot PCA result of glPca in adegenet and found that the result is quite different from that generated from plink. Anybody knows why?

For glPca, I ran this in R pca_gl <- glPca(glFile_rmNA, useC = T, nf = 30) scatter(pca_gl, clabel = 0)

And for plink, I ran this plink --allow-extra-chr --threads 20 -bfile Call.vcf --pca 30 --out pca_plink and the plot used PC1 and PC2 of the result.

Thanks so much and this is important to me!

glPca_raw plink_raw

zkamvar commented 2 years ago

I'm not familiar with how plink works. It might have to do with centering, scaling, or whether the genotypes or haplotypes are used as individual units.