plotMotifOccurrenceAverage {seqPattern} | R Documentation

## Plotting average profile of motif occurrence

### Description

Plots average profile of motif occurrence for a set of input sequences of the same length. Motif is specified by a position weight matrix (PWM) that contains estimated probability of base b at position i, and only motif hits above specified threshold are taken into account.

### Usage

    plotMotifOccurrenceAverage(regionsSeq, motifPWM, minScore = "80%", flankUp =
        NULL, flankDown = NULL, smoothingWindow = 1, color = "black", xLabel =
        "Distance to reference point (bp)", yLabel = "Relative frequency", cexAxis =
        1, addReferenceLine = TRUE, plotLegend = FALSE, cexLegend = 1, add = FALSE,
        ...)

### Arguments

`regionsSeq` | A `DNAStringSet` object. Set of sequences of the same length for which the patterns occurrence profile should be visualised.
`motifPWM` | A numeric matrix representing the Position Weight Matrix (PWM), such as returned by `PWM` function. Can contain either probabilities or log2 probability ratio of base b at position i.
`minScore` | The minimum score for counting a motif hit. Can be given as a character string containing a percentage (e.g. `"85%"`) of the PWM score or a single number specifying score threshold. If a percentage is given, it is converted to a score value taking into account both minimal and maximal possible PWM scores as follows: `minPWMscore + percThreshold/100 * (maxPWMscore - minPWMscore)` This differs from the formula in the `matchPWM` function from the `Biostrings` package which takes into account only the maximal possible PWM score and considers the given percentage as the percentage of that maximal score: `percThreshold/100 * maxPWMscore`
`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` | Value specifying the color for plotting.
`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`.
`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 motif above the specified score threshold in the set of input sequences and plots an average profile reflecting the occurrence of the motif across input sequences.

### Author(s)

Vanja Haberle

### See Also

`motifScanHits`
`plotMotifDensityMap`

### Examples

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

    plotMotifOccurrenceAverage(regionsSeq = zebrafishPromoters, motifPWM = TBPpwm,
                        minScore = "85%", flankUp = 400, flankDown = 600,
                        smoothingWindow = 3)

[Package seqPattern version 1.24.0 Index]