Question: Using previously calculated PCs in GENESIS
0
12 months ago by
University of Washington
Stephanie M. Gogarten680 wrote:

This question was sent by email:

I am using the GENESIS package, and I have a question regarding the usage of pcair function.

Is there a way to load previously calculated PC values onto pcair function and then use these values to predict PC values for a new set of samples. I know that pcair normally works like when you specify related and unrelated set. But since I already got the PC values from the reference set, I do not want to run everything  from scratch.

Could you please let me know if this option is available and where can I find it?

snprelate genesis • 191 views
modified 12 months ago • written 12 months ago by Stephanie M. Gogarten680
Answer: Using previously calculated PCs in GENESIS
0
12 months ago by
University of Washington
Stephanie M. Gogarten680 wrote:

You can use the SNPRelate package to project relatives onto existing PCs. You would first need to represent your PCs as a snpgdsPCA object, which is a list with elements sample.id, snp.id, eigenval, and eigenvect. See the man pages for snpgdsPCA, snpgdsPCASNPLoading and snpgdsPCASampLoading for more details.

library(SNPRelate)
gds <- snpgdsOpen("myfile.gds")
pca.unrel < snpgdsPCA(gds, sample.id=unrels)