Skip to content

Commit

Permalink
Merge pull request #1 from ajiangsfu/patch-1
Browse files Browse the repository at this point in the history
remove the following part after write out alldf
  • Loading branch information
rdmorin authored Oct 11, 2017
2 parents c09df5d + dd98543 commit e27df95
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions rainstorm.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,7 @@ print("done calculating background correction")
alldf = data.frame(chrom=bincounts.chrom,starts=binstarts.all,ends=binstops.all,counts=bincounts.all)

write.table(alldf,file=paste(basename,"_background_100k_binned_density.tsv",sep=""),sep="\t",quote=F)
model= loess(counts~starts,data=alldf[alldf[,1]== 3 & alldf[,"counts"]!=-Inf,],span=0.01,surface='direct')
chrdf =alldf[alldf[,1]==3,]
lopoints=predict(model,newdata=chrdf)

chrdf$predicted=lopoints
ggplot(chrdf,aes(x=starts,y=counts)) + geom_point(alpha=0.4,colour='orange') + geom_line(aes(x=starts,y=predicted),colour='red') + ylim(-18,-23); #pllot out chrom3
ggsave(file=paste(basename,"_chr3_background.pdf",sep=""),width=7,height=4)

}else{
alldf = read.csv(paste(basename,"_background_100k_binned_density.tsv",sep=""),sep="\t",stringsAsFactors=F);
Expand Down

0 comments on commit e27df95

Please sign in to comment.