HiC.Plot: This function plots a HiC plot. The function uses global...

Description Usage Arguments Details Value

View source: R/functions.R

Description

This function plots a HiC plot. The function uses global variables provided default by the pileup.r script.

Usage

1
HiC.Plot(plotData, plotTitle, arrowYes = 0, offsetf = 1)

Arguments

plotData

Data input in a matrix format.

plotTitle

Title of the plot.

ArrowYes

Boolean, 1 = arrows at CHiP peaks, 0 = No arrows.

Details

HiC.Plot <- function(plotData,plotTitle,arrowYes=0,offsetf=1) {

palette(paste0(colfunc(r*log2(maxC)),"FF"))

plot(1,1,xlim=c(-zoomC1,zoomC1), ylim=c(-zoomC*(0.5*mirrorPlot),minY*1.5),

ylab=yAxisTitle,xlab=xAxisTitle,yaxt="n",xaxt="n",yaxs="i",xaxs ="i") # added *2 to fit inverted plot

axis(2, at = ylabel,labels = y2label, las = 2)

axis(1, at = xlabel,labels = xlabel, las = 1)

points(((plotData$V1-0.5)*resKB+(plotData$V2-plotData$V1+offsetf)*resKB*offset)-zoomC,

((plotData$V2)*resKB-(plotData$V1)*resKB)-zoomC,

pch=18,

cex=sz,col=r*log2(plotData$V3))

title(main=plotTitle,line = -plotTitleOffset)

if(arrowYes == 1){

arrows(minarrowmax,arrowposx,minarrowmin,arrowposx,col="black",lwd=1,length=.025,code = 3)

arrows(maxarrowmin,arrowposx,maxarrowmax,arrowposx,col="black",lwd=1,length=.025,code = 3)

}

}

Value

A HiC plot.


gb305/Rpackages documentation built on Feb. 18, 2020, 2:55 p.m.