An object of class "pssm" represents the position specific score matrix of a DNA/RNA/amino-acid sequence motif. The entry stores a matrix, which in row i, column j gives the log-odds probability of nucleotide/or amino acid i in position j of the motif.

methods for pssm objects.

# S4 method for pssm
$(x, name)

# S4 method for pssm,ANY
plot(x, y = "missing", ...)

# S4 method for pssm
matrixReverseComplement(x)

# S4 method for pssm,numeric,logical
addBlank(x, n, b)

# S4 method for pssm
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

# S4 method for pssm
format(x, ...)

Arguments

x

An object of class pssm. For getIC, if parameter p is followed, x should be an object of matrix.

name

Slot name.

y

Not use.

...

Further potential arguments passed to plotMotifLogo.

n

how many spaces should be added.

b

logical value to indicate where the space should be added.

row.names, optional

see as.data.frame

Objects from the Class

Objects can be created by calls of the form new("pssm", mat, name, alphabet, color, background).

Methods

addBlank

signature(x="pssm", n="numeric", b="logical") add space into the position frequency matrix for alignment. b is a bool value, if TRUE, add space to the 3' end, else add space to the 5' end. n indicates how many spaces should be added.

matrixReverseComplement

signature(x = "pssm") get the reverse complement of position frequency matrix.

plot

signature(x = "pssm") Plots the sequence logo of the position frequency matrix.

$, $<-

Get or set the slot of pssm-class

as.data.frame

convert pssm-class to a data.frame

format

return the name_pssm of pssm-class

Examples

pcm <- read.table(file.path(find.package("motifStack"), "extdata", "bin_SOLEXA.pcm")) pcm <- pcm[,3:ncol(pcm)] rownames(pcm) <- c("A","C","G","T") motif <- pcm2pssm(pcm) motif <- new("pssm", mat=motif, name="bin_SOLEXA") plot(motif)
pcm <- read.table(file.path(find.package("motifStack"), "extdata", "bin_SOLEXA.pcm")) pcm <- pcm[,3:ncol(pcm)] rownames(pcm) <- c("A","C","G","T") motif <- pcm2pssm(pcm) motif <- new("pssm", mat=motif, name="bin_SOLEXA") matrixReverseComplement(motif)
#> An object of class "pssm" #> Slot "mat": #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> A -2.445991 -2.083410 -18 -3.812790 -18 1.916584 -3.1065104 #> C -18.000000 -4.475728 -18 -18.000000 -18 -18.000000 0.9165836 #> G -18.000000 1.894954 -18 -3.475728 -18 -2.153800 -1.9109575 #> T 1.932243 -18.000000 2 1.940713 2 -18.000000 0.7910522 #> #> Slot "name": #> [1] "bin_SOLEXA" #> #> Slot "alphabet": #> [1] "DNA" #> #> Slot "color": #> A C G T #> "#00811B" "#2000C7" "#FFB32C" "#D00001" #> #> Slot "background": #> A C G T #> 0.25 0.25 0.25 0.25 #> #> Slot "tags": #> list() #> #> Slot "markers": #> list() #>
addBlank(motif, 1, FALSE)
#> An object of class "pssm" #> Slot "mat": #> V3 V4 V5 V6 V7 V8 V9 #> A 0 0.7910522 -18.000000 2 1.940713 2 -18.000000 1.932243 #> C 0 -1.9109575 -2.153800 -18 -3.475728 -18 1.894954 -18.000000 #> G 0 0.9165836 -18.000000 -18 -18.000000 -18 -4.475728 -18.000000 #> T 0 -3.1065104 1.916584 -18 -3.812790 -18 -2.083410 -2.445991 #> #> Slot "name": #> [1] "bin_SOLEXA" #> #> Slot "alphabet": #> [1] "DNA" #> #> Slot "color": #> A C G T #> "#00811B" "#2000C7" "#FFB32C" "#D00001" #> #> Slot "background": #> A C G T #> 0.25 0.25 0.25 0.25 #> #> Slot "tags": #> list() #> #> Slot "markers": #> list() #>
addBlank(motif, 3, TRUE)
#> An object of class "pssm" #> Slot "mat": #> V3 V4 V5 V6 V7 V8 V9 #> A 0.7910522 -18.000000 2 1.940713 2 -18.000000 1.932243 0 0 0 #> C -1.9109575 -2.153800 -18 -3.475728 -18 1.894954 -18.000000 0 0 0 #> G 0.9165836 -18.000000 -18 -18.000000 -18 -4.475728 -18.000000 0 0 0 #> T -3.1065104 1.916584 -18 -3.812790 -18 -2.083410 -2.445991 0 0 0 #> #> Slot "name": #> [1] "bin_SOLEXA" #> #> Slot "alphabet": #> [1] "DNA" #> #> Slot "color": #> A C G T #> "#00811B" "#2000C7" "#FFB32C" "#D00001" #> #> Slot "background": #> A C G T #> 0.25 0.25 0.25 0.25 #> #> Slot "tags": #> list() #> #> Slot "markers": #> list() #>
as(motif,"matrix")
#> V3 V4 V5 V6 V7 V8 V9 #> A 0.7910522 -18.000000 2 1.940713 2 -18.000000 1.932243 #> C -1.9109575 -2.153800 -18 -3.475728 -18 1.894954 -18.000000 #> G 0.9165836 -18.000000 -18 -18.000000 -18 -4.475728 -18.000000 #> T -3.1065104 1.916584 -18 -3.812790 -18 -2.083410 -2.445991
#> Error in as.data.frame.default(motif): cannot coerce class ‘structure("pssm", package = "motifStack")’ to a data.frame
format(motif)
#> [1] "bin_SOLEXA_pssm"