Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setwd("/home/bk/Desktop/hg38")
- dta <- read.csv("L1.6kb.CpG.rel.pos.csv",header = F, sep = ",")
- dim(dta)
- dta.t <- t(dta[,-1])
- dta.t <- dta.t[,colSums(is.na(dta.t))<nrow(dta.t)]
- nc <- ncol(dta.t)
- res <- lapply(1:nc,function(i) {
- h<-hist(dta.t[,i], plot=F, breaks = 10)
- print(h$density)
- })
- res<-matrix(unlist(res), ncol=10)
- colnames(res) <- c("bin1","bin2","bin3","bin4","bin5",
- "bin6","bin7","bin8","bin9","bin10")
- head(res)
- tail(res)
- write.csv(res,"CpG.density.L1.6kb.csv")
Add Comment
Please, Sign In to add comment