psam-class {motifStack} | R Documentation

## Class `"psam"`

### Description

An object of class `"psam"` represents the position specific affinity matrix (PSAM) of a DNA/RNA/amino-acid sequence motif. The entry stores a matrix, which in row i, column j gives the affinity of observing nucleotide/or amino acid i in position j of the motif.

### Objects from the Class

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

### Slots

`mat`

  Object of class `"matrix"` The position specific affinity matrix

`name`

  code"character" The motif name

`alphabet`

  `"character"` The sequence alphabet. "DNA", "RNA", "AA" or "others".

`color`

  a `"character"` vector. The color setting for each symbol

### Methods

addBlank

  `signature(x="psam", n="numeric", b="logical")` add space into the position specific affinity 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.

coerce

  `signature(from = "psam", to = "matrix")`: convert object psam to matrix

matrixReverseComplement

  `signature(x = "psam")` get the reverse complement of position specific affinity matrix.

plot

  `signature(x = "psam")` Plots the affinity logo of the position specific affinity matrix.

### Examples

    motif <- importMatrix(file.path(find.package("motifStack"), "extdata", "PSAM.mxr"),
             format="psam")[[1]]
    plot(motif)

[Package motifStack version 1.28.0 Index]