pdf("./catalina/results/H3K4me3_mESC_TSSmap_5000/PlotHEATmap_H3K4me3_mESC_5000.pdf",width=5,height=10,bg="white",fg="black") c <- scan("./catalina/results/H3K4me3_mESC_TSSmap_5000/HEATmatrix_H3K4me3_mESC_5000_processed.txt",sep="\t") c[c>0]=10 m<-matrix(c,26074,100,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= "H3K4me3_mESC") axis(1,at=c(1,50.500000,100),labels=c("-5000","TSS","+5000")) axis(2,at=c(1,26074),labels=c("1","26074")) 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:26:37 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 around the TSS of the genes.",font=2,cex=0.75,srt=90) text(1.5,4.95,"This plot is generated by counting the number of reads along this region for",font=1,cex=0.75,srt=90) text(2,4.85,"each gene to display these values on different rows of the heatmap. The",font=1,cex=0.75,srt=90) text(2.5,4.825,"X-axis represents the region around the TSS in which the counts were",font=1,cex=0.75,srt=90) text(3,4.95,"calculated for each gene. The Y-axis represents the list of genes ranked by",font=1,cex=0.75,srt=90) text(3.5,5,"the average ChIP intensity on this region. TSS is the Transcription Start Site.",font=1,cex=0.75,srt=90) text(4,4.5,"On the right, ChIP signal 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,"H3K4me3_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,"26395433",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,"26074",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:26:37 2021]",srt=90) dev.off()