Learn R Programming

nucleR (version 2.4.0)

plotPeaks: Nucleosome calling plot function

Description

Helper function for a quick and convenient overview of nucleosome calling data.

This function is intended to plot data previously processed with nucleR pipeline. It shows a coverage/intensity profile toghether with the identified peaks. If available, score of each peak is also shown.

Usage

plotPeaks(peaks, data, ...) "plotPeaks"(peaks, data, threshold=0, scores=NULL, start=1, end=length(data),dyn.pos=TRUE, xlab="position", type="l", col.points="red", thr.lty=1, thr.lwd="1", thr.col="darkred", rect.thick=2, rect.lwd=1, rect.border="black", scor.col=col.points, scor.font=2, scor.adj=c(0.5,0), scor.cex=0.75, scor.digits=2, indiv.scores=TRUE, ...) "plotPeaks"(peaks, data, threshold=0, scores=NULL, start=1, end=length(data), xlab="position", type="l", col.points="red", thr.lty=1, thr.lwd="1", thr.col="darkred", scor.col=col.points, scor.font=2, scor.adj=c(0.5,0), scor.cex=0.75, scor.digits=2,...)

Arguments

peaks
numeric, data.frame, IRanges or RangedData object containing the detected peaks information. See help of peakDetection or peakScoring for more details.
data
Coverage or Tiling Array intensities
threshold
Threshold applied in peakDetection
scores
If peaks is a data.frame or a RangedData it's obtained from 'score' column, otherwise, scores can be given here as a numeric vector
start, end
Start and end points defining a subset in the range of data. This is a convenient way to plot only a small region of data, without dealing with subsetting of range or score objects.
dyn.pos
If peaks are ranges, should they be positioned dynamicaly on top of the peaks or staticaly at threshold baseline. Spacing of overlapping ranges is automatically applied if FALSE.
xlab, type, col.points
Default values to be passed to plot and points
thr.lty, thr.lwd, thr.col
Default values to be passed to abline for threshold representation
rect.thick, rect.lwd, rect.border
Default values for rect representation or ranges. rect.thick indicates the thickness (in percentage relative to y-axis range) of the rectangles.
scor.col, scor.font, scor.adj, scor.cex, scor.digits
Default values for text representation for score numbers, if available.
indiv.scores
Show or hide individual scores for width and height in brakets besides the mixed score
...
Other parameters passed to plot function

Value

(none)

See Also

peakDetection, peakScoring, plot,

Examples

Run this code

  #Generate a random peaks profile
  reads = syntheticNucMap(nuc.len=40, lin.len=130)$syn.reads
  cover = coverage(reads)

  #Filter them
  cover_fft = filterFFT(cover)

  #Detect peaks
  peaks = peakDetection(cover_fft, threshold="40%", score=TRUE, width=140)

	#Plot peaks and coverage profile (show only a window)
  plotPeaks(peaks, cover_fft, threshold="40%", start=1000, end=6000)

Run the code above in your browser using DataLab