Conversion of pfm to pwm using PWM()
1
0
Entering edit mode
Ravi Karra ▴ 140
@ravi-karra-4463
Last seen 9.6 years ago
Hi, I am trying to find TF binding sites in a set of promoters using position frequency matrices (pfm's) from jaspar and transfac. I have gotten this to work before on my machine at home, but cannot seem to get this to run on campus. I am not sure why I get the following error as I thought PWM can handle integer pfm's. Any thoughts? Thanks in advance, Ravi Code: > library (Biostrings) > pfm [,1] [,2] [,3] [,4] [,5] [,6] A 13 0 50 1 13 6 C 14 0 2 0 6 16 G 15 53 0 1 25 22 T 11 0 1 51 9 9 > typeof (pfm) [1] "integer" > pwm = pfm (PWM) Error: could not find function "pfm" > library (Biostrings) > pfm [,1] [,2] [,3] [,4] [,5] [,6] A 13 0 50 1 13 6 C 14 0 2 0 6 16 G 15 53 0 1 25 22 T 11 0 1 51 9 9 > typeof (pfm) [1] "integer" > PWM (pfm) Error in function (classes, fdef, mtable) : unable to find an inherited method for function "PWM", for signature "matrix" > sessionInfo () R version 2.12.0 (2010-10-15) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doMC_1.2.1 multicore_0.1-5 foreach_1.3.0 codetools_0.2-2 [5] iterators_1.0.3 Biostrings_2.18.4 IRanges_1.8.9 biomaRt_2.6.0 loaded via a namespace (and not attached): [1] Biobase_2.10.0 RCurl_1.5-0 tools_2.12.0 XML_3.4-0
• 2.8k views
ADD COMMENT
0
Entering edit mode
@steve-lianoglou-2771
Last seen 14 months ago
United States
Hi, On Thu, May 26, 2011 at 6:51 PM, Ravi Karra <ravi.karra at="" gmail.com=""> wrote: > Hi, > I am trying to find TF binding sites in a set of promoters using position frequency matrices (pfm's) from jaspar and transfac. ?I have gotten this to work before on my machine at home, but cannot seem to get this to run on campus. ?I am not sure why I get the following error as I thought PWM can handle integer pfm's. ?Any thoughts? > > Thanks in advance, > Ravi > > Code: >> library (Biostrings) >> pfm > ?[,1] [,2] [,3] [,4] [,5] [,6] > A ? 13 ? ?0 ? 50 ? ?1 ? 13 ? ?6 > C ? 14 ? ?0 ? ?2 ? ?0 ? ?6 ? 16 > G ? 15 ? 53 ? ?0 ? ?1 ? 25 ? 22 > T ? 11 ? ?0 ? ?1 ? 51 ? ?9 ? ?9 >> typeof (pfm) > [1] "integer" >> pwm = pfm (PWM) > Error: could not find function "pfm" Were you just warming up your keyboard for the next step, or .. ? :-) >> library (Biostrings) >> pfm > ?[,1] [,2] [,3] [,4] [,5] [,6] > A ? 13 ? ?0 ? 50 ? ?1 ? 13 ? ?6 > C ? 14 ? ?0 ? ?2 ? ?0 ? ?6 ? 16 > G ? 15 ? 53 ? ?0 ? ?1 ? 25 ? 22 > T ? 11 ? ?0 ? ?1 ? 51 ? ?9 ? ?9 >> typeof (pfm) > [1] "integer" >> PWM (pfm) > Error in function (classes, fdef, mtable) ?: > ?unable to find an inherited method for function "PWM", for signature "matrix" >> sessionInfo () > R version 2.12.0 (2010-10-15) > Platform: x86_64-unknown-linux-gnu (64-bit) I'm not sure what to say, but this works for me. You can look at the output of `showMethods('PWM'), R 2.13/bioc-2.8 has a PWM method defined for matrix objects: R> showMethods('PWM') Function: PWM (package Biostrings) x="character" x="DNAStringSet" x="matrix" Maybe you have to upgrade to the latest version of R/bioc? Sorry, I don't have a version of R 2.12 lying around to test further ... you say it worked for you at home, maybe your cpu at home is running R 2.13? HTH, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
ADD COMMENT
0
Entering edit mode
Hi Ravi, Steve, Yes the "PWM" method for matrix objects is new in BioC 2.8 (R-2.13). It computes a Position Weight Matrix from a Position Frequency Matrix using the algorithm described in the Wasserman & Sandelin paper. See ?PWM for the details. Cheers, H. On 11-05-26 08:33 PM, Steve Lianoglou wrote: > Hi, > > On Thu, May 26, 2011 at 6:51 PM, Ravi Karra<ravi.karra at="" gmail.com=""> wrote: >> Hi, >> I am trying to find TF binding sites in a set of promoters using position frequency matrices (pfm's) from jaspar and transfac. I have gotten this to work before on my machine at home, but cannot seem to get this to run on campus. I am not sure why I get the following error as I thought PWM can handle integer pfm's. Any thoughts? >> >> Thanks in advance, >> Ravi >> >> Code: >>> library (Biostrings) >>> pfm >> [,1] [,2] [,3] [,4] [,5] [,6] >> A 13 0 50 1 13 6 >> C 14 0 2 0 6 16 >> G 15 53 0 1 25 22 >> T 11 0 1 51 9 9 >>> typeof (pfm) >> [1] "integer" >>> pwm = pfm (PWM) >> Error: could not find function "pfm" > > Were you just warming up your keyboard for the next step, or .. ? :-) > >>> library (Biostrings) >>> pfm >> [,1] [,2] [,3] [,4] [,5] [,6] >> A 13 0 50 1 13 6 >> C 14 0 2 0 6 16 >> G 15 53 0 1 25 22 >> T 11 0 1 51 9 9 >>> typeof (pfm) >> [1] "integer" >>> PWM (pfm) >> Error in function (classes, fdef, mtable) : >> unable to find an inherited method for function "PWM", for signature "matrix" >>> sessionInfo () >> R version 2.12.0 (2010-10-15) >> Platform: x86_64-unknown-linux-gnu (64-bit) > > I'm not sure what to say, but this works for me. > > You can look at the output of `showMethods('PWM'), R 2.13/bioc-2.8 has > a PWM method defined for matrix objects: > > R> showMethods('PWM') > Function: PWM (package Biostrings) > x="character" > x="DNAStringSet" > x="matrix" > > Maybe you have to upgrade to the latest version of R/bioc? Sorry, I > don't have a version of R 2.12 lying around to test further ... you > say it worked for you at home, maybe your cpu at home is running R > 2.13? > > HTH, > > -steve > -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fhcrc.org Phone: (206) 667-5791 Fax: (206) 667-1319
ADD REPLY

Login before adding your answer.

Traffic: 1001 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6