This is a test version of Biostars. For the public version, visit https://www.biostars.org.
getting unlinked variants and PCA analysis

We have a Vcf file containing the variants from a haploid species. We need to carry out PCA analysis on these variants but most are linked. How can we select a set of unlinked variants? PLINK is set up to do on diploid genotypes. How does one work with haploid genotypes if one uses PLINK?

phylogeny pca plink

Added a plink tag so that those watching that tag may pick this up

1 answer

PLINK's --indep-pairwise command for selecting approximately-unlinked variants should have no problem with haploid data. However, you'll want to perform the actual PCA with another script/tool, since the variance-normalized similarity formula used by PLINK --pca only works properly for diploid data.

(Edit: on second thought, dividing the eigenvalues by 2 at the end should be enough to correct for the haploid/diploid variance difference.)

Thanks a lot, It seems as though it would be better to use another tool for the PCA would you be able to suggest the easiest to use?

Chris; I think one needs to divide through by 4 since the variance-covariance matrix will be inflated by 4 since the individuals with the snps are coded by 2 rather than 1.

No, because --pca uses variance-standardized genotype values.

Meanwhile, plink 2.0 --pca should correct the eigenvalues for you.

I have run all of the commands in the pca pipeline and it all runs beautifully and gives what look like excellent results. I get the same results with or without the --chr-set -3 flag however and I am unsure what is going on. I have looked through all of the output files and am not sure whether it has correctly taken into account ploidy. Is there a way that I could check that my output is not corrupted? Is there a small diploid vcf around that I could use to check what has gone on? Thanks

Log in to answer this question.