signal_at_orf_average_plot: Line plot of average signal on ORFs

Description Usage Arguments Details Value Examples

Description

This function allows you to make a line plot of the ChIP signal over the average ORF. It takes as input a data frame containing the average signal over ORFs (+/- flanking regions) genome-wide.

Usage

1
2
3
signal_at_orf_average_plot(inputDataA, inputDataB, genome, yMin, yMax,
  onScreen = TRUE, legendXcoord = -200, legendYcoord = yMax + yMax * 0.05,
  colorA = "grey50", colorB = "orange", smoothBandwidth = 0)

Arguments

inputDataA

A data frame of average signal on ORFs +/- 1/2 the length of the ORF: relative position and average signal. No default.

inputDataB

Optional data in the same format for a second sample. No default.

genome

A string representing the genome used for mapping. This is used in the title of the plot only. No default.

yMin

Optional number to be used as the minimum Y scale value in the plot.

yMax

Optional number to be used as the maximum Y scale value in the plot.

onScreen

Boolean indicating plots should be returned to the screen (onScreen = TRUE) or written to .png files (onScreen = FALSE). Defaults to TRUE.

legendXcoord

A number representing the X coordinate to locate legend. Defaults to minimum X (left-aligned).

legendYcoord

A number representing the Y coordinate to locate legend. Defaults to maximum Y (top-aligned).

colorA

Optional R color for sample A. Defaults to grey50.

colorB

Optional R color for sample B. Defaults to orange.

smoothBandwidth

Optional integer as the bandwith for smoothing data (for better-looking line plots) using a Kernel Regression Smoother. Smoothing is performed using function ksmooth() from stats package. For info on bandwith argument and the ksmooth() function in general run ?ksmooth. Defaults to 0 (no smoothing).

Details

To generate the input for this function starting from an R list of wiggle data for the 16 chromosomes you should run:

  1. signal_at_orf to pull out the signal at every ORF and flanking regions (1/2 the length of the ORF).

  2. signal_average to calculate the average signal at each relative position over all regions genome-wide.

Value

A line plot of one or two samples, either on screen or as a png file (in the working directory).

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
signal_at_orf_average_plot(WT_orf_S288C_mean_signal, genome = 'S288C')

signal_at_orf_average_plot(WT_orf_mean_signal, dot1_orf_mean_signal, genome = 'SK1',
                           yMax = 3, onScreen = FALSE, legendXcoord = -500,
                           legendYcoord = 1, colorA = 'red', colorB = 'green',
                           smoothBandwidth = 50)

## End(Not run)

luisvalesilva/hwglabr documentation built on May 21, 2019, 8:56 a.m.