X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fruby%2Fevoruby%2Flib%2Fevo%2Ftool%2Ftaxonomy_processor.rb;h=bf194c7196705280bc89790d2d4a6733a941929c;hb=156517428746b21481eb815bf860ffb6cb0314ef;hp=b0e936ed5fd85f9f4cc6907c7642adfb1e600d60;hpb=8e6765310915a8dd68696a2bde2d88173b60642a;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 b0e936e..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" @@ -167,10 +167,11 @@ module Evoruby def modify_name( desc, counter, file, extract_taxonomy ) new_desc = nil - 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 - elsif extract_taxonomy - if desc =~/\s\[([A-Z9][A-Z]{2}[A-Z0-9]{2})|RAT|PIG|PEA|CAP)\]/ + 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, "could not get taxonomy from: " + desc ) @@ -178,7 +179,7 @@ module Evoruby else new_desc = counter.to_s( 16 ) end - file.print( new_desc + ": " + desc + "\n" ) + file.print( new_desc + "\t" + desc + "\n" ) new_desc end