Debian Codegraph @

documentation/userguide/format_prior.tex

raw
1 % Documentation of Infernal's Dirichlet prior file format
2 %
3 % Uses no sectioning commands, so it may be included as a subsection of
4 % a section, or a section in a chapter of file formats.
5 % The .tex file that includes this one provides the \section{} header.
6 %
7 % SRE, Wed Apr 6 13:46:43 2005
8
9 A prior file is parsed into a number of whitespace-delimited,
10 non-comment fields. These fields are then interpreted in order. The
11 order and number of the fields is important. This is not a robust,
12 tag-value save file format.
13
14 All whitespace is ignored, including newlines. The number of fields
15 per line is unimportant.
16
17 Comments begin with a \verb+#+ character. The remainder of any line
18 following a \verb+#+ is ignored.
19
20 The Infernal source distribution includes an example prior file,
21 \prog{default.pri}. This prior is identical to the hardcoded default
22 prior used by Infernal. The following text may only make sense if
23 you're looking at that example while you read.
24
25 The order of the fields in the prior file is as follows:
26
27 \begin{description}
28 \item[\textbf{Strategy.}] The first field is the keyword
29 \emprog{Dirichlet}. Currently Dirichlet priors (mixture or not)
30 are the only prior strategy used by Infernal.
31
32 \item[\textbf{Transition prior section.}] The next field is the number
33 \emprog{74}, the number of different types of transition
34 distributions. (See Figure~\ref{fig:magic74} for an explanation of
35 where the number 74 comes from.) Then, for each of these 74
36 distributions:
37
38 \begin{description}
39 \item{\emprog{<from-uniqstate> <to-node>}:} Two fields give the
40 transition type: from a unique state identifier, to a node
41 identifier. Example: \emprog{MATP\_MP MATP}.
42
43 \item{\emprog{<n>}:} One field gives the number of transition
44 probabilities for this transition type; that is, the number of
45 Dirichlet parameter vector $\alpha^q_1..\alpha^q_n$ for each mixture
46 component $q$.
47
48 \item{\emprog{<nq>}:} One field gives the number of mixture
49 Dirichlet components for this transition type's prior. Then,
50 for each of these \emprog{nq} Dirichlet components:
51
52 \begin{description}
53 \item{\emprog{p(q)}:} One field gives the mixture coefficient $p(q)$,
54 the prior probability of this component $q$. For a single-component
55 ``mixture'', this is always 1.0.
56
57 \item{$\mathbf{\alpha^q_1..\alpha^q_n}$:} The next $n$ fields give the
58 Dirichlet parameter vector for this mixture component $q$.
59 \end{description}
60 \end{description}
61
62 \item[\textbf{Base pair emission prior section.}] This next section is
63 the prior for MATP\_MP emissions. One field gives \emprog{<K>}, the
64 ``alphabet size'' -- the number of base pair emission probabilities
65 -- which is always 16 (4x4), for RNA. The next field gives \emprog{<nq>}, the
66 number of mixture components. Then, for each of these \emprog{nq}
67 Dirichlet components:
68 \begin{description}
69 \item{\emprog{p(q)}:} One field gives the mixture coefficient $p(q)$,
70 the prior probability of this component $q$. For a single-component
71 ``mixture'', this is always 1.0.
72
73 \item{$\mathbf{\alpha^q_{AA}..\alpha^q_{UU}}$:} The next 16 fields give the
74 Dirichlet parameter vector for this mixture component, in alphabetical
75 order (AA, AC, AG, AU, CA \ldots GU, UA, UC, UG, UU).
76 \end{description}
77
78 \item[\textbf{Consensus singlet base emission prior section.}] This
79 next section is the prior for MATL\_ML and MATR\_MR emissions. One
80 field gives \emprog{<K>}, the ``alphabet size'' -- the number of
81 singlet emission probabilities -- which is always 4, for RNA. The
82 next field gives \emprog{<nq>}, the number of mixture components. Then,
83 for each of these \emprog{nq} Dirichlet components:
84 \begin{description}
85 \item{\emprog{p(q)}:} One field gives the mixture coefficient $p(q)$,
86 the prior probability of this component $q$. For a single-component
87 ``mixture'', this is always 1.0.
88
89 \item{$\mathbf{\alpha^q_A..\alpha^q_U}$:} The next 4 fields give the
90 Dirichlet parameter vector for this mixture component, in alphabetical
91 order (A, C, G, U).
92 \end{description}
93
94 \item[\textbf{Nonconsensus singlet base emission prior section.}] This
95 next section is the prior for insertions (MATP\_IL, MATP\_IR,
96 MATL\_IL, MATR\_IR, ROOT\_IL, ROOT\_IR, BEGR\_IL) as well as
97 nonconsensus singlets (MATP\_ML, MATP\_MR).
98 One field gives \emprog{<K>}, the ``alphabet size'' -- the number of
99 singlet emission probabilities -- which is always 4, for RNA.
100 The next field gives \emprog{<nq>}, the
101 number of mixture components. Then, for each of these \emprog{nq}
102 Dirichlet components:
103 \begin{description}
104 \item{\emprog{p(q)}:} One field gives the mixture coefficient $p(q)$,
105 the prior probability of this component $q$. For a single-component
106 ``mixture'', this is always 1.0.
107
108 \item{$\mathbf{\alpha^q_A..\alpha^q_U}$:} The next 4 fields give the
109 Dirichlet parameter vector for this mixture component, in alphabetical
110 order (A, C, G, U).
111 \end{description}
112 \end{description}
113
114
115 \begin{figure}[htp]
116 \begin{center}
117 \includegraphics{Figures/stl9-63}
118 \end{center}
119 \caption{\small\textbf{Where does the magic number of 74 transition
120 distribution types come from?} The transition distributions are
121 indexed in a 2D array, from a unique statetype (20 possible) to a
122 downstream node (8 possible), so the total conceivable number of
123 different distributions is $20 \times 8 = 160$. The grid represents
124 these possibilities by showing the $8 \times 8$ array of all node
125 types to all node types; each starting node contains 1 or more unique
126 states (number in parentheses to the left).
127 Two rows are impossible (gray): bifurcations automatically transit to
128 determined BEGL, BEGR states with probability 1, and end nodes have no
129 transitions. Three columns are impossible (gray): BEGL and BEGR can
130 only be reached by probability 1 transitions from a bifurcation, and
131 the ROOT node is special and can only start a model.
132 Eight individual cells of the grid are unused (black) because of the
133 way \prog{cmbuild} (almost) unambiguously constructs a guide tree from
134 a consensus structure. These cases are numbered as follows. (1) BEGL
135 and BEGR never transit to END; this would imply an empty
136 substructure. A bifurcation is only used if both sides of the split
137 contain at least one consensus pair (MATP). (2) ROOT never transits to
138 END; this would imply an alignment with zero consensus
139 columns. Infernal models assume $\geq 1$ consensus columns. (3) MATR
140 never transits to END. Infernal always uses MATL for unpaired columns
141 whenever possible. MATR is only used for internal loops,
142 multifurcation loops, and 3' bulges, so MATR must always be followed
143 by a BIF, MATP, or another MATR. (4) BEGL never transits to MATR. The
144 single stranded region between two bifurcated stems is unambiguously
145 assigned to MATL nodes on the right side of the split, not to MATR
146 nodes on the left. (5) MATR never transits to MATL. The only place
147 where this could arise (given that we already specified that MATL is
148 used whenever possible) is in an interior loop; there, by unambiguous
149 convention, MATL nodes precede MATR nodes. (6) BEGL nodes never
150 transit to MATL, and BEGR nodes never transit to MATR. By convention,
151 at any bifurcated subsequence $i,j$, $i$ and $j$ are paired but not to
152 each other. That is, the smallest possible subsequence is bifurcated,
153 so that any single stranded stretches to the left and right are
154 assigned to MATL and MATR nodes above the bifurcation, instead of MATL
155 nodes below the BEGL and MATR nodes below the BEGR.
156 Thus, the total number 74 comes from multiplying, for each row, the
157 number of unique states in each starting node by the number of
158 possible downstream nodes (white), and summing these up, as shown to
159 the left of the grid.}
160 \label{fig:magic74}
161 \end{figure}