Title: | Sequence logos for DNA sequence alignments |
---|---|
Description: | seqLogo takes the position weight matrix of a DNA sequence motif and plots the corresponding sequence logo as introduced by Schneider and Stephens (1990). |
Authors: | Oliver Bembom [aut], Robert Ivanek [aut, cre] |
Maintainer: | Robert Ivanek <[email protected]> |
License: | LGPL (>= 2) |
Version: | 1.73.0 |
Built: | 2024-10-31 05:17:23 UTC |
Source: | https://github.com/bioc/seqLogo |
This function constructs an object of class pwm from a matrix. It checks that the matrix has correct dimensions and that columns add up to 1.0.
makePWM(pwm, alphabet = "DNA")
makePWM(pwm, alphabet = "DNA")
pwm |
matrix. Numerical matrix representing the position weight matrix. |
alphabet |
character. The alphabet making up the sequence. Currently, only 'DNA' and 'RNA' is supported. |
An object of class pwm.
Oliver Bembom
mFile <- system.file("extdata/pwm1", package = "seqLogo") m <- read.table(mFile) pwm <- makePWM(m)
mFile <- system.file("extdata/pwm1", package = "seqLogo") m <- read.table(mFile) pwm <- makePWM(m)
An object of class 'pwm'
represents the alphabet*width
position weight matrix of a sequence motif. In case of DNA sequence motif,
the entry in row i, column j gives the probability of observing nucleotide
c('A','C','G','T')[i]
in position j of the motif.
## S4 method for signature 'pwm' show(object) ## S4 method for signature 'pwm' summary(object, ...) ## S4 method for signature 'pwm,ANY' plot(x, y = "missing", ...) ## S4 method for signature 'pwm' pwm(pwm) ## S4 method for signature 'pwm' ic(pwm) ## S4 method for signature 'pwm' consensus(pwm)
## S4 method for signature 'pwm' show(object) ## S4 method for signature 'pwm' summary(object, ...) ## S4 method for signature 'pwm,ANY' plot(x, y = "missing", ...) ## S4 method for signature 'pwm' pwm(pwm) ## S4 method for signature 'pwm' ic(pwm) ## S4 method for signature 'pwm' consensus(pwm)
object |
object of |
... |
additional parameters for |
x |
object of |
y |
default (missing) for |
pwm |
object of |
pwm-class
object with slots: pwm
, width
, ic
and alphabet
.
show,pwm-method
: Shows the position weight matrix.
summary,pwm-method
: Prints the summary information about position weight
matrix.
plot,pwm,ANY-method
: Plots the sequence logo of the position weight matrix.
pwm,pwm-method
: Access to 'pwm' slot
ic,pwm-method
: Access to 'ic' slot
consensus,pwm-method
: Access to 'consensus' slot
pwm
matrix. The position weight matrix.
width
numeric. The width of the motif.
ic
numeric. The information content (IC).
alphabet
character. The sequence alphabet. Currently, only 'DNA' and 'RNA' is supported.
consensus
character. The consensus sequence.
Oliver Bembom
mFile <- system.file("extdata/pwm1", package = "seqLogo") m <- read.table(mFile) p <- makePWM(m) # # slot access pwm(p) ic(p) consensus(p)
mFile <- system.file("extdata/pwm1", package = "seqLogo") m <- read.table(mFile) p <- makePWM(m) # # slot access pwm(p) ic(p) consensus(p)
This function takes the alphabet*width position weight matrix of a sequence motif and plots the corresponding sequence logo.
seqLogo(pwm, ic.scale=TRUE, xaxis=TRUE, yaxis=TRUE, xfontsize=15, yfontsize=15, fill=c(A='#61D04F', C='#2297E6', G='#F5C710', T='#DF536B'))
seqLogo(pwm, ic.scale=TRUE, xaxis=TRUE, yaxis=TRUE, xfontsize=15, yfontsize=15, fill=c(A='#61D04F', C='#2297E6', G='#F5C710', T='#DF536B'))
pwm |
numeric. The alphabet*width position weight matrix. |
ic.scale |
logical. If TRUE, the height of each column is proportional to its information content. Otherwise, all columns have the same height. |
xaxis |
logical. If TRUE, an X-axis will be plotted. |
yaxis |
logical. If TRUE, a Y-axis will be plotted. |
xfontsize |
numeric. Font size to be used for the X-axis. |
yfontsize |
numeric. Font size to be used for the Y-axis. |
fill |
character. Fill color to be used for the letters. Must be a named character vector of length equal to number of rows in |
NULL.
Oliver Bembom
mFile <- system.file("extdata/pwm1", package = "seqLogo") m <- read.table(mFile) p <- makePWM(m) seqLogo(p)
mFile <- system.file("extdata/pwm1", package = "seqLogo") m <- read.table(mFile) p <- makePWM(m) seqLogo(p)