[BioRuby-cvs] bioruby/lib/bio/appl/blast rexml.rb, 1.12, 1.12.2.1 xmlparser.rb, 1.17, 1.17.2.1

Naohisa Goto ngoto at dev.open-bio.org
Mon May 12 13:19:35 UTC 2008


Update of /home/repository/bioruby/bioruby/lib/bio/appl/blast
In directory dev.open-bio.org:/tmp/cvs-serv4966/lib/bio/appl/blast

Modified Files:
      Tag: BRANCH-biohackathon2008
	rexml.rb xmlparser.rb 
Log Message:
Merging differences between 1.17 and 1.18 into xmplarser.rb and between
1.12 and 1.13 into rexml.rb.


Index: xmlparser.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/xmlparser.rb,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C2 -d -r1.17 -r1.17.2.1
*** xmlparser.rb	5 Apr 2007 23:35:39 -0000	1.17
--- xmlparser.rb	12 May 2008 13:19:32 -0000	1.17.2.1
***************
*** 116,139 ****
      end
  
!     def xmlparser_parse_parameters(hash)
!       labels = { 
!         'matrix'       => 'Parameters_matrix',
!         'expect'       => 'Parameters_expect',
!         'include'      => 'Parameters_include',
!         'sc-match'     => 'Parameters_sc-match',
!         'sc-mismatch'  => 'Parameters_sc-mismatch',
!         'gap-open'     => 'Parameters_gap-open',
!         'gap-extend'   => 'Parameters_gap-extend',
!         'filter'       => 'Parameters_filter',
!         'pattern'      => 'Parameters_pattern',
!         'entrez-query' => 'Parameters_entrez-query',
!       }
!       labels.each do |k,v|
          case k
!         when 'filter', 'matrix'
!           @parameters[k] = hash[v].to_s
          else
!           @parameters[k] = hash[v].to_i
          end
        end
      end
--- 116,148 ----
      end
  
!     # set parameter of the key as val
!     def xml_set_parameter(key, val)
!       #labels = { 
!       #  'matrix'       => 'Parameters_matrix',
!       #  'expect'       => 'Parameters_expect',
!       #  'include'      => 'Parameters_include',
!       #  'sc-match'     => 'Parameters_sc-match',
!       #  'sc-mismatch'  => 'Parameters_sc-mismatch',
!       #  'gap-open'     => 'Parameters_gap-open',
!       #  'gap-extend'   => 'Parameters_gap-extend',
!       #  'filter'       => 'Parameters_filter',
!       #  'pattern'      => 'Parameters_pattern',
!       #  'entrez-query' => 'Parameters_entrez-query',
!       #}
!       k = key.sub(/\AParameters\_/, '')
!       @parameters[k] =
          case k
!         when 'expect', 'include'
!           val.to_f
!         when /\Agap\-/, /\Asc\-/
!           val.to_i
          else
!           val
          end
+     end
+ 
+     def xmlparser_parse_parameters(hash)
+       hash.each do |k, v|
+         xml_set_parameter(k, v)
        end
      end

Index: rexml.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/blast/rexml.rb,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -C2 -d -r1.12 -r1.12.2.1
*** rexml.rb	5 Apr 2007 23:35:39 -0000	1.12
--- rexml.rb	12 May 2008 13:19:32 -0000	1.12.2.1
***************
*** 38,44 ****
            when 'BlastOutput_param'
              e.elements["Parameters"].each_element_with_text do |p|
!               k = p.name.sub(/Parameters_/, '')
!               v = p.text =~ /\D/ ? p.text : p.text.to_i
!               @parameters[k] = v
              end
            else
--- 38,42 ----
            when 'BlastOutput_param'
              e.elements["Parameters"].each_element_with_text do |p|
!               xml_set_parameter(p.name, p.text)
              end
            else




More information about the bioruby-cvs mailing list