[BioRuby] efetch/esearch broken

Toshiaki Katayama ktym at hgc.jp
Wed Mar 18 01:34:50 UTC 2009


Hi Craig,

Thank you for pointing this out. It was a bug.

--- /usr/local/lib/ruby/gems/1.8/gems/bio-1.3.0/lib/bio/io/ncbirest.rb.orig  2009-03-18 10:33:14.000000000 +0900
+++ /usr/local/lib/ruby/gems/1.8/gems/bio-1.3.0/lib/bio/io/ncbirest.rb	2009-03-18 10:24:25.000000000 +0900
@@ -147,7 +147,7 @@ class REST
 
       list = []
       0.step(limit, step) do |i|
-        retmax = [step, limit - i].min
+        retmax = hash["retmax"] || [step, limit - i].min
         opts.update("retmax" => retmax, "retstart" => i)
         ncbi_access_wait
         response = Bio::Command.post_form(serv, opts)


Regards,
Toshiaki Katayama

On 2009/03/06, at 4:16, craigknox wrote:

> Hi Everyone,
>
> I am using the latest bioruby gem (1.3.0) and I am having trouble running efetch.  The following is copied directly from the tutorial on "http://bioruby.open-bio.org/wiki/BiorubyTutorial".  When I run it, "Bio::PubMed.efetch(entries)" returns a  string instead of an array of strings.  Additionally, the "retmax" parameter for esearch is not working - it is only returning the default of 100 entries.
>
> Is the tutorial just out of date or is this a bug?
>
> Thanks,
> Craig Knox
>
> #!/usr/bin/env ruby
> require 'bio'
>
> keywords = ARGV.join(' ') # I am using "histamine" here
>
> options = {
>  'maxdate' => '2003/05/31',
>  'retmax' => 1000,
> }
>
> entries = Bio::PubMed.esearch(keywords, options)
>
> Bio::PubMed.efetch(entries).each do |entry|
>  medline = Bio::MEDLINE.new(entry)
>  reference = medline.reference
>  puts reference.bibtex
> end
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby




More information about the BioRuby mailing list