X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fruby%2Fevoruby%2Flib%2Fevo%2Ftool%2Fphylogenies_decorator.rb;h=b2d5a87e4984031a28e1c78d4982d7d85e52fc18;hb=18f6c64d655d5f9cc321c689e1fec82067d849f3;hp=953f924c068c954511b54cd50f105a3940bba345;hpb=b2da9d4556ac5b90e50d1460040f7387140dd49b;p=jalview.git diff --git a/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb b/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb index 953f924..b2d5a87 100644 --- a/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb +++ b/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb @@ -101,32 +101,9 @@ module Evoruby Util.fatal_error( PRG_NAME, 'logfile [' + LOG_FILE + '] already exists' ) end - allowed_opts = Array.new - allowed_opts.push( IDS_ONLY_OPTION ) - allowed_opts.push( DOMAINS_ONLY_OPTION ) - - disallowed = cla.validate_allowed_options_as_str( allowed_opts ) - if ( disallowed.length > 0 ) - Util.fatal_error( PRG_NAME, "unknown option(s): " + disallowed ) - end - - ids_only = false - domains_only = false - in_suffix = cla.get_file_name( 0 ) out_suffix = cla.get_file_name( 1 ) - if cla.is_option_set?( IDS_ONLY_OPTION ) - ids_only = true - end - if cla.is_option_set?( DOMAINS_ONLY_OPTION ) - domains_only = true - end - - if ( ids_only && domains_only ) - Util.fatal_error( PRG_NAME, 'attempt to use ids only and domains only at the same time' ) - end - log = String.new now = DateTime.now @@ -189,7 +166,8 @@ module Evoruby log << counter.to_s + ': ' + phylogeny_file + ' -> ' + outfile + NL phylogeny_id = get_id( phylogeny_file ) - + puts "id:" + phylogeny_id + ids_mapfile_name = nil domains_mapfile_name = nil seqs_file_name = nil @@ -259,33 +237,25 @@ module Evoruby def get_id( phylogeny_file_name ) - phylogeny_file_name =~ /^([^_]+)/ + phylogeny_file_name =~ /^(.+?)__/ $1 end def get_file( files_in_dir, phylogeny_id, suffix_pattern ) matching_files = Array.new - matching_suffix_files = Array.new + files_in_dir.each { | file | if ( !File.directory?( file ) && file !~ /^\./ && file !~ /^00/ && - file =~ /^#{phylogeny_id}.*#{suffix_pattern}$/ ) + file =~ /^#{phylogeny_id}#{suffix_pattern}$/ ) matching_files << file end - if ( !File.directory?( file ) && - file !~ /^\./ && - file !~ /^00/ && - file =~ /#{suffix_pattern}$/ ) - matching_suffix_files << file - end } - if matching_files.length < 1 && matching_suffix_files.length == 1 - return matching_suffix_files[ 0 ] - end + - if matching_files.length < 1 && matching_suffix_files.length < 1 + if matching_files.length < 1 Util.fatal_error( PRG_NAME, 'no file matching [' + phylogeny_id + '_] [' + suffix_pattern + '] present in current directory' ) end @@ -307,7 +277,6 @@ module Evoruby file =~ /^#{phylogeny_id}.+\d$/ ) matching_files << file end - } if matching_files.length < 1