This function allows you to plot wiggle data for a selected chromosome.
It takes as input either the raw wiggle data (for example one element of the 16 chromosome list)
or the output of wiggle_smooth()
(R data frame with two columns: genome position and
smoothed signal).
wiggle_plot(wiggleData, chr, genome, yMax, color = "grey50", protein, legendXcoord = -10, legendYcoord = yMax, legendAnnotation = deparse(substitute(wiggleData)), onScreen = TRUE)
wiggleData | A data frame of wiggle data with two columns: genome position and signal. No default. |
---|---|
chr | A number representing the chromosome of |
genome | A string representing the genome used for mapping. No default. |
yMax | Optional number to be used as the max Y scale value in the plots. Particularly useful to plot two chromosomes on the same Y scale. No default. |
color | Optional R color. Defaults to |
protein | A string representing the ChIPped protein. No default. |
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). |
legendAnnotation | Optional string to be used as the legend. Defaults to name of object passed to the function. |
onScreen | Boolean indicating plots should be returned to the screen ( |
A line plot, either on screen or as a png file (in the working directory).
# NOT RUN { wiggle_plot(WT[[1]], 1, genome = 'SK1', protein = 'Red1') wiggle_plot(WT_chr3, 3, genome = 'SK1', yMax = 5, color = 'red', protein = 'Red1', onScreen = TRUE) wiggle_plot(chrXVI, 16, genome = 'S288C', yMax = 5, color = 'black', protein = 'Rec8-HA', legendXcoord = 600, onScreen = FALSE) # }