plotMotifDensityMap(regionsSeq, motifPWM, minScore = "80%", seqOrder = c(1:length(regionsSeq)), flankUp = NULL, flankDown = NULL, nBin = NULL, bandWidth = NULL, color = "blue", transf = NULL, xTicks = NULL, xTicksAt = NULL, xLabel = "", yTicks = NULL, yTicksAt = NULL, yLabel = "", cexAxis = 8, plotScale = TRUE, scaleLength = NULL, scaleWidth = 15, addReferenceLine = TRUE, plotColorLegend = TRUE, outFile = "DensityMap", plotWidth = 2000, plotHeight = 2000)
DNAStringSet
object. Set of sequences of the same length
for which the motif occurrence density should be visualised.
PWM
function. Can contain either probabilities
or log2 probability ratio of base b at position i.
"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
regionSeq
. Input sequences will be sorted according to this index
in an ascending order form top to the bottom of the plot, i.e.
the sequence labeled with the lowest number will appear at the top of
the plot. The default value will order the sequences as they are ordered
in the input regionSeq
object.
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.
gridsize
argument of the
bkde2D
function to compute a 2D binned kernel density
estimate. If nBin
is not specified it will default to
c(n, m)
, where n
is the number of input sequences and
m
is the length of sequences.
bandwidth
argument of the bkde2D
function to
compute a 2D binned kernel density estimate and are used as standard
deviation of the bivariate Gaussian kernel. If bandWidth
is not
specified it will default to c(3,3)
.
"blue", "brown",
"cyan", "gold", "gray", "green", "pink", "purple", "red"
. Please refer
to the vignette for the appearance of these palettes.
NULL
value produces five tick-marks: one at the
reference point and two equally spaced tick-marks both upstream and
downstream of the reference point.
NULL
value produces five
tick-marks: one at the reference point and two equally spaced tick-marks
both upstream and downstream of the reference point.
NULL
value produces no tick-marks and labels.
NULL
value produces no
tick-marks.
plotScale = TRUE
. If no value is provided, it defaults to one
fifth of the input sequence length.
plotScale = TRUE
.
TRUE
a separate .png file named outFile
."ColorLegend.png"
will be created, showing mapping of pattern density values to colours.
outFile
."pattern.jpg".
motifScanHits
plotPatternDensityMap
library(GenomicRanges)
load(system.file("data", "zebrafishPromoters.RData", package="seqPattern"))
promoterWidth <- elementMetadata(zebrafishPromoters)$interquantileWidth
load(system.file("data", "TBPpwm.RData", package="seqPattern"))
plotMotifDensityMap(regionsSeq = zebrafishPromoters, motifPWM = TBPpwm,
minScore = "85%", seqOrder = order(promoterWidth),
flankUp = 400, flankDown = 600, color = "red")
Run the code above in your browser using DataLab