/test-data/rgtestouts/rgEigPCA/rgEigPCAtest1.R

https://bitbucket.org/h_morita_dbcls/galaxy-central · R · 19 lines · 18 code · 0 blank · 1 comment · 0 complexity · 50012eea9a0130ec29297650ea608411 MD5 · raw file

  1. llist=c("Control","Case")
  2. glist=c(2,3)
  3. par(lab=c(10,10,10))
  4. par(mai=c(1,1,1,0.5))
  5. pdf("rgEigPCAtest1_PCAPlot.pdf",h=8,w=10)
  6. par(lab=c(10,10,10))
  7. pca1 = c(0.127600,0.027200,0.145200,0.088700,-0.002600,-0.245300,-0.241200,0.035800,0.290500,0.160700,0.167500,0.027200,0.027200,-0.087000,-0.063000,-0.188600,0.026800,-0.064300,0.092700,-0.241200,0.005600,0.026100,-0.160800,-0.160800,0.026100,0.074200,0.030200,-0.249300,0.183300,-0.102700,0.231200,-0.245300,-0.245300,-0.245300,0.301500,0.030200,0.030200,0.259300)
  8. pca2 = c(0.006000,-0.179400,0.266600,0.076500,-0.036700,-0.016500,0.253700,-0.176600,0.081100,-0.124700,0.041800,-0.179400,-0.179400,0.015400,-0.265600,-0.025100,-0.000800,0.041800,-0.221000,0.253700,-0.205100,-0.035400,-0.034900,-0.034900,-0.035400,0.081900,0.234800,-0.286700,0.120600,0.293900,-0.180800,-0.016500,-0.016500,-0.016500,0.215900,0.234800,0.234800,-0.191600)
  9. pgvec = c(2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,2,2,3,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2)
  10. plot(pca1,pca2,type='p',main='rgEigPCAtest1', ylab='Second ancestry eigenvector',xlab='First ancestry eigenvector',col=pgvec,cex=0.8,pch=pgvec)
  11. legend("top",legend=llist,pch=glist,col=glist,title="Sample")
  12. grid(nx = 10, ny = 10, col = "lightgray", lty = "dotted")
  13. dev.off()
  14. png("rgEigPCAtest1_PCAPlot.pdf.png",h=8,w=10,units="in",res=72)
  15. plot(pca1,pca2,type='p',main='rgEigPCAtest1', ylab='Second ancestry eigenvector',xlab='First ancestry eigenvector',col=pgvec,cex=0.8,pch=pgvec)
  16. legend("top",legend=llist,pch=glist,col=glist,title="Sample")
  17. grid(nx = 10, ny = 10, col = "lightgray", lty = "dotted")
  18. dev.off()
  19. #R script autogenerated by rgenetics/rgutils.py on 19/05/2010 15:14:48