Entering edit mode
10.2 years ago
kumar.vinod81
▴
340
I am using SNPRelate for PCA analysis. Its using default color for different populations but I want to color them according to me. Plotting commands are like this:
> plot(tab$EV2, tab$EV1, col=as.integer(tab$pop),cex=1.2,pch=20,
+ xlab="eigenvector 2", ylab="eigenvector 1")
> legend("topleft", legend=levels(tab$pop), cex=1,pch=20, col=1:nlevels(tab$pop))
Head of the input file is like this:
sample.id pop EV1 EV2
1 A1 POP_I -0.10172849 0.03619405
2 A2 POP_I -0.15951814 0.08234857
3 A3 POP_I -0.15632495 0.08180843
4 A4 POP_I -0.09679447 0.07981108
5 A5 POP_I 0.11362360 -0.03186038
6 A6 POP_I 0.05594095 -0.05498351
Any idea about it?
How we can label the samples in this PCA plot?