[BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.6,1.7

Mitsuteru C. Nakao nakao at dev.open-bio.org
Thu Mar 29 05:24:30 UTC 2007


Update of /home/repository/bioruby/bioruby/lib/bio/io
In directory dev.open-bio.org:/tmp/cvs-serv9701/lib/bio/io

Modified Files:
	ensembl.rb 
Log Message:
* Fixed a bug in exportview argument parsing.


Index: ensembl.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ensembl.rb	28 Mar 2007 12:31:48 -0000	1.6
--- ensembl.rb	29 Mar 2007 05:24:27 -0000	1.7
***************
*** 65,70 ****
--- 65,72 ----
    ENSEMBL_URL = 'http://www.ensembl.org'
  
+   # Server URL (ex. 'http://www.ensembl.org')
    attr_reader :server
  
+   # Organism name. (ex. 'Homo_sapiens').
    attr_reader :organism
  
***************
*** 138,157 ****
    # 
    def exportview(*args)
-     if args.first.class == Hash
-       options = args.first
-     else
-       options = {
-         :seq_region_name => args[0], 
-         :anchor1 => args[1], 
-         :anchor2 => args[2],
-       }
-       case args.size
-       when 3 then 
-         options.update({:format => 'fasta'})
-       when 4 then 
-         options.update({:format => 'gff', :options => args[3]})
-       end
-     end
-     
      defaults = {
        :type1 => 'bp', 
--- 140,143 ----
***************
*** 167,170 ****
--- 153,170 ----
      }
  
+     if args.first.class == Hash
+       options = args.first
+       options.update({:format => 'gff'}) if options[:options] and options[:format] != 'fasta'
+     else
+       options = {
+         :seq_region_name => args[0], 
+         :anchor1 => args[1], 
+         :anchor2 => args[2],
+       }
+       if args.size >= 4 
+         options.update({:format => 'gff', :options => args[3]}) 
+       end
+     end
+ 
      params = defaults.update(options)
  




More information about the bioruby-cvs mailing list