Skip to content

Instantly share code, notes, and snippets.

@mndoci
Created August 12, 2009 20:00
Show Gist options
  • Save mndoci/166714 to your computer and use it in GitHub Desktop.
Save mndoci/166714 to your computer and use it in GitHub Desktop.
#!/usr/local/bin ruby
# From Paulo Nuin
# Source: http://ruby.genedrift.org/?p=18
require 'rubygems'
require 'bio'
my_file = File.new(ARGV[0])
refs = my_file.readlines
ids = []
refs.each do |line|
pmid = line.strip().split("\t")
ids.push(pmid[2])
end
ids.each do |id|
entry = Bio::PubMed.query(id)
medline = Bio::MEDLINE.new(entry)
reference = medline.reference
puts reference.endnote
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment