PCA projection

338 views
Skip to first unread message

Matthew Maher

unread,
Apr 12, 2023, 4:08:22 PM4/12/23
to plink2-users
I just used PLINK2 for PCA + PCA-projection and I got everything working just right, but I had a bit of confusion at one point, which prompts a question/comment.   The documentation discussion of PCA-projection (which provides a very good example of the steps), ends with this:

"Note that these PCs will be scaled a bit differently from ref_data.eigenvec; you need to multiply or divide the PCs by a multiple of sqrt(eigenvalue) to put them on the same scale."

That seemed a bit ambiguous and I was somewhat confused, but I found in this PLINK discussion thread one user proposing: computedPC=projectedPC/(-sqrt(eigenvalue)/2) as the necessary adjustment.  Christopher responded that "Something like that always works, yes". 

So I coded up that adjustment and sure enough it does the trick and I have projections onto the same scale as the original reference set, so everything is good.

But I wonder: does the documentation not specify this formula because there are other possible adjustments one might do?  (Christopher's "something like that" also seems to suggest as much).  I'm no PCA expert.

If that formula really is the necessary final step for PCA projection, then perhaps it should be inserted in the documentation. 

And for the longer-term wish-list, perhaps --score could have a sibling option like --eigen-adjust <file> where the eigenval file created in the prior step could be supplied, and PLINK2 would then make that scaling adjustment?  (this might also require a change in column headings to remove the "_AVG" suffixes).   I think that would really complete a wonderful end-to-end bit of PLINK2 functionality. 

Thanks for any feedback and thanks for PLINK*.

Christopher Chang

unread,
Apr 17, 2023, 10:13:08 AM4/17/23
to plink2-users
IIRC, this formula isn't exactly correct when multiallelic variants are present.  So it is safer to just compare apples to apples than to try to convert from one scale to the other.
Reply all
Reply to author
Forward
0 new messages