View source: R/make_sinuc_PWMs.R
make_PWMs | R Documentation |
The given matrix (or simply a vector) is reshaped to have four rows for four nucleotides and a relevant number of columns.
make_PWMs(vec, add_pseudo_counts = TRUE, scale = TRUE, sinuc = TRUE)
vec |
A vector that will be reshaped into a PWM matrix of DNA sequences. Note that the matrix is formed by row. |
add_pseudo_counts |
Logical, taking values TRUE or FALSE, specifying whether or not pseudocounts are added to the matrix. |
scale |
Logical, taking values TRUE or FALSE, specifying whether or not the matrix is scaled column-wise, i.e., all columns summed to 1. |
sinuc |
Logical. Specify TRUE for mononucleotides (default), FALSE to for dinucleotides. |
A PWM. If sinuc is 'TRUE', the PWM has 4 rows corresponding to the 4 nucleotides (A, C, G, T) and the relevant number of columns (i.e., number of elements in given vector/4). If dinucleotide is selected, by setting 'sinuc' to 'FALSE', the PWM has 16 rows corresponding to the dinucleotide combinations of the four nucleotides (A, C, G, T) and the relevant number of columns (i.e., number of elements in given vector/16).
## Mononucleotides case
## Make a dummy PWM of dimensions 4 * 10 from a vector
vec <- runif(4*10)
pwm <- seqArchR::make_PWMs(vec = vec, add_pseudo_counts = FALSE)
## Dinucleotides case
res <- readRDS(system.file("extdata", "example_seqArchRresult.rds",
package = "seqArchR", mustWork = TRUE))
pwm <- seqArchR::make_PWMs(get_clBasVec_m(res,iter=1)[,1],
add_pseudo_counts = FALSE, sinuc = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.