Learn R Programming

sequenza (version 1.0.5)

plotWindows: Plot the specified windowed chromosome.

Description

plotWindows is a convenient plot function that visualizes a specified chromosome attribute using the matrix produced by the function windowValues.

Usage

plotWindows(abf.window, m.lty = 1, m.lwd = 3,
             m.col = "black", q.bg = "lightblue", log2.plot = FALSE,
             n.min = 1, xlim, ylim, add = FALSE, ...)

Arguments

abf.window
matrix of base-pair windows and corresponding statistics to be plotted. A list of such matrices can be output from windowValues
m.lty
line type used for plotting mean values.
m.lwd
line width used for plotting mean values.
m.col
line color used for plotting mean values.
q.bg
background color for the area between the 0.25 and 0.75 quartiles.
log2.plot
logical, if TRUE values are log2 scaled.
n.min
minimum number of data points required for a binned window to be plotted.
xlim
limits of the x axis.
ylim
limits of the y axis.
add
logical, if TRUE the plot will be added to an existing opened device.
...
any other arguments accepted by plot.

See Also

chromosome.view,

Examples

Run this code
data.file <-  system.file("data", "abf.data.abfreq.txt.gz", package = "sequenza")
abf.data <- read.abfreq(data.file)
# 1Mb windows, each window is overlapping with 1 other adjacent window: depth ratio
abf.ratio <- windowValues(x = abf.data$depth.ratio,
                           positions = abf.data$n.base,
                           chromosomes = abf.data$chromosome, window = 1e6,
                           weight = abf.data$depth.normal, start.coord = 1, overlap = 1)

plotWindows(abf.r.win[[1]], log2.plot = FALSE,
            ylab = "Depth ratio", xlab = "Position (bases)",
            main = names(abf.r.win)[1], las = 1, n.min = 1,
            ylim = c(0, 2.5))

plotWindows(abf.r.win[[17]], log2.plot = FALSE,
            ylab = "Depth ratio", xlab = "Position (bases)",
            main = names(abf.r.win)[1], las = 1, n.min = 1,
            ylim = c(0, 2.5))

Run the code above in your browser using DataLab