plotPatternOccurrenceAverage {seqPattern} | R Documentation

## Plotting average profile of sequence pattern occurrence

### Description

Plots average profile of sequence pattern occurrence for a set of input sequences of the same length. Multiple sequence patterns can be processed at once and visualised in the same plot, allowing comparison across different patterns.

### Usage

    plotPatternOccurrenceAverage(regionsSeq, patterns, flankUp = NULL,
        flankDown = NULL, smoothingWindow = 1, color = rainbow(length(patterns)),
        xLabel = "Distance to reference point (bp)", yLabel = "Relative frequency",
        cexAxis = 1, addReferenceLine = TRUE, plotLegend = TRUE, cexLegend = 1,
        useMulticore = FALSE, nrCores = NULL, add = FALSE, ...)

### Arguments

`regionsSeq` | A `DNAStringSet` object. Set of sequences of the same length for which the patterns occurrence profile should be visualised.
`patterns` | Character vector specifying one or more DNA sequence patterns (oligonucleotides). IUPAC ambiguity codes can be used and will match any letter in the subject that is associated with the code.
`flankUp, flankDown` | The number of base-pairs upstream and downstream of the reference position in the provided sequences, respectively. `flankUp + flankDown` must sum up to the length of the sequences. If no values are provided both `flankUp` and `flankDown` are set to be half of the length of the input sequences, i.e. the reference position is assumed to be in the middle of the sequences.
`smoothingWindow` | Integer specifying the size of a window (in base-pairs) to be used for smoothing the signal. Default value of 1 corresponds to no smoothing.
`color` | A vector of values specifying the colors for plotting. Number of colors must match the number of patterns that should be plotted.
`xLabel, yLabel` | Character strings for x and y axis labels, respectively.
`cexAxis` | The magnification to be used for axis annotation relative to the current setting of `cex`.
`addReferenceLine` | Logical, should the vertical dashed line be drawn at the reference point.
`plotLegend` | Logical, should the legend be plotted at the top.
`cexLegend` | The magnification to be used for legend relative to the current setting of `cex`.
`useMulticore` | Logical, should multicore be used. `useMulticore = TRUE` is supported only on Unix-like platforms.
`nrCores` | Number of cores to use when `useMulticore = TRUE`. Default value `NULL` uses all detected cores.
`add` | Logical, should the pattern occurrence profiles be added to the existing plot.
`...` | Further arguments to be passed to `plot()` or `lines()` methods, such as `lty`, etc.

### Value

The function finds all hits matching the specified patterns in the set of input sequences and plots one average profile per pattern reflecting the occurrence of patterns across sequences.

### Author(s)

Vanja Haberle

### See Also

`getPatternOccurrenceList`
`plotPatternDensityMap`

### Examples

    load(system.file("data", "zebrafishPromoters.RData", package="seqPattern"))

    # dinucleotide patterns
    plotPatternOccurrenceAverage(regionsSeq = zebrafishPromoters, patterns = c("AT",
                "TA", "CG", "GC"), flankUp = 400, flankDown = 600, smoothingWindow =
                3, color = c("gold", "darkred", "forestgreen", "navy"))

    # motif consensus sequence
    plotPatternOccurrenceAverage(regionsSeq = zebrafishPromoters, patterns =
                "TATAWAWR", flankUp = 400, flankDown = 600, smoothingWindow = 3,
                color = "gray")

[Package seqPattern version 1.12.0 Index]