<p>The tutorial in the <a href="http://eddylab.org/software/hmmer3/3.1b2/Userguide.pdf" rel="nofollow noreferrer">documentation</a> does indeed state what you quoted but a full description of the file format is given in Section 8 of the documentation, starting on page 106.</p>
<p>To summarise, as you noted, the number columns A-K is the alphabet size (the number of amino acids). The number of rows underneath is the number of nodes, which corresponds to the number of match states. The three numbers (-214, -210 and -18 in your example) are: the match emission, insert emission, and state transition values.</p>
<p>Caveat: The HMMER profile HMM format changes frequently between HMMER versions (even between minor versions) so there is no guarantee this information is correct for all the older file formats.</p>
<hr />
<p>Quoting the relevant part of the documentation on page 109:</p>
<blockquote>
<p><strong>main model section</strong></p>
<p>All the remaining fields are mandatory. The first
two lines in the main model section are atypical.‡ They contain
information for the core model’s BEGIN node. This is stored as model
node 0, and match state 0 is treated as the BEGIN state. The begin
state is mute, so there are no match emission probabilities. The first
line is the insert 0 emissions. The second line contains the
transitions from the begin state and insert state 0. These seven
numbers are: B → M1, B → I0, B → D1; I0 → M1, I0 → I0; then a 0.0 and
a ’<em>’, because by convention, nonexistent transitions from the
nonexistent delete state 0 are set to log 1 = 0 and log 0 = −∞ = ‘</em>’.</p>
<p>The remainder of the model has three lines per node, for M nodes
(where M is the number of match states, as given by the LENG line).
These three lines are (K is the alphabet size in residues):</p>
<p><strong>Match emission line</strong></p>
<p>The first field is the node number (1 . . . M). The
parser verifies this number as a consistency check (it expects the
nodes to come in order). The next K numbers for match emissions, one
per symbol, in alphabetic order. The next field is the MAP annotation
for this node. If MAP was yes in the header, then this is an integer,
representing the alignment column index for this match state
(1..alen); otherwise, this field is ‘-’. The next field is the CONS
consensus residue for this node. If CONS was yes in the header, then
this is a single character, representing the consensus residue
annotation for this match state; otherwise, this field is ‘-’. The
next field is the RF annotation for this node. If RF was yes in the
header, then this is a single character, representing the reference
annotation for this match state; otherwise, this field is ‘-’. The
next field is the MM mask value for this node. If MM was yes in the
header, then this is a single ’m’ character, indicating that the
position was identified as a masked position during model
construction; otherwise, this field is ‘-’. The next field is the CS
annotation for this node. If CS was yes, then this is a single
character, representing the consensus structure at this match state;
otherwise this field is ‘-’.</p>
<p><strong>Insert emission line</strong></p>
<p>The K fields on this
line are the insert emission scores, one per symbol, in alphabetic
order.</p>
<p><strong>State transition line</strong></p>
<p>The seven fields on this line are the
transitions for node k, in the order shown by the transition header
line: Mk → Mk+1, Ik, Dk+1; Ik → Mk+1, Ik; Dk → Mk+1, Dk+1. For
transitions from the final node M, match state M + 1 is interpreted as
the END state E, and there is no delete state M + 1; therefore the
final Mk → Dk+1 and Dk → Dk+1 transitions are always * (zero
probability), and the final Dk → Mk+1 transition is always 0.0
(probability 1.0).</p>
</blockquote>

CC BY-SA 3.0
2018-01-11T12:36:10.447Z
Thanks, Chris. I missed the later chapters. Sorry that was too quick of me.
A.Dumas
CC BY-SA 3.0
2018-01-11T09:39:39.470Z
2018-01-11T09:39:39.470Z
2020-06-18T08:30:41.743Z
Chris_Rands
<p>I want to understand what the hmmer Profile used in <a href="http://hmmer.org/" rel="noreferrer">hmmer</a>. </p>

<p>consider the profile </p>

