comparison dartseq_seeduk_2b.R @ 26:d1d232d4cb2f draft

Uploaded
author cropgeeks
date Fri, 20 Apr 2018 14:44:25 -0400
parents ae6b94d10bff
children 27777dd17bfe
comparison
equal deleted inserted replaced
25:ae6b94d10bff 26:d1d232d4cb2f
2 2
3 library("amap") 3 library("amap")
4 library("labdsv") 4 library("labdsv")
5 5
6 data <- read.table("plink.raw",header=T) 6 data <- read.table("plink.raw",header=T)
7 distances <- Dist(data[,7:dim(data)[2]], method = "euclidean", nbproc = 144) 7 distances <- Dist(data[,7:dim(data)[2]], method = "euclidean", nbproc = as.integer(args[2]))
8 pco_results <- pco(distances,k=10) 8 pco_results <- pco(distances,k=10)
9 #Variance explained by first three PCOs 9 #Variance explained by first three PCOs
10 pco_results$eig[1]/sum(pco_results$eig[pco_results$eig>0]) 10 pco_results$eig[1]/sum(pco_results$eig[pco_results$eig>0])
11 #[1] 0.2565937 11 #[1] 0.2565937
12 pco_results$eig[2]/sum(pco_results$eig[pco_results$eig>0]) 12 pco_results$eig[2]/sum(pco_results$eig[pco_results$eig>0])