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.

methods for psam objects.

### Usage

    ## S4 method for signature 'psam'
    x$name

    ## S4 method for signature 'psam,ANY'
    plot(x, y = "missing", ...)

    ## S4 method for signature 'psam'
    matrixReverseComplement(x)

    ## S4 method for signature 'psam,numeric,logical'
    addBlank(x, n, b)

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

    ## S4 method for signature 'psam'
    format(x, ...)

### Arguments

`x` | An object of class `psam`.
`name` | Slot name.
`y` | Not use.
`...` | Further potential arguments passed to `plotAffinityLogo`.
`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("psam", mat, name, alphabet, color)`.

### 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.

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.

$, $<-

  Get or set the slot of `psam-class`

as.data.frame

  convert `psam-class` to a data.frame

format

  return the name_pfm of `psam-class`

### Examples

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

    motif <- importMatrix(file.path(find.package("motifStack"), "extdata", "PSAM.mxr"),
                          format="psam")[[1]]
    matrixReverseComplement(motif)
    addBlank(motif, 1, FALSE)
    addBlank(motif, 3, TRUE)
    as(motif,"matrix")
    as.data.frame(motif)
    format(motif)

[Package motifStack version 1.38.0 Index]