class Bio::PubMed

Description

The Bio::PubMed class provides several ways to retrieve bibliographic information from the PubMed database at NCBI.

Basically, two types of queries are possible:

Since BioRuby 1.5, all implementations uses NCBI E-Utilities services. The different methods within the same group still remain because specifications of arguments and/or return values are different. The search, query, and pmfetch will be obsoleted in the future.

Additional information about the MEDLINE format and PubMed programmable APIs can be found on the following websites:

Usage

require 'bio'

# If you don't know the pubmed ID:
Bio::PubMed.esearch("(genome AND analysis) OR bioinformatics").each do |x|
  p x
end

Bio::PubMed.search("(genome AND analysis) OR bioinformatics").each do |x|
  p x
end

# To retrieve the MEDLINE entry for a given PubMed ID:
Bio::PubMed.efetch("10592173").each { |x| puts x }
puts Bio::PubMed.query("10592173")
puts Bio::PubMed.pmfetch("10592173")

# To retrieve MEDLINE entries for given PubMed IDs:
Bio::PubMed.efetch([ "10592173", "14693808" ]).each { |x| puts x }
puts Bio::PubMed.query("10592173", "14693808") # returns a String

# This can be converted into a Bio::MEDLINE object:
manuscript = Bio::PubMed.query("10592173")
medline = Bio::MEDLINE.new(manuscript)