startRun <- 0 endRun <- 639 lengthAll <- 3201157 shift <- 5000 intervallAll <- 10000 runIndex="" all=222246 load(file=paste("resDups.Rda",sep="")) load(file="../individuals.Rda") over <- intervallAll%/%shift N1 <- lengthAll%/%shift endRunAll <- (N1-over+1) allCount <- 0 allCount1 <- 0 HapPos <- c() HapLength <- c() for (posAll in (startRun+1):(endRun+1)) { start <- (posAll-1)*shift end <- start + intervallAll if (end > lengthAll) { end <- lengthAll } pRange <- paste("_",format(start,scientific=FALSE),"_",format(end,scientific=FALSE),sep="") load(file=paste("resIBD_chr1",pRange,"annot.Rda",sep="")) noIBD <- length(IBDannot) if (noIBD>0) { for (ibdC in 1:noIBD) { allCount <- allCount + 1 if (!dups[allCount]) { allCount1 <- allCount1 + 1 ibdPos <- IBDannot[[ibdC]][[4]] HapPos <- c(HapPos,ibdPos) ibdLength <- IBDannot[[ibdC]][[5]] HapLength <- c(HapLength,ibdLength) } cat(allCount," out of ",all,"\r") } } } write.table(HapPos,file=paste("HapPos",runIndex,".txt",sep="")) write.table(HapLength,file=paste("HapLength",runIndex,".txt",sep="")) save(HapPos,HapLength,file=paste("HapPos",runIndex,".Rda",sep=""))