[BioRuby] Bio::PubMed.efetch, bug?
ngoto at gen-info.osaka-u.ac.jp
Tue Apr 21 14:17:26 UTC 2009
On Fri, 10 Apr 2009 16:20:19 +0900
Masahide Kikkawa <mkikkawa at gmail.com> wrote:
> 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:
> 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.
To confirm bug fix, tests for Bio::PubMed are also added.
In addition, I found a bug about "retstart" and fixed the bug.
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org
More information about the BioRuby