convert pfm object to PWM

pfm2pwm(x, N = 10000)

Arguments

x

an object of pfm or pcm or matrix

N

Total number of event counts used for pfm generation.

Value

A numeric matrix representing the Position Weight Matrix for PWM.

See also

Author

Jianhong Ou

Examples

library("MotifDb")
#> Loading required package: BiocGenerics
#> Loading required package: parallel
#> #> Attaching package: ‘BiocGenerics’
#> The following objects are masked from ‘package:parallel’: #> #> clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, #> clusterExport, clusterMap, parApply, parCapply, parLapply, #> parLapplyLB, parRapply, parSapply, parSapplyLB
#> The following object is masked from ‘package:motifStack’: #> #> as.data.frame
#> The following objects are masked from ‘package:stats’: #> #> IQR, mad, sd, var, xtabs
#> The following objects are masked from ‘package:base’: #> #> anyDuplicated, append, as.data.frame, basename, cbind, colnames, #> dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep, #> grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget, #> order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, #> rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply, #> union, unique, unsplit, which.max, which.min
#> Loading required package: S4Vectors
#> Loading required package: stats4
#> #> Attaching package: ‘S4Vectors’
#> The following objects are masked from ‘package:base’: #> #> expand.grid, I, unname
#> Loading required package: IRanges
#> Loading required package: GenomicRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: Biostrings
#> Loading required package: XVector
#> #> Attaching package: ‘Biostrings’
#> The following object is masked from ‘package:grid’: #> #> pattern
#> The following object is masked from ‘package:base’: #> #> strsplit
#> See system.file("LICENSE", package="MotifDb") for use restrictions.
matrix.fly <- query(MotifDb, "Dmelanogaster") pfm2pwm(matrix.fly[[1]])
#> 1 2 3 4 5 6 #> A 0.09058848 0.08109553 0.06942964 0.10678480 0.151543623 0.02239449 #> C 0.08933765 0.07813558 0.08247861 0.03444562 -0.141250984 -0.17397092 #> G 0.07250787 0.07182387 0.04168038 0.11645928 -0.007875448 -0.22545815 #> T 0.11415981 0.12357898 0.13127733 0.08067857 -0.088706937 0.15068829 #> 7 8 #> A 0.09887622 0.10206070 #> C 0.09341600 0.08565662 #> G 0.06059477 0.09743179 #> T 0.11023199 0.09029313