[BioRuby] Bio::PubMed.efetch, bug?
Naohisa GOTO
ngoto at gen-info.osaka-u.ac.jp
Tue Apr 21 14:17:26 UTC 2009
Hi,
On Fri, 10 Apr 2009 16:20:19 +0900
Masahide Kikkawa <mkikkawa at gmail.com> wrote:
> Hi,
>
>
> I recently installed bioruby-1.3.0 and encountered a bug.
>
> Here is what I did
> result = Bio::PubMed.efetch([123,456,789])
>
> I expected the result to be Array of MEDLINE formatted String
> as documented here:
> http://bioruby.org/rdoc/classes/Bio/PubMed.html
>
> However, the return value was one String containing all the results.
>
> In the bioruby-1.2.1, it does return Array of MEDLINE formatted String.
Thank you for reporting a bug. This is a regression introduced
with the refactoring of Bio::PubMed between 1.2.1 and 1.3.0.
> Therefore I would recommend to apply following patch to ncbirest.rb
>
> <
> < result.strip!
> < if opts["retmode"] == "text"
> < result = result.split(/\n\n+/)
> < end
> <
> < return result
> ---
> > return result.strip
> > #return result.strip.split(/\n\n+/)
>
Bio::NCBI::REST is not only for PubMed but also for many
databases in NCBI, and efetch may return free text,
depending on databases. Thus, the processing of the result
should only be applied to Bio::PubMed.
http://github.com/bioruby/bioruby/commit/a48a9a35b87dead069fe328ba7086977304af995
To confirm bug fix, tests for Bio::PubMed are also added.
http://github.com/bioruby/bioruby/commit/bf5ba6d4503f3ddb0ca31673882f5b396a932bbe
In addition, I found a bug about "retstart" and fixed the bug.
http://github.com/bioruby/bioruby/commit/fc0339fe8a42cd00199cfdc938590ae9626551bc
Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org
More information about the BioRuby
mailing list