I have obtained two files .eigenvec and .eigenval after executing the command --pca on PLINK 1.9. now how can i plot PCA in R package. is there any tutorial? any script
I have obtained two files .eigenvec and .eigenval after executing the command --pca on PLINK 1.9. now how can i plot PCA in R package. is there any tutorial? any script
ret_pca=read.table("pca.eigenvec")
plot(ret_pca$PC1,ret_pca$PC2)
A bit more elaborate: see Step 11 from my tutorial Produce PCA bi-plot for 1000 Genomes Phase III - Version 2
Kevin
i have no PED data. how can i use this script for plotting PCA
PED <- read.table('20130606_g1k.ped', header = TRUE, skip = 0, sep = '\t') PED <- PED[which(PED$Individual.ID %in% rownames(eigenvec)), ] PED <- PED[match(rownames(eigenvec), PED$Individual.ID),] all(PED$Individual.ID == rownames(eigenvec)) == TRUE [1] TRUE
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I modified your question title so as to distinguish this from any standard PCA analysis.