Debian Codegraph @

documentation/userguide/tabular.tex

raw
1 \section{Tabular output formats}
2 \label{section:tabular}
3 \setcounter{footnote}{0}
4
5 \subsection{Target hits tables}
6
7 The \ccode{--tblout} output option in \prog{cmsearch} and
8 \prog{cmscan} produces \emph{target hits tables}. There are three
9 different formats of target hits table, which are both described
10 below. By default, both \prog{cmsearch} and \prog{cmscan} produce the
11 target hits table in \emph{format 1}. Format 1 is the only format that
12 was used by Infernal versions 1.1rc1 through 1.1.1. As of version
13 1.1.2, with \prog{cmscan}, the \ccode{--fmt 2} option can be used in
14 combination with \ccode{--tblout} to produce a target hits table in
15 the alternative \emph{format 2}. As of version 1.1.5, with
16 \prog{cmscan} or \prog{cmsearch}, the \ccode{--fmt 3} option can be
17 used to add two additional fields (sequence length and model length)
18 to the standard format 1 files. All three format target hits table
19 consist of one line for each different query/target comparison that
20 met the reporting thresholds, ranked by decreasing statistical
21 significance (increasing E-value).
22
23 \subsubsection{Target hits table format 1}
24
25 In the format 1 table, each line
26 consists of \textbf{18 space-delimited fields} followed by a free text
27 target sequence description, as follows:\footnote{The \ccode{tblout}
28 format is deliberately space-delimited (rather than tab-delimited)
29 and justified into aligned columns, so these files are suitable both
30 for automated parsing and for human examination. Tab-delimited data
31 files are difficult for humans to examine and spot check. For this
32 reason, we think tab-delimited files are a minor evil in the
33 world. Although we occasionally receive shrieks of outrage about
34 this, we stubbornly feel that space-delimited files are just as
35 trivial to parse as tab-delimited files.}
36
37 \begin{description}
38 \item[\emprog{(1) target name:}]
39 The name of the target sequence or profile.
40
41 \item[\emprog{(2) accession:}]
42 The accession of the target sequence or profile, or '-' if none.
43
44 \item[\emprog{(3) query name:}]
45 The name of the query sequence or profile.
46
47 \item[\emprog{(4) accession:}]
48 The accession of the query sequence or profile, or '-' if none.
49
50 \item[\emprog{(5) mdl (model):}] Which type of model was used to
51 compute the final score. Either 'cm' or 'hmm'. A CM is
52 used to compute the final hit scores unless the model has zero
53 basepairs or the \ccode{--hmmonly} option is used, in which case a
54 HMM will be used.
55
56 \item[\emprog{(6) mdl from (model coord):}]
57 The start of the alignment of this hit with respect to the
58 profile (CM or HMM), numbered 1..N for a profile of N consensus positions.
59
60 \item[\emprog{(7) mdl to (model coord):}]
61 The end of the alignment of this hit with respect to the
62 profile (CM or HMM), numbered 1..N for a profile of N consensus positions.
63
64 \item[\emprog{(8) seq from (ali coord):}]
65 The start of the alignment of this hit with respect to the
66 sequence, numbered 1..L for a sequence of L residues.
67
68 \item[\emprog{(9) seq to (ali coord):}]
69 The end of the alignment of this hit with respect to the
70 sequence, numbered 1..L for a sequence of L residues.
71
72 \item[\emprog{(10) strand:}]
73 The strand on which the hit occurs on the sequence. '+' if the hit is on
74 the top (Watson) strand, '-' if the hit is on the bottom (Crick) strand.
75 If on the top strand, the ``seq from'' value will be less than or
76 equal to the ``seq to'' value, else it will be greater than or equal
77 to it.
78
79 \item[\emprog{(11) trunc:}]
80 Indicates if this is predicted to be a truncated CM hit or not. This will be
81 ``no'' if it is a CM hit that is not predicted to be truncated by the end of the
82 sequence, ``5'\,'' or ``3'\,'' if the hit is predicted to have one or more
83 5' or 3' residues missing due to a artificial truncation of the
84 sequence, or ``5'\&3''' if the hit is predicted to have one or more
85 5' residues missing and one or more 3' residues missing.
86 If the hit is an HMM hit, this will always be '-'.
87
88 \item[\emprog{(12) pass:}]
89 Indicates what ``pass'' of the pipeline the hit was detected
90 on. This is probably only useful for testing and
91 debugging. Non-truncated hits are found on the first pass, truncated
92 hits are found on successive passes.
93
94 \item[\emprog{(13) gc:}]
95 Fraction of G and C nucleotides in the hit.
96
97 \item[\emprog{(14) bias:}] The biased-composition correction: the bit
98 score difference contributed by the null3 model for CM hits, or the
99 null2 model for HMM hits. High bias scores may be a red flag for a
100 false positive. It is difficult to correct for all possible ways in
101 which a nonrandom but nonhomologous biological sequences can appear
102 to be similar, such as short-period tandem repeats, so there are
103 cases where the bias correction is not strong enough (creating false
104 positives).
105
106 \item[\emprog{(15) score:}]
107 The score (in bits) for this target/query comparison. It includes
108 the biased-composition correction (the ``null3'' model for CM hits,
109 or the ``null2'' model for HMM hits).
110
111 \item[\emprog{(16) E-value:}] The expectation value (statistical
112 significance) of the target. This is a \emph{per query} E-value;
113 i.e.\ calculated as the expected number of false positives achieving
114 this comparison's score for a \emph{single} query against the search
115 space $Z$. For \prog{cmsearch} $Z$ is defined as the total number of
116 nucleotides in the target dataset multiplied by 2 because both strands
117 are searched. For \prog{cmscan} $Z$ is the total number of
118 nucleotides in the query sequence multiplied by 2 because both
119 strands are searched and multiplied by the number of models in the target
120 database. If you search with multiple queries and if you want to
121 control the \emph{overall} false positive rate of that search rather
122 than the false positive rate per query, you will want to multiply
123 this per-query E-value by how many queries you're doing.
124
125 \item[\emprog{(17) inc:}]
126 Indicates whether or not this hit achieves the inclusion threshold:
127 '!' if it does, '?' if it does not (and rather only achieves the
128 reporting threshold). By default, the inclusion threshold is an
129 E-value of 0.01 and the reporting threshold is an E-value of 10.0,
130 but these can be changed with command line options as described in
131 the manual pages.
132
133 \item[\emprog{(18) description of target:}]
134 The remainder of the line is the target's description line, as free text.
135 \end{description}
136
137 \subsubsection{Target hits table format 2}
138 \label{tabular-format2}
139
140 With the \prog{cmscan} program, the \ccode{--fmt 2} in combination with
141 \ccode{--tblout} option can be used to change the format of the
142 tabular output file for format 2 that includes additional information
143 on overlapping hits. Format 2 output is not possible from
144 \prog{cmsearch} because it is unable to calculate overlap information.
145 Format 2 includes all 18 of the fields from format 1 in the same order, plus 11
146 additional fields that are interspersed between some of the 18 from
147 format 1, as follows:
148
149 \begin{description}
150
151 \item[\emprog{(Before field 1 of format 1) idx:}]
152 The index of the hit in the list. The first hit has index '1', the
153 second has index '2', the Nth hit has index 'N'.
154
155 \item[\emprog{(Before field 5 of format 1) clan name:}]
156 The name of the clan the model for this hit belongs to, or \ccode{-} if
157 the model does not belong to a clan. A clan is a group of related
158 models. For example, Rfam groups three LSU rRNA models
159 (LSU\_rRNA\_archaea, LSU\_rRNA\_bacteria, and LSU\_rRNA\_eukarya)
160 into the same clan. The value in this field will always be \ccode{-}
161 unless the \ccode{--clanin <f>} option was used with
162 \ccode{cmscan} to specify clan/model relationships in the input file
163 \ccode{<f>}. See section~\ref{section:formats} for a description of
164 the format of the input file used with \ccode{--clanin}.
165
166 \end{description}
167
168 The following nine fields all occur in format 2 between fields 17
169 ('inc:') and 18 ('description of target') from format 1.
170
171 \begin{description}
172
173 \item[\emprog{olp:}] A single character indicating the overlap status
174 of this hit. Here, two hits are deemed to \emph{overlap} if they
175 share at least one nucleotide on the same strand of the same
176 sequence. There are four possible values in this field: \ccode{*},
177 \ccode{\^}, \ccode{\$} and \ccode{=}. \ccode{*} indicates this hit
178 does not overlap with any other reported hits. \ccode{\^} indicates
179 that this hit does overlap with at least one other hit, but none of
180 the hits that overlap with it have a lower E-value (occur above it in
181 the hit list). \ccode{\$} indicates that this hit does overlap with
182 at least one other hit that does have a lower E-value (occurs above
183 it in the hit list) but none of those higher scoring hits have
184 \ccode{\^} in this column. \ccode{=} indicates that this hit does
185 overlap with at least one other hit that has a lower E-value (occurs
186 above it in the hit list) and does itself have a \ccode{\^} in this
187 column. If the \ccode{--oclan} option was enabled, the definition of
188 \emph{overlap} for the designations of the four characters
189 \ccode{*}, \ccode{\^}, \ccode{\$} and \ccode{=} described above
190 changes to: two hits are deemed to \emph{overlap} if they share at
191 least one nucleotide on the same strand of the same sequence and
192 they are to models that are in the same clan. That is, only overlaps
193 between hits to models that are in the same clan are counted, all
194 other overlaps are ignored and not annotated. Infernal will never
195 report two overlapping hits to the same model.
196
197 \item[\emprog{anyidx:}]
198 For hits that have \ccode{=} in the ``olp'' field, this is the
199 index of the lowest E-value hit that overlaps with this hit.
200 For hits with either \ccode{*} or \ccode{\^} in the ``olp'' field,
201 this field will always be \ccode{-}. For hits with \ccode{\$} in the
202 ``olp'' field, the hit referred to in this field will itself have
203 ``='' in the ``olp'' field, or will be ``-1'' if that hit was skipped
204 (due to the ``--oskip'' option also having been used).
205
206 \item[\emprog{anyfrct1:}]
207 For hits that have \ccode{=} or \ccode{\$} in the ``olp'' field, this is the
208 fraction of the length of this hit that overlaps with the best scoring
209 overlapping hit (the hit index given in the ``anyidx'' field), to
210 4 significant digits.
211 For hits with \ccode{-} in the ``anyidx''
212 field, this field will always be \ccode{-}.
213
214 \item[\emprog{anyfrct2:}]
215 For hits that have \ccode{=} or \ccode{\$} in the ``olp'' field, this is the
216 fraction of the length of the best scoring overlapping hit (the hit
217 index given in the ``anyidx'' field) that overlaps with this hit,
218 to 4 significant digits.
219 For hits with \ccode{-} in the ``anyidx''
220 field, this field will always be \ccode{-}.
221
222 \item[\emprog{winidx:}]
223 For hits that have \ccode{=} in the ``olp'' field, this is either
224 \ccode{"} or the index of the best scoring hit that overlaps with this
225 hit that is marked as \ccode{\^} in the ``olp'' field. If the value
226 is \ccode{"} it means that the best scoring hit that overlaps with
227 this hit that is marked as \ccode{\^} in the ``olp'' field is
228 already listed in the ``anyidx'' field, which is usually the case.
229 For hits with either \ccode{*}, \ccode{\^} or \ccode{\$} in the ``olp'' field,
230 this field will always be \ccode{-}.
231
232 \item[\emprog{winfrct1:}]
233 For hits that have neither \ccode{-} nor \ccode{"} in the
234 ``winidx'' field, this is the fraction of the length of this hit
235 that overlaps with the best scoring overlapping hit marked with
236 \ccode{\^} in the ``olp'' field (the hit index given in the
237 ``winidx'' field), to 4 significant digits. For hits with either
238 \ccode{*}, \ccode{\^} or \ccode{\$} in the ``olp'' field, this field will
239 always be \ccode{-}. For hits with \ccode{-} in the ``winidx''
240 field, this field will always be \ccode{-}.
241 For hits with \ccode{"} in the ``winidx''
242 field, this field will always be \ccode{"}.
243
244 \item[\emprog{winfrct2:}]
245 For hits that have neither \ccode{-} nor \ccode{"} in the
246 ``"winidx'' field, this is the
247 fraction of the length of the best scoring overlapping hit marked with
248 \ccode{\^} in the ``olp'' field (the hit
249 index given in the ``winidx'' field) that overlaps with this hit,
250 to 4 significant digits.
251 For hits with either
252 \ccode{*}, \ccode{\^} or \ccode{\$} in the ``olp'' field, this field will
253 always be \ccode{-}. For hits with \ccode{-} in the ``winidx''
254 field, this field will always be \ccode{-}.
255 For hits with \ccode{"} in the ``winidx''
256 field, this field will always be \ccode{"}.
257
258 \item[\emprog{mdl len:}]
259 The consensus length of the profile (CM or HMM) for this hit.
260
261 \item[\emprog{seq len:}]
262 The total length of the sequence for this hit.
263
264 \end{description}
265
266 \subsubsection{Target hits table format 3}
267 \label{tabular-format3}
268
269 With the \prog{cmsearch} and \prog{cmscan} programs, the \ccode{--fmt 3}
270 in combination with \ccode{--tblout} option can be used to change
271 the format of the tabular output file to format 3 that includes all of
272 the fields in format 1 with two additional fields: the full length of
273 the sequence and model involved in each hit. The first 17 fields of
274 format 3 are identical to format 1, followed by the two additional
275 fields, and the final field is the ``description'' field from format
276 1. The two additional fields are:
277
278 \begin{description}
279
280 \item[\emprog{mdl len:}]
281 The consensus length of the profile (CM or HMM) for this hit.
282
283 \item[\emprog{seq len:}]
284 The total length of the sequence for this hit.
285
286 \end{description}
287
288 The tables are columnated neatly for human readability, but do not
289 write parsers that rely on this columnation; rely on space-delimited
290 fields. The pretty columnation assumes fixed maximum widths for each
291 field. If a field exceeds its allotted width, it will still be fully
292 represented and space-delimited, but the columnation will be disrupted
293 on the rest of the row.
294
295 Note the use of target and query columns. A program like
296 \prog{cmsearch} searches a query profile against a target sequence
297 database. In an \prog{cmsearch} tblout file, the sequence (target)
298 name is first, and the profile (query) name is second. A program like
299 \prog{cmscan}, on the other hand, searches a query sequence against a
300 target profile database. In a \prog{cmscan} tblout file, the profile
301 name is first, and the sequence name is second. You might say, hey,
302 wouldn't it be more consistent to put the profile name first and the
303 sequence name second (or vice versa), so \prog{cmsearch} and
304 \prog{cmscan} tblout files were identical? Well, they
305 still wouldn't be identical, because the target database size used for
306 E-value calculations is different (total number of target nucleotides
307 for \prog{cmsearch}, number of target profiles times target sequence
308 length for \prog{cmscan}), and it's good not to forget this.
309
310 If some of the descriptions of these fields don't make sense to you,
311 it may help to go through the tutorial in
312 section~\ref{section:tutorial} and read section~\ref{section:pipeline}
313 of the manual.
314