Guest User

Untitled

a guest
Mar 13th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. setwd("/home/bk/Desktop/hg38")
  2.  
  3. dta <- read.csv("L1.6kb.CpG.rel.pos.csv",header = F, sep = ",")
  4. dim(dta)
  5. dta.t <- t(dta[,-1])
  6. dta.t <- dta.t[,colSums(is.na(dta.t))<nrow(dta.t)]
  7. nc <- ncol(dta.t)
  8.  
  9. res <- lapply(1:nc,function(i) {
  10. h<-hist(dta.t[,i], plot=F, breaks = 10)
  11. print(h$density)
  12. })
  13.  
  14. res<-matrix(unlist(res), ncol=10)
  15.  
  16. colnames(res) <- c("bin1","bin2","bin3","bin4","bin5",
  17. "bin6","bin7","bin8","bin9","bin10")
  18. head(res)
  19. tail(res)
  20.  
  21. write.csv(res,"CpG.density.L1.6kb.csv")
Add Comment
Please, Sign In to add comment