[BioRuby] biofetch confusion

Ben Woodcroft donttrustben at gmail.com
Tue Sep 30 02:40:39 UTC 2008


Hi,

I was running a fetch from within ruby using the alternate server, and ran
into a problem it took stupid me a little while to figure out. Thought I
might post to help others.

>> pdb = Bio::Fetch.new('www.ebi.ac.uk/cgi-bin/dbfetch').fetch('pdb','2A06')
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.downcase
    from /usr/lib/ruby/1.8/open-uri.rb:551:in `find_proxy'
    from /usr/lib/ruby/1.8/open-uri.rb:147:in `open_loop'
    from /usr/lib/ruby/1.8/open-uri.rb:164:in `call'
    from /usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
    from /usr/lib/ruby/1.8/open-uri.rb:162:in `catch'
    from /usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
    from /usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
    from /home/ben/forays/bioruby_wwood/lib/bio/command.rb:223:in `read_uri'
    from /home/ben/forays/bioruby_wwood/lib/bio/io/fetch.rb:109:in `fetch'
    from (irb):5


Same problem happens when you use the br_biofetch.rb script directly.


The problem was fixed by adding 'http://' to the front of the url:

>> pdb = Bio::Fetch.new('http://www.ebi.ac.uk/cgi-bin/dbfetch').fetch('pdb
','2A06')
... pdb printed here ...


Should bioruby add the http:// somehow?

Thanks,
ben

-- 
FYI: My email addresses at unimelb, uq and gmail all redirect to the same
place.



More information about the BioRuby mailing list