Debian Codegraph @

easel/miniapps/esl-alimask.man.in

raw
1 .TH "esl\-alimask" 1 "@EASEL_DATE@" "Easel @EASEL_VERSION@" "Easel Manual"
2
3 .SH NAME
4 esl\-alimask \- remove columns from a multiple sequence alignment
5
6 .SH SYNOPSIS
7
8 .nf
9 \fBesl\-alimask \fR[\fIoptions\fR] \fImsafile maskfile\fR
10 (remove columns based on a mask in an input file)
11
12 \fBesl\-alimask \-t \fR[\fIoptions\fR] \fImsafile coords\fR
13 (remove a contiguous set of columns at the start and end of an alignment)
14
15 \fBesl\-alimask \-g \fR[\fIoptions\fR] \fImsafile\fR
16 (remove columns based on their frequency of gaps)
17
18 \fBesl\-alimask \-p \fR[\fIoptions\fR] \fImsafile\fR
19 (remove columns based on their posterior probability annotation)
20
21 \fBesl\-alimask \-\-rf\-is\-mask \fR[\fIoptions\fR] \fImsafile\fR
22 (only remove columns that are gaps in the RF annotation)
23
24 The \fB\-g\fR and \fB\-p\fR options may be used in combination.
25 .fi
26
27
28 .SH DESCRIPTION
29
30 .B esl\-alimask
31 reads a single input alignment, removes some columns from it
32 (i.e. masks it), and outputs the masked alignment.
33
34 .PP
35 .B esl\-alimask
36 can be run in several different modes.
37
38 .PP
39 .B esl\-alimask
40 runs in "mask file mode" by default when two
41 command-line arguments (\fImsafile\fR and \fImaskfile\fR)
42 are supplied. In this mode, a bit-vector mask in the
43 .I maskfile
44 defines which columns to keep/remove. The mask is a string that may
45 only contain the characters '0' and '1'. A '0' at position x of the
46 mask indicates that column x is excluded by the mask and should be
47 removed during masking. A '1' at position x of the mask indicates
48 that column x is included by the mask and should not be removed during
49 masking. All lines in the
50 .I maskfile
51 that begin with '#' are considered comment lines and are ignored. All
52 non-whitespace characters in non-comment lines are considered to be
53 part of the mask. The length of the mask must equal either the total
54 number of columns in the (first) alignment in
55 .I msafile,
56 or the number of columns that are not gaps in the RF annotation of that
57 alignment. The latter case is only valid if
58 .I msafile
59 is in Stockholm format and contains '#=GC RF' annotation.
60 If the mask length is equal to the non-gap RF length, all gap
61 RF columns will automatically be removed.
62
63 .PP
64 .B esl\-alimask
65 runs in "truncation mode" if the
66 .B \-t
67 option is used along with two command line arguments
68 (\fImsafile\fR and \fIcoords\fR). In this mode,
69 the alignment will be truncated by removing a contiguous set of
70 columns from the beginning and end of the alignment. The second
71 command line argument is the
72 .I coords
73 string, that specifies what range of columns to keep in the
74 alignment, all columns outside of this range will be removed.
75 The
76 .I coords
77 string consists of start and end coordinates separated
78 by any nonnumeric, nonwhitespace character or characters you like; for
79 example,
80 .BR 23..100 ,
81 .BR 23/100 ,
82 or
83 .B 23\-100
84 all work. To keep all alignment columns beginning at 23 until the
85 end of the alignment, you
86 can omit the end; for example,
87 .B 23:
88 would work.
89 If the
90 .B \-\-t\-rf
91 option is used in combination with
92 .B \-t,
93 the coordinates in
94 .I coords
95 are interpreted as non-gap RF column coordinates. For example,
96 with
97 .B \-\-t\-rf,
98 a
99 .I coords
100 string of
101 .B 23\-100
102 would remove all columns before the 23rd non-gap residue in
103 the "#=GC RF" annotation and after the 100th non-gap RF residue.
104
105 .PP
106 .B esl\-alimask
107 runs in "RF mask" mode if the
108 .B \-\-rf\-is\-mask
109 option is enabled. In this mode, the alignment must be in Stockholm
110 format and contain '#=GC RF' annotation.
111 .B esl\-alimask
112 will simply remove all columns that are gaps in the RF annotation.
113
114 .PP
115 .B esl\-alimask
116 runs in "gap frequency mode" if
117 .B \-g
118 is enabled. In this mode columns for which greater than
119 .I <f>
120 fraction of the aligned sequences have gap residues will be removed.
121 By default,
122 .I <f>
123 is 0.5, but this value can be changed to
124 .I <f>
125 with the
126 .BI \-\-gapthresh " <f>"
127 option. In this mode, if the alignment is in Stockholm format and
128 has RF annotation, then all columns that are gaps in the RF annotation
129 will automatically be removed, unless
130 .B \-\-saveins
131 is enabled.
132
133 .PP
134 .B esl\-alimask
135 runs in "posterior probability mode" if
136 .B \-p
137 is enabled. In this mode, masking is based on posterior probability annotation,
138 and the input alignment must be in Stockholm format and contain '#=GR
139 PP' (posterior probability) annotation for all sequences. As a special
140 case, if
141 .B \-p
142 is used in combination with
143 .B \-\-ppcons,
144 then the input alignment need not have '#=GR PP' annotation, but must
145 contain '#=GC PP_cons' (posterior probability consensus) annotation.
146
147 .PP
148 Characters in Stockholm alignment posterior probability annotation
149 (both '#=GR PP' and '#=GC PP_cons') can have 12 possible values: the
150 ten digits '0-9', '*', and '.'. If '.', the position must correspond to
151 a gap in the sequence (for '#=GR PP') or in the RF annotation (for '#=GC
152 PP_cons'). A value of '0' indicates a posterior probability of
153 between 0.0 and 0.05, '1' indicates between 0.05 and 0.15, '2'
154 indicates between 0.15 and 0.25 and so on up to '9' which indicates
155 between 0.85 and 0.95. A value of '*' indicates a posterior
156 probability of between 0.95 and 1.0. Higher posterior probabilities
157 correspond to greater confidence that the aligned residue belongs
158 where it appears in the alignment.
159
160 .PP
161 When
162 .B \-p
163 is enabled with
164 .BI \-\-ppcons " <x>",
165 columns which have a consensus posterior probability of less than
166 .I <x>
167 will be removed during masking, and all other columns will not be removed.
168
169 .PP
170 When
171 .B \-p
172 is enabled without
173 .B \-\-ppcons,
174 the number of each possible PP value in each column is counted.
175 If
176 .I <x>
177 fraction of the sequences that contain aligned residues (i.e. do not
178 contain gaps) in a column have a posterior probability
179 greater than or equal to
180 .I <y>,
181 then that column will not be removed during masking. All columns that
182 do not meet this criterion will be removed. By default, the values of both
183 .I <x>
184 and
185 .I <y>
186 are 0.95, but they can be changed with the
187 .BI \-\-pfract " <x>"
188 and
189 .BI \-\-pthresh " <y>"
190 options, respectively.
191
192 .PP
193 In posterior probability mode, all columns that have 0 residues
194 (i.e. that are 100% gaps) will be automatically removed, unless the
195 .B \-\-pallgapok
196 option is enabled, in which case such columns will not be removed.
197
198 .PP
199 Importantly, during posterior probability masking, unless
200 .B \-\-pavg
201 is used, PP annotation
202 values are always considered to be the minimum numerical value in
203 their corresponding range. For example, a PP '9' character is converted
204 to a numerical posterior probability of 0.85. If
205 .B \-\-pavg
206 is used, PP annotation values are considered to be the average
207 numerical value in their range. For example, a PP '9' character is
208 converted to a numerical posterior probability of 0.90.
209
210 .PP
211 In posterior probability mode, if the alignment is in Stockholm format and
212 has RF annotation, then all columns that are gaps in the RF annotation
213 will automatically be removed, unless
214 .B \-\-saveins
215 is enabled.
216
217 .PP
218 A single run of
219 .B esl\-alimask
220 can perform both gap frequency-based masking and posterior
221 probability-based masking if both the
222 .B \-g
223 and
224 .B \-p
225 options are enabled. In this case, a gap frequency-based mask and a
226 posterior probability-based mask are independently computed. These
227 two masks are combined to create the final mask using a logical 'and'
228 operation. Any column that is to be removed by either the gap or PP
229 mask will be removed by the final mask.
230
231 .PP
232 With the
233 .B \-\-small
234 option,
235 .B esl\-alimask
236 will operate in memory saving mode and the required RAM for the masking
237 will be minimal (usually less than a Mb) and independent of the
238 alignment size. To use
239 .BR \-\-small ,
240 the alignment alphabet must be specified with either
241 .BR \-\-amino ,
242 .BR \-\-dna ,
243 or
244 .BR \-\-rna ,
245 and the alignment must be in Pfam format (non-interleaved, 1
246 line/sequence Stockholm format). Pfam format is the default output
247 format of INFERNAL's
248 .B cmalign
249 program. Without
250 .B \-\-small
251 the required RAM will be equal to roughly the size of the first input
252 alignment (the size of the alignment file itself if it only contains
253 one alignment).
254
255
256 .SH OUTPUT
257
258 By default,
259 .B esl\-alimask
260 will print only the masked alignment to stdout and then exit.
261 If the
262 .BI \-o " <f>"
263 option is used, the alignment will be saved to file
264 .I <f>
265 , and information on the number of columns kept and removed will be
266 printed to stdout. If
267 .B \-q
268 is used in combination with
269 .BR \-o ,
270 nothing is printed to stdout.
271
272 .PP
273 The mask(s) computed by
274 .B esl\-alimask
275 when the
276 .BR \-t ,
277 .BR \-p ,
278 .BR \-g ,
279 or
280 .B \-\-rf\-is\-mask
281 options are used can be saved to output files using the options
282 \fB\-\-fmask\-rf\fR\fI <f>\fR,
283 \fB\-\-fmask\-all\fR\fI <f>\fR,
284 \fB\-\-gmask\-rf\fR\fI <f>\fR,
285 \fB\-\-gmask\-all\fR\fI <f>\fR,
286 \fB\-\-pmask\-rf\fR\fI <f>\fR, and
287 \fB\-\-pmask\-all\fR\fI <f>\fR.
288 In all cases,
289 .I <f>
290 will contain a single line, a bit vector of length
291 .I <n>,
292 where
293 .I <n>
294 is the either the total number of columns in the alignment (for the
295 options suffixed with 'all') or the number of non-gap columns in the
296 RF annotation (for the options suffixed with 'rf'). The mask will be a
297 string of '0' and '1' characters: a '0' at position x in the mask
298 indicates column x was removed (excluded) by the mask, and a '1' at
299 position x indicates column x was kept (included) by the mask. For
300 the 'rf' suffixed options, the mask only applies to non-gap RF
301 columns. The options beginning with 'f' will save the 'final' mask
302 used to keep/remove columns from the alignment. The options beginning
303 with 'g' save the masks based on gap frequency and require
304 .BR \-g .
305 The options beginning with 'p' save the masks based on posterior
306 probabilities and require
307 .BR \-p .
308
309
310 .SH OPTIONS
311
312 .TP
313 .B \-h
314 Print brief help; includes version number and summary of
315 all options, including expert options.
316
317 .TP
318 .BI \-o " <f>"
319 Output the final, masked alignment to file
320 .I <f>
321 instead of to stdout.
322 When this option is used, information about the number of columns
323 kept/removed is printed to stdout.
324
325 .TP
326 .B \-q
327 Be quiet; do not print anything to stdout.
328 This option can only be used in combination with the
329 .B \-o
330 option.
331
332 .TP
333 .B \-\-small
334 Operate in memory saving mode. Required RAM will be independent of the
335 size of the input alignment to mask, instead of roughly the size of the
336 input alignment. When enabled, the alignment must be in
337 Pfam Stockholm (non-interleaved 1 line/seq) format (see
338 .BR esl\-reformat )
339 and the output alignment will be in Pfam format.
340
341 .TP
342 .BI \-\-informat " <s>"
343 Assert that input
344 .I msafile
345 is in alignment format
346 .IR <s> .
347 Common choices for
348 .I <s>
349 include:
350 .BR stockholm ,
351 .BR a2m ,
352 .BR afa ,
353 .BR psiblast ,
354 .BR clustal ,
355 .BR phylip .
356 For more information, and for codes for some less common formats,
357 see main documentation.
358 The string
359 .I <s>
360 is case-insensitive (\fBa2m\fR or \fBA2M\fR both work).
361 Default is
362 .B stockholm
363 format, unless
364 .B \-\-small
365 is used, in which case
366 .B pfam
367 format (non-interleaved Stockholm) is assumed.
368
369 .TP
370 .BI \-\-outformat " <s>"
371 Write the output
372 .I msafile
373 in alignment format
374 .IR <s> .
375 Common choices for
376 .I <s>
377 include:
378 .BR stockholm ,
379 .BR a2m ,
380 .BR afa ,
381 .BR psiblast ,
382 .BR clustal ,
383 .BR phylip .
384 The string
385 .I <s>
386 is case-insensitive (\fBa2m\fR or \fBA2M\fR both work).
387 Default is
388 .BR stockholm ,
389 unless
390 .B \-\-small
391 is enabled, in which case
392 .B pfam
393 (noninterleaved Stockholm) is the default output format.
394
395
396 .TP
397 .BI \-\-fmask\-rf " <f>"
398 Save the non-gap RF-length final mask used to mask the alignment
399 to file
400 .IR <f> .
401 The input alignment must be in Stockholm format and contain '#=GC RF'
402 annotation for this option to be valid. See the OUTPUT section above for
403 more details on output mask files.
404
405 .TP
406 .BI \-\-fmask\-all " <f>"
407 Save the full alignment-length final mask used to mask the alignment
408 to file
409 .IR <f> .
410 See the OUTPUT section above for more details on output mask files.
411
412 .TP
413 .B \-\-amino
414 Specify that the input alignment is a protein alignment.
415 By default,
416 .B esl\-alimask
417 will try to autodetect the alphabet, but if the alignment is
418 sufficiently small it may be ambiguous. This option defines the
419 alphabet as protein. Importantly, if
420 .B \-\-small
421 is enabled, the alphabet must be specified with either
422 .BR \-\-amino ,
423 .BR \-\-dna ,
424 or
425 .BR \-\-rna .
426
427 .TP
428 .B \-\-dna
429 Specify that the input alignment is a DNA alignment.
430
431 .TP
432 .B \-\-rna
433 Specify that the input alignment is an RNA alignment.
434
435 .TP
436 .B \-\-t\-rf
437 With
438 .BR \-t ,
439 specify that the start and end coordinates defined in
440 the second command line argument
441 .I coords
442 correspond to non-gap RF coordinates. To use this option, the
443 alignment must be in Stockholm format and have "#=GC RF"
444 annotation. See the DESCRIPTION section for an example of using the
445 .B \-\-t\-rf
446 option.
447
448 .TP
449 .B \-\-t\-rmins
450 With
451 .BR \-t ,
452 specify that all columns that are gaps in the reference (RF)
453 annotation in between the specified start and end coordinates be
454 removed. By default, these columns will be kept.
455 To use this option, the alignment must be in Stockholm format and
456 have "#=GC RF" annotation.
457
458 .TP
459 .BI \-\-gapthresh " <x>"
460 With
461 .BR \-g ,
462 specify that a column is kept (included by mask) if no more
463 than
464 .I <f>
465 fraction of sequences in the alignment have a gap ('.', '\-', or '_')
466 at that position. All other columns are removed (excluded by mask).
467 By default,
468 .I <x>
469 is 0.5.
470
471 .TP
472 .BI \-\-gmask\-rf " <f>"
473 Save the non-gap RF-length gap frequency-based mask used to mask the alignment
474 to file
475 .IR <f> .
476 The input alignment must be in Stockholm format and contain '#=GC RF'
477 annotation for this option to be valid. See the OUTPUT section above for
478 more details on output mask files.
479
480 .TP
481 .BI \-\-gmask\-all " <f>"
482 Save the full alignment-length gap frequency-based mask used to mask the alignment
483 to file
484 .IR <f> .
485 See the OUTPUT section above for more details on output mask files.
486
487
488 .TP
489 .BI \-\-pfract " <x>"
490 With
491 .BR \-p ,
492 specify that a column is kept (included by mask) if the
493 fraction of sequences with a non-gap residue in that column with a
494 posterior probability of at least
495 .I <y>
496 (from \fB\-\-pthresh\fR\fI <y>\fR) is
497 .I <x>
498 or greater. All other columns are removed (excluded by mask).
499 By default
500 .I <x>
501 is 0.95.
502
503 .TP
504 .BI \-\-pthresh " <y>"
505 With
506 .BR \-p ,
507 specify that a column is kept (included by mask) if
508 .I <x>
509 (from \fB\-\-pfract \fR\fI<x>\fR)
510 fraction of sequences with a non-gap residue in that column have a
511 posterior probability of at least
512 .IR <y> .
513 All other columns are removed (excluded by mask).
514 By default
515 .I <y>
516 is 0.95. See the DESCRIPTION section for more on
517 posterior probability (PP) masking.
518 Due to the granularity of the PP annotation, different
519 .I <y>
520 values within a range covered by a single PP character will be
521 have the same effect on masking. For example, using
522 .B \-\-pthresh 0.86
523 will have the same effect as using
524 \fB\-\-pthresh 0.94\fR.
525
526 .TP
527 .BI \-\-pavg " <x>"
528 With
529 .BR \-p ,
530 specify that a column is kept (included by mask) if
531 the average posterior probability of non-gap residues in that column
532 is at least
533 .IR <x> .
534 See the DESCRIPTION section for more on
535 posterior probability (PP) masking.
536
537 .TP
538 .BI \-\-ppcons " <x>"
539 With
540 .BR \-p ,
541 use the '#=GC PP_cons' annotation to define which columns to
542 keep/remove. A column is kept (included by mask) if the PP_cons value
543 for that column is
544 .I <x>
545 or greater. Otherwise it is removed.
546
547 .TP
548 .B \-\-pallgapok
549 With
550 .BR \-p ,
551 do not automatically remove any columns that are 100% gaps
552 (i.e. contain 0 aligned residues). By default, such columns will be
553 removed.
554
555 .TP
556 .BI \-\-pmask\-rf " <f>"
557 Save the non-gap RF-length posterior probability-based mask used to mask the alignment
558 to file
559 .IR <f> .
560 The input alignment must be in Stockholm format and contain '#=GC RF'
561 annotation for this option to be valid. See the OUTPUT section above for
562 more details on output mask files.
563
564 .TP
565 .BI \-\-pmask\-all " <f>"
566 Save the full alignment-length posterior probability-based mask used to mask the alignment
567 to file
568 .IR <f> .
569 See the OUTPUT section above for more details on output mask files.
570
571
572 .TP
573 .B \-\-keepins
574 If
575 .B \-p
576 and/or
577 .B \-g
578 is enabled and the alignment is in Stockholm or Pfam format and has '#=GC RF'
579 annotation, then allow columns that are gaps in the RF annotation to
580 possibly be kept. By default, all gap RF columns would be removed
581 automatically, but with this option enabled gap and non-gap RF columns
582 are treated identically.
583 To automatically remove all gap RF columns when using a
584 .I maskfile
585 , then define the mask in
586 .I maskfile
587 as having length equal to the non-gap RF length in the alignment.
588 To automatically remove all gap RF columns when using
589 .B \-t,
590 use the
591 .B \-\-t\-rmins
592 option.
593
594
595
596
597
598
599
600
601 .SH SEE ALSO
602
603 .nf
604 @EASEL_URL@
605 .fi
606
607 .SH COPYRIGHT
608
609 .nf
610 @EASEL_COPYRIGHT@
611 @EASEL_LICENSE@
612 .fi
613
614 .SH AUTHOR
615
616 .nf
617 http://eddylab.org
618 .fi