[BioC] Conversion of pfm to pwm using PWM()
Hervé Pagès
hpages at fhcrc.org
Fri May 27 08:52:52 CEST 2011
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
More information about the Bioconductor
mailing list