R/Modstrings-letterFrequency.R
letterFrequency.RdThese functions follow the same principle as the
Biostrings functions. Please be
aware, that the matices can become quite large, since the alphabet of
ModString objects contains more letters.
# S4 method for class 'ModDNAString'
hasOnlyBaseLetters(x)
# S4 method for class 'ModRNAString'
hasOnlyBaseLetters(x)
# S4 method for class 'ModDNAString'
alphabetFrequency(x, as.prob = FALSE, baseOnly = FALSE)
# S4 method for class 'ModRNAString'
alphabetFrequency(x, as.prob = FALSE, baseOnly = FALSE)
# S4 method for class 'ModDNAStringSet'
alphabetFrequency(x, as.prob = FALSE, collapse = FALSE, baseOnly = FALSE)
# S4 method for class 'ModRNAStringSet'
alphabetFrequency(x, as.prob = FALSE, collapse = FALSE, baseOnly = FALSE)
# S4 method for class 'MaskedModString'
alphabetFrequency(x, as.prob = FALSE, ...)
# S4 method for class 'ModStringViews'
letterFrequency(x, letters, OR = "|", as.prob = FALSE, ...)
# S4 method for class 'MaskedModString'
letterFrequency(x, letters, OR = "|", as.prob = FALSE)
# S4 method for class 'ModStringSet'
consensusMatrix(x, as.prob = FALSE, shift = 0L, width = NULL, baseOnly = FALSE)
# S4 method for class 'ModDNAStringSet'
consensusString(x, threshold = 0.25, shift = 0L, width = NULL)
# S4 method for class 'ModRNAStringSet'
consensusString(x, threshold = 0.25, shift = 0L, width = NULL)
# S4 method for class 'ModStringViews'
consensusString(x, threshold, shift = 0L, width = NULL)a ModString, a ModStringSet,
a ModStringViews or a MaskedModString object.
TRUE or FALSE (default): Should the result be
returned as probabilities instead of counts? (sum per column = 1)
TRUE or FALSE (default): Should the result omit
occurances of the letters N.-+?
TRUE or FALSE (default): Should the results
summed up all elements for ModStringSet or ModStringViews
objects or reported per element.
See letterFrequency.
See letterFrequency.
See letterFrequency.
See letterFrequency.
See letterFrequency.
Since the amiguityMap is fixed to "?" for
ModString objects, only the treshold can be set (default
threshold = 0.25)
a matrix with the results (letter x pos).
mod <- ModDNAString(paste(alphabet(ModDNAString()), collapse = ""))
mod
#> 55-letter ModDNAString object
#> seq: ACGTN-+.pδO]DJeg`bU∝πI763218∉⊆⊇Rαmh×f4νX'κo()ηa⇓⇑"√/≡ζ~
hasOnlyBaseLetters(mod)
#> [1] FALSE
alphabetFrequency(mod)
#> A C G T N - + . p δ O ] D J e g ` b U ∝ π I 7 6 3 2 1 8 ∉ ⊆ ⊇ R α m h × f 4 ν X
#> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> ' κ o ( ) η a ⇓ ⇑ " √ / ≡ ζ ~
#> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1