system("sed 's/,\t/,/g' phase1_integrated_calls.20101123.ALL.panel > phase1_integrated_calls.20101123.ALL.panel.4col") indit <- read.table("phase1_integrated_calls.20101123.ALL.panel.4col", header = FALSE, sep = "\t", quote = "",as.is=TRUE) indi1 <- as.vector(unlist(rbind(indit[,1],indit[,1]))) indi2 <- as.vector(unlist(rbind(indit[,2],indit[,2]))) indi3 <- as.vector(unlist(rbind(indit[,3],indit[,3]))) indi4 <- as.vector(unlist(rbind(indit[,4],indit[,4]))) indi4 <- gsub(",",";",indi4) indi <- cbind(indi1,indi2,indi3,indi4) save(indi,file="individuals.Rda") # EUeuropeans <- c(which(indi[,2]=="CEU"),which(indi[,2]=="FIN"),which(indi[,2]=="GBR"),which(indi[,2]=="IBS"),which(indi[,2]=="TSI")) EUeuropeans <- c(which(indi[,3]=="EUR")) EUeurop <- as.integer(sort.int(as.integer(unique(EUeuropeans)))) indi_EUeurop <- indi[EUeurop,] save(indi_EUeurop,file="individualsEU.Rda") annot <- read.table("ALL.chr1.phase1_release_v3.20101123.snps_indels_svs.genotypes_annot.txt",header = FALSE, sep = " ", quote = "",as.is = TRUE,skip=2) for (i in 3:9) { annot[[i]] <- gsub(",",";",annot[[i]]) } save(annot,file="annotation_chr1.Rda") sPF <- samplesPerFeature(X="ALL.chr1.phase1_release_v3.20101123.snps_indels_svs.genotypes_mat",samples=EUeurop,lowerB=1.5,upperB=0.05*length(EUeurop)) save(sPF,file="sPF_15_005_chr1_EU.Rda") lii <- length(indi[,1]) samples <- 1:lii sPF <- samplesPerFeature(X="ALL.chr1.phase1_release_v3.20101123.snps_indels_svs.genotypes_mat",samples=samples,lowerB=1.5,upperB=0.05*lii) save(sPF,file="sPF_15_005_chr1.Rda")