pdf("./catalina/results/Ring1b_mESC_GENEmap_5000/PlotHEATmap_Ring1b_mESC_5000.pdf",width=5,height=10,bg="white",fg="black") c <- scan("./catalina/results/Ring1b_mESC_GENEmap_5000/HEATmatrix_Ring1b_mESC_5000_processed.txt",sep="\t") m<-matrix(c,18443,200,byrow=TRUE) min <- min(c, na.rm=T) max <- max(c, na.rm=T) code1 <- col2rgb("white") code2 <- col2rgb("black") ColorRamp <- rgb(seq(code1[1]/255,code2[1]/255,length=50), # Red seq(code1[2]/255,code2[2]/255,length=50), # Green seq(code1[3]/255,code2[3]/255,length=50)) # Blue ColorRamp[1]="white" ColorLevels <- seq(min/max, max/max, length=length(ColorRamp)) layout(matrix(data=c(1,2), nrow=1, ncol=2), widths=c(4,1),heights=c(1,1)) par(mar = c(5,5,2.5,1), font = 2,col.axis="black",col.main="black",col.lab="black") image(1:ncol(m), 1:nrow(m), t(m),col=ColorRamp, xlab="REGION", ylab="GENES", axes=FALSE, zlim=c(min,max), main= "Ring1b_mESC") axis(1,at=c(1,51,150,200),labels=c("-5000","TSS","TES","+5000")) axis(2,at=c(1,18443),labels=c("1","18443")) par(mar = c(5,2.5,2.5,1)) image(1, ColorLevels, matrix(data=ColorLevels, ncol=length(ColorLevels),nrow=1), col=ColorRamp,xlab="",ylab="",xaxt="n", las = 1) mtext(side=4,cex=0.5,font=2,"SeqCode by E. Blanco [Wed Jun 9 14:52:24 2021]") mat <- matrix(1,1) layout(mat,c(1,1),c(1,1)) plot(0:10, type = "n", xaxt="n", yaxt="n", bty="n", xlab = "", ylab = "") text(1,5,"Figure legend. Heatmap of ChIPseq reads along a uniform gene model.",font=2,cex=0.75,srt=90) text(1.5,4.975,"This plot is generated by counting the number of reads along this region for",font=1,cex=0.75,srt=90) text(2,4.975,"each gene to display these values on different rows of the heatmap. The X-",font=1,cex=0.75,srt=90) text(2.5,4.95,"axis represents the metagene and the flanking regions in which the counts",font=1,cex=0.75,srt=90) text(3,4.9,"were calculated for each gene. The Y-axis represents the list of all genes",font=1,cex=0.75,srt=90) text(3.5,5,"ranked by the average ChIP intensity on this region. TSS is the Transcription",font=1,cex=0.75,srt=90) text(4,4.9,"Start Site and TES is the Transcription End Site. On the right, ChIP signal",font=1,cex=0.75,srt=90) text(4.5,3.65,"range from high (top) to low (bottom).",font=1,cex=0.75,srt=90) text(6,2.5,"ChIPseq experiment:",font=1,cex=0.75,srt=90) text(6.5,2.5,"Ring1b_mESC",font=3,cex=0.75,srt=90) text(6,7.5,"Number of reads:",font=1,cex=0.75,srt=90) text(6.5,7.5,"21485404",font=3,cex=0.75,srt=90) text(7,2.5,"Number of genes:",font=1,cex=0.75,srt=90) text(7.5,2.5,"18443",font=3,cex=0.75,srt=90) text(7,7.5,"Flanking sequence:",font=1,cex=0.75,srt=90) text(7.5,7.5,"5000",font=3,cex=0.75,srt=90) text(8,2.5,"RefSeq transcripts:",font=1,cex=0.75,srt=90) text(8.5,2.5,"46881",font=3,cex=0.75,srt=90) text(8,7.5,"Window factor:",font=1,cex=0.75,srt=90) text(8.5,7.5,"100",font=3,cex=0.75,srt=90) text(11,5,cex=0.5,font=2,"SeqCode by E. Blanco [Wed Jun 9 14:52:24 2021]",srt=90) dev.off()