"pfm"
pfm-class.Rd
An object of class "pfm"
represents the position frequency matrix of
a DNA/RNA/amino-acid sequence motif. The entry stores a matrix, which in row
i, column j gives the frequency of observing nucleotide/or amino acid i in
position j of the motif.
methods for pfm objects.
# S4 method for pfm $(x, name) # S4 method for pfm,ANY plot(x, y = "missing", ...) # S4 method for pfm,ANY getIC(x, p = "missing") # S4 method for pfm,numeric trimMotif(x, t) # S4 method for pfm matrixReverseComplement(x) # S4 method for pfm,numeric,logical addBlank(x, n, b) # S4 method for pfm as.data.frame(x, row.names = NULL, optional = FALSE, ...) # S4 method for pfm format(x, ...)
x | An object of class |
---|---|
name | Slot name. |
y | Not use. |
... | Further potential arguments passed to |
p | p is the background frequency. |
t | numeric value of information content threshold for trimming. |
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 can be created by calls of the form
new("pfm", mat, name, alphabet, color, background)
.
signature(x="pfm",
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.
signature(x = "pfm",)
Calculate information content
profile for position frequency matrix.
signature(x = "matrix", p = "numeric")
Calculate
information content profile for matrix. p is the background frequency
signature(x = "pfm")
get the reverse
complement of position frequency matrix.
signature(x = "pfm")
Plots the sequence logo of the
position frequency matrix.
signature(x = "pfm", t= "numeric")
trim motif by
information content.
Get or set the slot of pfm-class
convert pfm-class
to a data.frame
return the name_pfm of pfm-class
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 <- pcm2pfm(pcm) motif <- new("pfm", 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 <- pcm2pfm(pcm) motif <- new("pfm", mat=motif, name="bin_SOLEXA") getIC(motif)#> V3 V4 V5 V6 V7 V8 V9 #> 0.5575323 1.6879104 2.0000000 1.7166385 2.0000000 1.5886941 1.7313686#> An object of class "pfm" #> Slot "mat": #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> A 0.04588015 0.05898876 0 0.01779026 0 0.94382022 0.02902622 #> C 0.00000000 0.01123596 0 0.00000000 0 0.00000000 0.47191011 #> G 0.00000000 0.92977528 0 0.02247191 0 0.05617978 0.06647940 #> T 0.95411985 0.00000000 1 0.95973783 1 0.00000000 0.43258427 #> #> 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() #>#> An object of class "pfm" #> Slot "mat": #> V3 V4 V5 V6 V7 V8 V9 #> A 0.25 0.43258427 0.00000000 1 0.95973783 1 0.00000000 0.95411985 #> C 0.25 0.06647940 0.05617978 0 0.02247191 0 0.92977528 0.00000000 #> G 0.25 0.47191011 0.00000000 0 0.00000000 0 0.01123596 0.00000000 #> T 0.25 0.02902622 0.94382022 0 0.01779026 0 0.05898876 0.04588015 #> #> 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() #>#> An object of class "pfm" #> Slot "mat": #> V3 V4 V5 V6 V7 V8 V9 #> A 0.43258427 0.00000000 1 0.95973783 1 0.00000000 0.95411985 0.25 0.25 0.25 #> C 0.06647940 0.05617978 0 0.02247191 0 0.92977528 0.00000000 0.25 0.25 0.25 #> G 0.47191011 0.00000000 0 0.00000000 0 0.01123596 0.00000000 0.25 0.25 0.25 #> T 0.02902622 0.94382022 0 0.01779026 0 0.05898876 0.04588015 0.25 0.25 0.25 #> #> 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() #>#> V3 V4 V5 V6 V7 V8 V9 #> A 0.43258427 0.00000000 1 0.95973783 1 0.00000000 0.95411985 #> C 0.06647940 0.05617978 0 0.02247191 0 0.92977528 0.00000000 #> G 0.47191011 0.00000000 0 0.00000000 0 0.01123596 0.00000000 #> T 0.02902622 0.94382022 0 0.01779026 0 0.05898876 0.04588015#> V3 V4 V5 V6 V7 V8 V9 #> A 0.43258427 0.00000000 1 0.95973783 1 0.00000000 0.95411985 #> C 0.06647940 0.05617978 0 0.02247191 0 0.92977528 0.00000000 #> G 0.47191011 0.00000000 0 0.00000000 0 0.01123596 0.00000000 #> T 0.02902622 0.94382022 0 0.01779026 0 0.05898876 0.04588015#> [1] "bin_SOLEXA_pfm"