X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fruby%2Fevoruby%2Flib%2Fevo%2Ftool%2Fmsa_processor.rb;h=d9522779393e558a33478c6a591d916757ec76e5;hb=36ea5e3d816a5afe5042c28ff0c07394575521f5;hp=738db56274859619742fa10fee034df49c73fa4d;hpb=2044a46819969b8ac56d653aab5729fb782ec40c;p=jalview.git diff --git a/forester/ruby/evoruby/lib/evo/tool/msa_processor.rb b/forester/ruby/evoruby/lib/evo/tool/msa_processor.rb index 738db56..d952277 100644 --- a/forester/ruby/evoruby/lib/evo/tool/msa_processor.rb +++ b/forester/ruby/evoruby/lib/evo/tool/msa_processor.rb @@ -27,9 +27,9 @@ module Evoruby class MsaProcessor PRG_NAME = "msa_pro" - PRG_DATE = "130411" + PRG_DATE = "131112" PRG_DESC = "processing of multiple sequence alignments" - PRG_VERSION = "1.07" + PRG_VERSION = "1.08" COPYRIGHT = "2008-2010 Christian M Zmasek" CONTACT = "phylosoft@gmail.com" WWW = "www.phylosoft.org" @@ -301,8 +301,8 @@ module Evoruby Util.print_message( PRG_NAME, "Gap-proportion of original alignment : " + gp.to_s ) log << "Gap-proportion of original alignment : " + gp.to_s + ld else - Util.print_message( PRG_NAME, "the input is not aligned" ) - log << "The input is not aligned" + ld + Util.print_message( PRG_NAME, "Input is not aligned" ) + log << "Input is not aligned" + ld end all_names = Set.new() @@ -484,8 +484,32 @@ module Evoruby Util.print_message( PRG_NAME, "Gap-proportion of processed alignment: " + gp.to_s ) log << "Gap-proportion of processed alignment: " + gp.to_s + ld else - Util.print_warning_message( PRG_NAME, "output is not aligned" ) - log << "output is not aligned" + ld + min = 0 + max = 0 + sum = 0 + first = true + for s in 0 ... msa.get_number_of_seqs + seq = msa.get_sequence( s ) + l = seq.get_length + sum += l + if l > max + max = l + end + if first || l < min + min = l + end + first = false + end + avg = sum / msa.get_number_of_seqs + Util.print_message( PRG_NAME, "Output is not aligned" ) + log << "Output is not aligned" + ld + Util.print_message( PRG_NAME, "Shortest sequence : " + min.to_s ) + log << "Shortest sequence : " + min.to_s + ld + Util.print_message( PRG_NAME, "Longest sequence : " + max.to_s ) + log << "Longest sequence : " + max.to_s + ld + Util.print_message( PRG_NAME, "Average length : " + avg.to_s ) + log << "Average length : " + avg.to_s + ld + end end @@ -535,13 +559,15 @@ module Evoruby w.set_exception_if_name_too_long( @die_if_name_too_long ) end - begin io.write_to_file( msa, output, w ) rescue Exception => e Util.fatal_error( PRG_NAME, "error: " + e.to_s ) end + Util.print_message( PRG_NAME, "Number of sequences in output : " + msa.get_number_of_seqs.to_s ) + log << "Number of sequences in output : " + msa.get_number_of_seqs.to_s + ld + begin f = File.open( output + LOG_SUFFIX, 'a' ) f.print( log )