2 # = lib/evo/apps/msa_processor.rb - MsaProcessor class
4 # Copyright:: Copyright (C) 2006-2007 Christian M. Zmasek
5 # License:: GNU Lesser General Public License (LGPL)
7 # $Id: msa_processor.rb,v 1.33 2010/12/13 19:00:10 cmzmasek Exp $
13 require 'lib/evo/util/constants'
14 require 'lib/evo/util/util'
15 require 'lib/evo/util/command_line_arguments'
16 require 'lib/evo/msa/msa_factory'
17 require 'lib/evo/io/msa_io'
18 require 'lib/evo/io/writer/phylip_sequential_writer'
19 require 'lib/evo/io/writer/nexus_writer'
20 require 'lib/evo/io/writer/fasta_writer'
21 require 'lib/evo/io/parser/fasta_parser'
22 require 'lib/evo/io/parser/general_msa_parser'
23 require 'lib/evo/io/writer/msa_writer'
30 PRG_DATE = "2010.03.19"
31 PRG_DESC = "processing of multiple sequence alignments"
33 COPYRIGHT = "2008-2010 Christian M Zmasek"
34 CONTACT = "phylosoft@gmail.com"
35 WWW = "www.phylosoft.org"
38 NAME_LENGTH_DEFAULT = 10
39 WIDTH_DEFAULT_FASTA = 60
40 INPUT_TYPE_OPTION = "i"
41 OUTPUT_TYPE_OPTION = "o"
42 MAXIMAL_NAME_LENGTH_OPTION = "n"
44 CLEAN_UP_SEQ_OPTION = "c"
45 REM_RED_OPTION = "rem_red"
46 REMOVE_GAP_COLUMNS_OPTION = "rgc"
47 REMOVE_GAP_ONLY_COLUMNS = "rgoc"
48 REMOVE_COLUMNS_GAP_RATIO_OPTION = "rr"
49 REMOVE_ALL_GAP_CHARACTERS_OPTION = "rg"
50 REMOVE_ALL_SEQUENCES_LISTED_OPTION = "r"
51 KEEP_ONLY_SEQUENCES_LISTED_OPTION = "k"
53 KEEP_MATCHING_SEQUENCES_OPTION = "mk"
54 REMOVE_MATCHING_SEQUENCES_OPTION = "mr"
57 REMOVE_SEQS_GAP_RATIO_OPTION = "rsgr"
58 REMOVE_SEQS_NON_GAP_LENGTH_OPTION = "rsl"
60 LOG_SUFFIX = "_msa_pro.log"
61 HELP_OPTION_1 = "help"
66 @input_format_set = false
67 @output_format_set = false
70 @name_length = NAME_LENGTH_DEFAULT
71 @name_length_set = false
72 @width = WIDTH_DEFAULT_FASTA # fasta only
76 @clean = false # phylip only
79 @rg = false # fasta only
84 @remove_matching = nil
99 Util.print_program_information( PRG_NAME,
108 if ( ARGV == nil || ARGV.length < 1 )
109 Util.print_message( PRG_NAME, "Illegal number of arguments" )
115 cla = CommandLineArguments.new( ARGV )
116 rescue ArgumentError => e
117 Util.fatal_error( PRG_NAME, "Error: " + e.to_s, STDOUT )
120 if ( cla.is_option_set?( HELP_OPTION_1 ) ||
121 cla.is_option_set?( HELP_OPTION_2 ) )
126 if ( cla.get_number_of_files != 2 || ARGV.length < 2 )
127 Util.print_message( PRG_NAME, "Illegal number of arguments" )
132 allowed_opts = Array.new
133 allowed_opts.push( INPUT_TYPE_OPTION )
134 allowed_opts.push( OUTPUT_TYPE_OPTION )
135 allowed_opts.push( MAXIMAL_NAME_LENGTH_OPTION )
136 allowed_opts.push( WIDTH_OPTION )
137 allowed_opts.push( CLEAN_UP_SEQ_OPTION )
138 allowed_opts.push( REMOVE_GAP_COLUMNS_OPTION )
139 allowed_opts.push( REMOVE_GAP_ONLY_COLUMNS )
140 allowed_opts.push( REMOVE_COLUMNS_GAP_RATIO_OPTION )
141 allowed_opts.push( REMOVE_ALL_GAP_CHARACTERS_OPTION )
142 allowed_opts.push( REMOVE_ALL_SEQUENCES_LISTED_OPTION )
143 allowed_opts.push( KEEP_ONLY_SEQUENCES_LISTED_OPTION )
144 allowed_opts.push( TRIM_OPTION )
145 allowed_opts.push( REMOVE_SEQS_GAP_RATIO_OPTION )
146 allowed_opts.push( REMOVE_SEQS_NON_GAP_LENGTH_OPTION )
147 allowed_opts.push( SPLIT )
148 allowed_opts.push( REM_RED_OPTION )
149 allowed_opts.push( KEEP_MATCHING_SEQUENCES_OPTION )
150 allowed_opts.push( REMOVE_MATCHING_SEQUENCES_OPTION )
152 disallowed = cla.validate_allowed_options_as_str( allowed_opts )
153 if ( disallowed.length > 0 )
154 Util.fatal_error( PRG_NAME,
155 "unknown option(s): " + disallowed )
158 input = cla.get_file_name( 0 )
159 output = cla.get_file_name( 1 )
161 analyze_command_line( cla )
164 Util.check_file_for_readability( input )
165 rescue ArgumentError => e
166 Util.fatal_error( PRG_NAME, "error: " + e.to_s )
170 Util.check_file_for_writability( output )
171 rescue ArgumentError => e
172 Util.fatal_error( PRG_NAME, "error: " + e.to_s )
176 set_pi_output( false )
177 set_fasta_output( true )
178 set_nexus_output( false )
181 if ( !@input_format_set )
184 fasta_like = Util.looks_like_fasta?( input )
185 rescue ArgumentError => e
186 Util.fatal_error( PRG_NAME, "error: " + e.to_s )
188 @fasta_input = fasta_like
189 @phylip_input = !fasta_like
190 if ( !@output_format_set )
191 @fasta_output = fasta_like
192 @pi_output = !fasta_like
193 @nexus_output = false
197 ld = Constants::LINE_DELIMITER
198 log = PRG_NAME + " " + PRG_VERSION + " [" + PRG_DATE + "]" + " LOG" + ld
200 log << "Date/time: " + now.to_s + ld
203 puts( "Input alignment : " + input )
204 log << "Input alignment : " + input + ld
205 puts( "Output alignment : " + output )
206 log << "Output alignment : " + output + ld
208 puts( "Input is : Phylip, or something like it" )
209 log << "Input is : Phylip, or something like it" + ld
210 elsif ( @fasta_input )
211 puts( "Input is : Fasta" )
212 log << "Input is : Fasta" + ld
215 puts( "Max col gap ratio: " + @rgr.to_s )
216 log << "Max col gap ratio: " + @rgr.to_s + ld
218 puts( "Remove gap colums" )
219 log << "Remove gap colums" + ld
221 puts( "Remove gap only colums" )
222 log << "Remove gap only colums" + ld
225 puts( "Clean up : true" )
226 log << "Clean up : true" + ld
230 puts( "Output is : Phylip interleaved" )
231 log << "Output is : Phylip interleaved" + ld
232 elsif ( @fasta_output )
233 puts( "Output is : Fasta" )
234 log << "Output is : Fasta" + ld
236 puts( "Width : " + @width.to_s )
237 log << "Width : " + @width.to_s + ld
240 puts( "Remove all gap characters (alignment is destroyed)" )
241 log << "Remove all gap characters (alignment is destroyed)" + ld
243 elsif ( @nexus_output )
244 puts( "Output is : Nexus" )
245 log << "Output is : Nexus" + ld
247 if ( @name_length_set || !@fasta_output )
248 puts( "Max name length : " + @name_length.to_s )
249 log << "Max name length : " + @name_length.to_s + ld
252 puts( "Remove sequences for which the gap ratio > " + @rsgr.to_s )
253 log << "Remove sequences for which the gap ratio > " + @rsgr.to_s + ld
256 puts( "Remove sequences with less than " + @rsl.to_s + " non-gap characters" )
257 log << "Remove sequences with less than " + @rsl.to_s + " non-gap characters" + ld
260 puts( "Remove sequences listed in: " + @seqs_name_file )
261 log << "Remove sequences listed in: " + @seqs_name_file + ld
263 puts( "Keep only sequences listed in: " + @seqs_name_file )
264 log << "Keep only sequences listed in: " + @seqs_name_file + ld
267 puts( "Keep only columns from: "+ @first.to_s + " to " + @last.to_s )
268 log << "Keep only columns from: "+ @first.to_s + " to " + @last.to_s + ld
271 puts( "Remove redundant sequences: true" )
272 log << "Remove redundant sequences: true" + ld
275 puts( "Split : " + @split.to_s )
276 log << "Split : " + @split.to_s + ld
286 msa = f.create_msa_from_file( input, GeneralMsaParser.new() )
287 elsif ( @fasta_input )
288 msa = f.create_msa_from_file( input, FastaParser.new() )
290 rescue Exception => e
291 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
294 if ( msa.is_aligned() )
295 Util.print_message( PRG_NAME, "Length of original alignment : " + msa.get_length.to_s )
296 log << "Length of original alignment : " + msa.get_length.to_s + ld
297 gp = msa.calculate_gap_proportion
298 Util.print_message( PRG_NAME, "Gap-proportion of original alignment : " + gp.to_s )
299 log << "Gap-proportion of original alignment : " + gp.to_s + ld
301 Util.print_message( PRG_NAME, "the input is not aligned" )
302 log << "The input is not aligned" + ld
305 all_names = Set.new()
306 for i in 0 ... msa.get_number_of_seqs()
307 current_name = msa.get_sequence( i ).get_name
308 if all_names.include?( current_name )
309 Util.print_warning_message( PRG_NAME, "sequence name [" + current_name + "] is not unique" )
311 all_names.add( current_name )
317 if ( @remove_seqs || @keep_seqs )
318 names = Util.file2array( @seqs_name_file, true )
319 if ( names == nil || names.length() < 1 )
320 error_msg = "file \"" + @seqs_name_file.to_s + "\" appears empty"
321 Util.fatal_error( PRG_NAME, error_msg )
326 for i in 0 ... names.length()
327 to_delete = msa.find_by_name( names[ i ], true, false )
328 if ( to_delete.length() < 1 )
329 error_msg = "sequence name \"" + names[ i ] + "\" not found"
330 Util.fatal_error( PRG_NAME, error_msg )
331 elsif ( to_delete.length() > 1 )
332 error_msg = "sequence name \"" + names[ i ] + "\" is not unique"
333 Util.fatal_error( PRG_NAME, error_msg )
335 msa.remove_sequence!( to_delete[ 0 ] )
339 Util.print_message( PRG_NAME, "Removed " + c.to_s + " sequences" )
340 log << "Removed " + c.to_s + " sequences" + ld
345 for j in 0 ... msa.get_number_of_seqs()
346 if ( names.include?( msa.get_sequence( j ).get_name() ) )
347 msa_new.add_sequence( msa.get_sequence( j ) )
354 Util.print_message( PRG_NAME, "Kept " + k.to_s + " sequences" )
355 log << "Kept " + k.to_s + " sequences" + ld
356 Util.print_message( PRG_NAME, "Removed " + r.to_s + " sequences" )
357 log << "removed " + r.to_s + " sequences" + ld
362 msa.trim!( @first, @last )
365 msa.remove_gap_columns_w_gap_ratio!( @rgr )
367 msa.remove_gap_columns!()
369 msa.remove_gap_only_columns!()
372 n = msa.get_number_of_seqs()
373 removed = msa.remove_sequences_by_gap_ratio!( @rsgr )
374 k = msa.get_number_of_seqs()
376 Util.print_message( PRG_NAME, "Kept " + k.to_s + " sequences" )
377 log << "Kept " + k.to_s + " sequences" + ld
378 Util.print_message( PRG_NAME, "Removed " + r.to_s + " sequences" )
379 log << "Removed " + r.to_s + " sequences:" + ld
380 removed.each { | seq_name |
381 log << " " + seq_name + ld
385 n = msa.get_number_of_seqs()
386 removed = msa.remove_sequences_by_non_gap_length!( @rsl )
387 k = msa.get_number_of_seqs()
389 Util.print_message( PRG_NAME, "Kept " + k.to_s + " sequences" )
390 log << "Kept " + k.to_s + " sequences" + ld
391 Util.print_message( PRG_NAME, "Removed " + r.to_s + " sequences" )
392 log << "Removed " + r.to_s + " sequences:" + ld
393 removed.each { | seq_name |
394 log << " " + seq_name + ld
397 if ( @keep_matching )
398 n = msa.get_number_of_seqs
399 to_be_removed = Set.new
401 seq = msa.get_sequence( ii )
402 if !seq.get_name.downcase.index( @keep_matching.downcase )
403 to_be_removed.add( ii )
406 to_be_removed_ary = to_be_removed.to_a.sort.reverse
407 to_be_removed_ary.each { | index |
408 msa.remove_sequence!( index )
412 if ( @remove_matching )
413 n = msa.get_number_of_seqs
414 to_be_removed = Set.new
417 seq = msa.get_sequence( iii )
419 if seq.get_name.downcase.index( @remove_matching.downcase )
420 to_be_removed.add( iii )
423 to_be_removed_ary = to_be_removed.to_a.sort.reverse
424 to_be_removed_ary.each { | index |
425 msa.remove_sequence!( index )
434 msas = msa.split( @split, true )
438 w = PhylipSequentialWriter.new()
440 w.set_max_name_length( @name_length )
441 elsif( @fasta_output )
442 w = FastaWriter.new()
443 w.set_line_width( @width )
445 w.remove_gap_chars( true )
446 Util.print_warning_message( PRG_NAME, "removing gap character, the output is likely to become unaligned" )
447 log << "removing gap character, the output is likely to become unaligned" + ld
450 if ( @name_length_set )
451 w.set_max_name_length( @name_length )
453 elsif( @nexus_output )
454 w = NexusWriter.new()
456 w.set_max_name_length( @name_length )
461 io.write_to_file( m, output + "_" + i.to_s, w )
463 Util.print_message( PRG_NAME, "wrote " + msas.length.to_s + " files" )
464 log << "wrote " + msas.length.to_s + " files" + ld
465 rescue Exception => e
466 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
470 rescue Exception => e
471 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
477 if ( msa.is_aligned() )
478 Util.print_message( PRG_NAME, "Length of processed alignment : " + msa.get_length.to_s )
479 log << "Length of processed alignment : " + msa.get_length.to_s + ld
480 gp = msa.calculate_gap_proportion
481 Util.print_message( PRG_NAME, "Gap-proportion of processed alignment: " + gp.to_s )
482 log << "Gap-proportion of processed alignment: " + gp.to_s + ld
484 Util.print_warning_message( PRG_NAME, "output is not aligned" )
485 log << "output is not aligned" + ld
490 removed = msa.remove_redundant_sequences!( true, true )
492 Util.print_message( PRG_NAME, "going to ignore the following " + removed.size.to_s + " redundant sequences:" )
493 log << "going to ignore the following " + removed.size.to_s + " redundant sequences:" + ld
494 removed.each { | seq_name |
498 Util.print_message( PRG_NAME, "will store " + msa.get_number_of_seqs.to_s + " non-redundant sequences" )
499 log << "will store " + msa.get_number_of_seqs.to_s + " non-redundant sequences" + ld
508 w = PhylipSequentialWriter.new()
510 w.set_max_name_length( @name_length )
511 elsif( @fasta_output )
512 w = FastaWriter.new()
513 w.set_line_width( @width )
515 w.remove_gap_chars( true )
516 Util.print_warning_message( PRG_NAME, "removing gap characters, the output is likely to become unaligned" )
517 log << "removing gap character, the output is likely to become unaligned" + ld
520 if ( @name_length_set )
521 w.set_max_name_length( @name_length )
523 elsif( @nexus_output )
524 w = NexusWriter.new()
526 w.set_max_name_length( @name_length )
531 io.write_to_file( msa, output, w )
532 rescue Exception => e
533 Util.fatal_error( PRG_NAME, "error: " + e.to_s )
537 f = File.open( output + LOG_SUFFIX, 'a' )
540 rescue Exception => e
541 Util.fatal_error( PRG_NAME, "error: " + e.to_s )
546 Util.print_message( PRG_NAME, "OK" )
555 for i in 0 ... msa.get_number_of_seqs
556 name = msa.get_sequence( i ).get_name
559 sorted_ary = names.to_a.sort
561 sorted_ary.each { | seq_name |
562 seq = msa.get_sequence( msa.find_by_name( seq_name, true, false )[ 0 ] )
563 new_msa.add_sequence( seq )
568 def set_fasta_input( fi = true )
570 @input_format_set = true
572 def set_phylip_input( pi = true )
574 @input_format_set = true
576 def set_name_length( i )
578 @name_length_set = true
583 def set_fasta_output( fo = true )
585 @output_format_set = true
587 def set_pi_output( pso = true )
589 @output_format_set = true
591 def set_nexus_output( nexus = true )
592 @nexus_output = nexus
593 @output_format_set = true
595 def set_clean( c = true )
598 def set_remove_gap_columns( rgc = true )
601 def set_remove_gap_only_columns( rgoc = true )
604 def set_remove_gaps( rg = true )
607 def set_remove_gap_ratio( rgr )
610 def set_remove_seqs_gap_ratio( rsgr )
613 def set_remove_seqs_min_non_gap_length( rsl )
616 def set_remove_seqs( file )
617 @seqs_name_file = file
621 def set_keep_seqs( file )
622 @seqs_name_file = file
626 def set_trim( first, last )
631 def set_remove_matching( remove )
632 @remove_matching = remove
634 def set_keep_matching( keep )
635 @keep_matching = keep
637 def set_rem_red( rr )
646 @clean = false # phylip only
649 @rg = false # fasta only
653 @seqs_name_file = nil
661 def analyze_command_line( cla )
662 if ( cla.is_option_set?( INPUT_TYPE_OPTION ) )
664 type = cla.get_option_value( INPUT_TYPE_OPTION )
666 set_phylip_input( true )
667 set_fasta_input( false )
668 elsif ( type == "f" )
669 set_fasta_input( true )
670 set_phylip_input( false )
672 rescue ArgumentError => e
673 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
676 if ( cla.is_option_set?( OUTPUT_TYPE_OPTION ) )
678 type = cla.get_option_value( OUTPUT_TYPE_OPTION )
680 set_pi_output( true )
681 set_fasta_output( false )
682 set_nexus_output( false )
683 elsif ( type == "f" )
684 set_pi_output( false )
685 set_fasta_output( true )
686 set_nexus_output( false )
687 elsif ( type == "n" )
688 set_pi_output( false )
689 set_fasta_output( false )
690 set_nexus_output( true )
692 rescue ArgumentError => e
693 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
696 if ( cla.is_option_set?( MAXIMAL_NAME_LENGTH_OPTION ) )
698 l = cla.get_option_value_as_int( MAXIMAL_NAME_LENGTH_OPTION )
700 rescue ArgumentError => e
701 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
704 if ( cla.is_option_set?( WIDTH_OPTION ) )
706 w = cla.get_option_value_as_int( WIDTH_OPTION )
708 rescue ArgumentError => e
709 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
712 if ( cla.is_option_set?( CLEAN_UP_SEQ_OPTION ) )
715 if ( cla.is_option_set?( REMOVE_GAP_COLUMNS_OPTION ) )
716 set_remove_gap_columns( true )
718 if ( cla.is_option_set?( REM_RED_OPTION ) )
721 if ( cla.is_option_set?( REMOVE_GAP_ONLY_COLUMNS ) )
722 set_remove_gap_only_columns( true )
724 if ( cla.is_option_set?( REMOVE_ALL_GAP_CHARACTERS_OPTION ) )
725 set_remove_gaps( true )
727 if ( cla.is_option_set?( REMOVE_COLUMNS_GAP_RATIO_OPTION ) )
729 f = cla.get_option_value_as_float( REMOVE_COLUMNS_GAP_RATIO_OPTION )
730 set_remove_gap_ratio( f )
731 rescue ArgumentError => e
732 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
735 if ( cla.is_option_set?( REMOVE_ALL_SEQUENCES_LISTED_OPTION ) )
737 s = cla.get_option_value( REMOVE_ALL_SEQUENCES_LISTED_OPTION )
739 rescue ArgumentError => e
740 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
743 if ( cla.is_option_set?( KEEP_ONLY_SEQUENCES_LISTED_OPTION ) )
745 s = cla.get_option_value( KEEP_ONLY_SEQUENCES_LISTED_OPTION )
747 rescue ArgumentError => e
748 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
751 if ( cla.is_option_set?( TRIM_OPTION ) )
753 s = cla.get_option_value( TRIM_OPTION )
754 if ( s =~ /(\d+)-(\d+)/ )
755 set_trim( $1.to_i(), $2.to_i() )
757 puts( "illegal argument" )
761 rescue ArgumentError => e
762 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
765 if ( cla.is_option_set?( REMOVE_SEQS_GAP_RATIO_OPTION ) )
767 f = cla.get_option_value_as_float( REMOVE_SEQS_GAP_RATIO_OPTION )
768 set_remove_seqs_gap_ratio( f )
769 rescue ArgumentError => e
770 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
773 if ( cla.is_option_set?( REMOVE_SEQS_NON_GAP_LENGTH_OPTION ) )
775 f = cla.get_option_value_as_int( REMOVE_SEQS_NON_GAP_LENGTH_OPTION )
776 set_remove_seqs_min_non_gap_length( f )
777 rescue ArgumentError => e
778 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
781 if ( cla.is_option_set?( SPLIT ) )
783 s = cla.get_option_value_as_int( SPLIT )
785 rescue ArgumentError => e
786 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
790 if ( cla.is_option_set?( REMOVE_MATCHING_SEQUENCES_OPTION ) )
792 s = cla.get_option_value( REMOVE_MATCHING_SEQUENCES_OPTION )
793 set_remove_matching( s )
794 rescue ArgumentError => e
795 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
798 if ( cla.is_option_set?( KEEP_MATCHING_SEQUENCES_OPTION ) )
800 s = cla.get_option_value( KEEP_MATCHING_SEQUENCES_OPTION )
801 set_keep_matching( s )
802 rescue ArgumentError => e
803 Util.fatal_error( PRG_NAME, "error: " + e.to_s, STDOUT )
814 puts( " " + PRG_NAME + ".rb [options] <input alignment> <output>" )
816 puts( " options: -" + INPUT_TYPE_OPTION + "=<input type>: f for fasta, p for phylip selex type" )
817 puts( " -" + OUTPUT_TYPE_OPTION + "=<output type>: f for fasta, n for nexus, p for phylip sequential (default)" )
818 puts( " -" + MAXIMAL_NAME_LENGTH_OPTION + "=<n>: n=maximal name length (default for phylip 10, for fasta: unlimited )" )
819 puts( " -" + WIDTH_OPTION + "=<n>: n=width (fasta output only, default is 60)" )
820 puts( " -" + CLEAN_UP_SEQ_OPTION + ": clean up sequences" )
821 puts( " -" + REMOVE_GAP_COLUMNS_OPTION + ": remove gap columns" )
822 puts( " -" + REMOVE_GAP_ONLY_COLUMNS + ": remove gap-only columns" )
823 puts( " -" + REMOVE_COLUMNS_GAP_RATIO_OPTION + "=<n>: remove columns for which ( seqs with gap / number of sequences > n )" )
824 puts( " -" + REMOVE_ALL_GAP_CHARACTERS_OPTION + ": remove all gap characters (destroys alignment, fasta output only)" )
825 puts( " -" + REMOVE_ALL_SEQUENCES_LISTED_OPTION + "=<file>: remove all sequences listed in file" )
826 puts( " -" + KEEP_ONLY_SEQUENCES_LISTED_OPTION + "=<file>: keep only sequences listed in file" )
827 puts( " -" + TRIM_OPTION + "=<first>-<last>: remove columns before first and after last" )
828 puts( " -" + REMOVE_SEQS_GAP_RATIO_OPTION + "=<n>: remove sequences for which the gap ratio > n (after column operations)" )
829 puts( " -" + REMOVE_SEQS_NON_GAP_LENGTH_OPTION + "=<n> remove sequences with less than n non-gap characters (after column operations)" )
830 puts( " -" + REMOVE_MATCHING_SEQUENCES_OPTION + "=<s> remove all sequences with names containing s" )
831 puts( " -" + KEEP_MATCHING_SEQUENCES_OPTION + "=<s> keep only sequences with names containing s" )
832 puts( " -" + SPLIT + "=<n> split a fasta file into n files of equal number of sequences (expect for " )
833 puts( " last one), cannot be used with other options" )
834 puts( " -" + REM_RED_OPTION + ": remove redundant sequences" )
842 end # class MsaProcessor