<pre><code>HMMER2.0  [converted from 3.1b2]
NAME  aRNH_profile
LENG  121
ALPH  Amino
RF    no
CS    no
MAP   yes
NSEQ  34
DATE  Tue Apr 26 21:24:57 2016
XT       -8455     -4  -1000  -1000  -8455     -4  -8455     -4
NULT        -4  -8455
NULE       656  -1722     98    419   -333    475  -1125    239    250    947  -1073   -271    -50   -338    114    451    113    430  -2131   -717
HMM        A      C      D      E      F      G      H      I      K      L      M      N      P      Q      R      S      T      V      W      Y    
         m-&gt;m   m-&gt;i   m-&gt;d   i-&gt;m   i-&gt;i   d-&gt;m   d-&gt;d   b-&gt;m   m-&gt;e
           -6      *  -7932
     1    -214   -916   -565    694    862  -1448    512   -838    115  -1042    170   1348  -1481    369   -158   -290   -159   -625    -52   1675     1
     -    -210   -336    220    -37   -342    377     73   -669    210   -511   -732    404    423     70     27    439    205   -414   -161   -176
     -     -18  -6890  -7932   -894  -1115   -701  -1378    -18      *
     2     285    990  -2213  -1678   2305  -1819   -698    219  -1289   -140    545  -1167  -1835   -973  -1322   -424   1025    762   -559    377     2
     -    -210   -336    220    -37   -342    377     73   -669    210   -511   -732    404    423     70     27    439    205   -414   -161   -176
     -     -18  -6890  -7932   -894  -1115   -701  -1378      *      *
[....]
</code></pre>

<p>what exactly does each component mean? By definition a HMM $\lambda$ consist of an alphabet $V$ in my case twenty amino acids. Different states $S$ in our case main, insertion and deletion (beginning and end). And two probability matrices of state transitions and emission in certain state. </p>

<p>now if I look at the profile I can see that it has the allowed transitions<br>
<code>m-&gt;m   m-&gt;i   m-&gt;d   i-&gt;m   i-&gt;i   d-&gt;m   d-&gt;d   b-&gt;m   m-&gt;e</code> 
and all the amino acids, but what does each row in the table mean. I checked the manual from the documentation and it says rather ironically </p>

<blockquote>
  <p>If you were to look at this file (and you don’t have to – it’s
  intended for HMMER’s consumption, not yours), you’d see [part of my output]</p>
</blockquote>

<p>are these number translations of the probabilities in $[0,1]$  into another interval $[-x,+y]$? what is the meaning of the three rows under <code>A 1</code>  </p>

<pre><code>-124  
-210
 -18
</code></pre>

<p>Is this the transition matrix? It would be great if someone could explain this  or point to the correct reference. </p>

<hidden-markov-models>
What is the meaning of the Hmmer profile?
# What is the meaning of the Hmmer profile?

(Asked by: username_0 on 2018-01-10)

I want to understand what the hmmer Profile used in hmmer. 
consider the profile 
HMMER2.0  [converted from 3.1b2]
NAME  aRNH_profile
LENG  121
ALPH  Amino
RF    no
CS    no
MAP   yes
NSEQ  34
DATE  Tue Apr 26 21:24:57 2016
XT       -8455     -4  -1000  -1000  -8455     -4  -8455     -4
NULT        -4  -8455
NULE       656  -1722     98    419   -333    475  -1125    239    250    947  -1073   -271    -50   -338    114    451    113    430  -2131   -717
HMM        A      C      D      E      F      G      H      I      K      L      M      N      P      Q      R      S      T      V      W      Y    
         m->m   m->i   m->d   i->m   i->i   d->m   d->d   b->m   m->e
           -6      *  -7932
     1    -214   -916   -565    694    862  -1448    512   -838    115  -1042    170   1348  -1481    369   -158   -290   -159   -625    -52   1675     1
     -    -210   -336    220    -37   -342    377     73   -669    210   -511   -732    404    423     70     27    439    205   -414   -161   -176
     -     -18  -6890  -7932   -894  -1115   -701  -1378    -18      *
     2     285    990  -2213  -1678   2305  -1819   -698    219  -1289   -140    545  -1167  -1835   -973  -1322   -424   1025    762   -559    377     2
     -    -210   -336    220    -37   -342    377     73   -669    210   -511   -732    404    423     70     27    439    205   -414   -161   -176
     -     -18  -6890  -7932   -894  -1115   -701  -1378      *      *
[....]

