X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fruby%2Fevoruby%2Flib%2Fevo%2Ftool%2Ftaxonomy_processor.rb;h=bf194c7196705280bc89790d2d4a6733a941929c;hb=7e37741c149bbf6c27555ab9cf92766155d3f4d3;hp=1fc8e95772dd7e7ffb17a78e180ab7cc7ca25fda;hpb=9d8c86a4dfc6901d2c69857331c9021c18d4988d;p=jalview.git diff --git a/forester/ruby/evoruby/lib/evo/tool/taxonomy_processor.rb b/forester/ruby/evoruby/lib/evo/tool/taxonomy_processor.rb index 1fc8e95..bf194c7 100644 --- a/forester/ruby/evoruby/lib/evo/tool/taxonomy_processor.rb +++ b/forester/ruby/evoruby/lib/evo/tool/taxonomy_processor.rb @@ -22,9 +22,9 @@ module Evoruby class TaxonomyProcessor PRG_NAME = "tap" - PRG_DATE = "2013.03.20" + PRG_DATE = "130411" PRG_DESC = "replacement of species names in multiple sequence files" - PRG_VERSION = "2.00" + PRG_VERSION = "2.002" COPYRIGHT = "2013 Christian M Zmasek" CONTACT = "phylosoft@gmail.com" WWW = "https://sites.google.com/site/cmzmasek/home/software/forester" @@ -158,9 +158,6 @@ module Evoruby Util.fatal_error( PRG_NAME, "failed to write file: " + e.to_s ) end lf.close() - if ( @taxonomies.length > 0 ) - Util.print_message( PRG_NAME, "number of unique taxonomies: " + @taxonomies.length.to_s ) - end Util.print_message( PRG_NAME, "wrote: " + list_file ) Util.print_message( PRG_NAME, "wrote: " + output ) Util.print_message( PRG_NAME, "OK" ) @@ -170,20 +167,19 @@ module Evoruby def modify_name( desc, counter, file, extract_taxonomy ) new_desc = nil - desc.gsub!( /:\s+/, ":" ) - desc.gsub!( /\s+/, " " ) - if desc =~ /^>?\s*\S{1,10}_([A-Z]{3,5})/ - new_desc = counter.to_s( 16 ) + "_" + $1 - elsif extract_taxonomy - if desc =~/\[([A-Z0-9]{3,5})\]\b/ + desc.gsub!( /\s+/, ' ' ) + #if desc =~ /^>?\s*\S{1,10}_(([A-Z9][A-Z]{2}[A-Z0-9]{2})|RAT|PIG|PEA|CAP)/ + # new_desc = counter.to_s( 16 ) + "_" + $1 + if extract_taxonomy + if desc =~/\s\[(([A-Z9][A-Z]{2}[A-Z0-9]{2})|RAT|PIG|PEA|CAP)\]/ new_desc = counter.to_s( 16 ) + "_" + $1 else - Util.fatal_error( PRG_NAME, "illegal format in: " + desc ) + Util.fatal_error( PRG_NAME, "could not get taxonomy from: " + desc ) end else new_desc = counter.to_s( 16 ) end - file.print( new_desc + ": " + desc + "\n" ) + file.print( new_desc + "\t" + desc + "\n" ) new_desc end