X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fruby%2Fevoruby%2Flib%2Fevo%2Ftool%2Fphylogenies_decorator.rb;h=60067290003dd372d638e4251832ce2622fac84f;hb=f049eb830f04c5892aed4240737f3e486d9b2a14;hp=4e26acb2f5065ca90931008588acc12972b4fdcf;hpb=fd508ee418219eda297f3a4da5f4d3be7f8a6db8;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 4e26acb..6006729 100644 --- a/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb +++ b/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb @@ -24,7 +24,7 @@ module Evoruby #DECORATOR_OPTIONS_SEQ_NAMES = '-r=1 -mdn' #DECORATOR_OPTIONS_SEQ_NAMES = '-p -t -sn' - DECORATOR_OPTIONS_SEQ_NAMES = '-p -t -c -tc' + DECORATOR_OPTIONS_SEQ_NAMES = '-p -t -c -tc -mp -or' # -mdn is a hidden expert option to rename e.g. "6_ORYLA3" to "6_[3]_ORYLA" #DECORATOR_OPTIONS_SEQ_NAMES = '-sn -r=1' #DECORATOR_OPTIONS_DOMAINS = '-r=1' @@ -271,6 +271,7 @@ module Evoruby 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 ) && @@ -279,11 +280,22 @@ module Evoruby 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 + 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 Util.fatal_error( PRG_NAME, 'no file matching [' + phylogeny_id + '_] [' + suffix_pattern + '] present in current directory' ) - elsif matching_files.length > 1 + end + if matching_files.length > 1 Util.fatal_error( PRG_NAME, 'more than one file matching [' + phylogeny_id + '_] [' + suffix_pattern + '] present in current directory' ) end @@ -296,7 +308,7 @@ module Evoruby puts( " " + PRG_NAME + ".rb [options] " ) puts() puts( " options: -" + IDS_ONLY_OPTION + ": decorate with sequence/species names only" ) - puts( " -" + DOMAINS_ONLY_OPTION + ": decorate with domain structures" ) + puts( " -" + DOMAINS_ONLY_OPTION + ": decorate with domain structures only" ) puts() end end # class PhylogenyiesDecorator