Question: How to build HMM from position weight matrix?
gravatar for jespinoz
18 months ago by
jespinoz20 wrote:

Is there a way to convert a position weight matrix into a HMM that I can use with HMMER. I have a (n,m) matrix where each n_i is a position along the motif, each m_j is a nucleotide in {A, T, C, G}, and each i,j is the probability nucleotide m_j occurring at n_i.

For example, the following would be a 7 bp motif. I have longer ones but I just wanted to show this for an example. How can I convert this into a HMM that can be used with HMMER?

0.000000  0.009876  0.990124  0.000000
0.000420  0.968691  0.000420  0.030469
0.010086  0.989704  0.000000  0.000210
0.005884  0.000630  0.003362  0.990124
0.010506  0.979828  0.009036  0.000630
0.001471  0.007144  0.008405  0.982980
0.002732  0.986132  0.010717  0.000420
pwm hmm meme motif • 807 views
ADD COMMENTlink written 18 months ago by jespinoz20

I am not quite sure this is exactly what you need, but look at this article:

ADD REPLYlink written 18 months ago by natasha.sernova3.5k

This doesn't look like a typical position weight matrix but rather a matrix of probabilities at each position. A position weight matrix corresponds to the log of the frequencies normalized to a background model. Anyway, you could view it has an HMM (the values represent emission probabilities) so convert it into HMMER's text format.

ADD REPLYlink written 18 months ago by Jean-Karim Heriche19k

Interesting, I will check this out. I wasn't thinking about the additional fields that are left out of a probability matrix. I was naively using the terminology. So I need to have emission and transition state probabilites for a position weight matrix?

ADD REPLYlink written 18 months ago by jespinoz20

No, you need emission and transition probabilities for a HMM. A PWM only encodes the probabilities of seeing each nucleotide for every position. What I am suggesting is to view the PWM as a HMM by considering the PWM as giving emission probabilities with transition probabilities set to 1.

ADD REPLYlink written 18 months ago by Jean-Karim Heriche19k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1286 users visited in the last hour