Created
August 12, 2009 20:00
-
-
Save mndoci/166714 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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