what exactly does each component mean? By definition a HMM $\lambda$ consist of an alphabet $V$ in my case twenty amino acids. Different states $S$ in our case main, insertion and deletion (beginning and end). And two probability matrices of state transitions and emission in certain state. 
now if I look at the profile I can see that it has the allowed transitions
m->m   m->i   m->d   i->m   i->i   d->m   d->d   b->m   m->e 
and all the amino acids, but what does each row in the table mean. I checked the manual from the documentation and it says rather ironically 

If you were to look at this file (and you don’t have to – it’s
  intended for HMMER’s consumption, not yours), you’d see [part of my output]

are these number translations of the probabilities in $[0,1]$  into another interval $[-x,+y]$? what is the meaning of the three rows under A 1 
-124  
-210
 -18

Is this the transition matrix? It would be great if someone could explain this  or point to the correct reference.

**Tags:** hidden-markov-models

---

## 1 answers

### Answer by username_1 on 2018-01-11. Score: 1 | Accepted answer

The tutorial in the [documentation](http://eddylab.org/software/hmmer3/3.1b2/Userguide.pdf) does indeed state what you quoted but a full description of the file format is given in Section 8 of the documentation, starting on page 106.

To summarise, as you noted, the number columns A-K is the alphabet size (the number of amino acids). The number of rows underneath is the number of nodes, which corresponds to the number of match states. The three numbers (-214, -210 and -18 in your example) are: the match emission, insert emission, and state transition values.

Caveat: The HMMER profile HMM format changes frequently between HMMER versions (even between minor versions) so there is no guarantee this information is correct for all the older file formats.

---

Quoting the relevant part of the documentation on page 109:

> **main model section**
>
> All the remaining fields are mandatory. The first
> two lines in the main model section are atypical.‡ They contain
> information for the core model’s BEGIN node. This is stored as model
> node 0, and match state 0 is treated as the BEGIN state. The begin
> state is mute, so there are no match emission probabilities. The first
> line is the insert 0 emissions. The second line contains the
> transitions from the begin state and insert state 0. These seven
> numbers are: B → M1, B → I0, B → D1; I0 → M1, I0 → I0; then a 0.0 and
> a ’*’, because by convention, nonexistent transitions from the
> nonexistent delete state 0 are set to log 1 = 0 and log 0 = −∞ = ‘*’.
>
> The remainder of the model has three lines per node, for M nodes
> (where M is the number of match states, as given by the LENG line).
> These three lines are (K is the alphabet size in residues):
>
> **Match emission line**
>
> The first field is the node number (1 . . . M). The
> parser verifies this number as a consistency check (it expects the
> nodes to come in order). The next K numbers for match emissions, one
> per symbol, in alphabetic order. The next field is the MAP annotation
> for this node. If MAP was yes in the header, then this is an integer,
> representing the alignment column index for this match state
> (1..alen); otherwise, this field is ‘-’. The next field is the CONS
> consensus residue for this node. If CONS was yes in the header, then
> this is a single character, representing the consensus residue
> annotation for this match state; otherwise, this field is ‘-’. The
> next field is the RF annotation for this node. If RF was yes in the
> header, then this is a single character, representing the reference
> annotation for this match state; otherwise, this field is ‘-’. The
> next field is the MM mask value for this node. If MM was yes in the
> header, then this is a single ’m’ character, indicating that the
> position was identified as a masked position during model
> construction; otherwise, this field is ‘-’. The next field is the CS
> annotation for this node. If CS was yes, then this is a single
> character, representing the consensus structure at this match state;
> otherwise this field is ‘-’.
>
> **Insert emission line**
>
> The K fields on this
> line are the insert emission scores, one per symbol, in alphabetic
> order.
>
> **State transition line**
>
> The seven fields on this line are the
> transitions for node k, in the order shown by the transition header
> line: Mk → Mk+1, Ik, Dk+1; Ik → Mk+1, Ik; Dk → Mk+1, Dk+1. For
> transitions from the final node M, match state M + 1 is interpreted as
> the END state E, and there is no delete state M + 1; therefore the
> final Mk → Dk+1 and Dk → Dk+1 transitions are always \* (zero
> probability), and the final Dk → Mk+1 transition is always 0.0
> (probability 1.0).

> **Comments:**
> **username_0**: Thanks, Chris. I missed the later chapters. Sorry that was too quick of me.  

---

