This is not strictly bioinformatics but I am not sure where this would fit. Anyway, close this question if it is misplaced.
I have a long list of PMIDs, I would like to generate a BiBTeX file from this. How could I go about doing this?
This is not strictly bioinformatics but I am not sure where this would fit. Anyway, close this question if it is misplaced.
I have a long list of PMIDs, I would like to generate a BiBTeX file from this. How could I go about doing this?
Use ncbi efetch to download your papers as XML and use a XSLT stylesheet like pubmed2bibtex.xsl ( http://svn.gna.org/viewcvs/kbibtex/trunk/xslt/ ) to transform it to bibtex.
I've used this method to compile a recent TeX paper: see http://code.google.com/p/knime4bio/source/browse/trunk/paper20110804/Makefile
This is very easy using Bio::PubMed and Bio::MEDLINE from BioRuby.
Chris Miller has posted example code which loops through a list of PMIDs and returns citations in BibTeX.
FWIW, I tried this method today and it no longer works. I'm not sure whether the package or the API changed, but I ended up using the following solution instead:
Yes it seems a few things have changed.
Bio::PubMed::query()
no longer works (returns nil)Bio::PubMed::efetch()
returns an array; elements can be converted to MEDLINE objectsThis works for me:
require 'bio'
id = "18265351"
Bio::NCBI.default_email = "me@me.com"
e = Bio::PubMed::efetch(id)
m = Bio::MEDLINE.new(e[0])
bib = m.reference.format("bibtex")
# => "@article{PMID:18265351,\n author = {Brown, T. and Mackey, K. and Du, T.},\n title = {Analysis of RNA by northern and slot blot hybridization.},\n journal = {Curr Protoc Mol Biol},\n year = {2004},\n volume = {Chapter 4},\n pages = {Unit 4.9},\n url = {http://www.ncbi.nlm.nih.gov/pubmed/18265351},\n}\n"
jabref uses bibtex as standard storage format of references. You can directly download pubmed references from within jabref.
Mekentosj Papers also supports bibtex exports.
I did something like this a while back and blogged on it: http://pathogenomics.bham.ac.uk/blog/2011/03/creating-my-perfect-citation-system-using-latex/
The Python code is at: https://github.com/nickloman/latex-pubmed
Feel free to fork it and improve it (and send me a pull request)
I use BibDesk, for Macs that let me do it. I looked at my bookmark and found this page with many tools to convert to bib files. You enter all your PMID in pubmed, export to xml and then convert xml to bib. Mendley Should let you do it as well somehow. I did it once to play around and it looked smooth. Most bibliogaphic tools should let you export to RIS and then from there convert to bibtex.
I normally use a combination of ris2xml and xml2bib (bibutils) similar to Stefano Berri description. If there is no easy ris export I use TexMed from http://www.bioinformatics.org, a website where you can enter a search-query and export the results as bibtex, the search-query can also be a list of pmids. Unfortunately the export needs to be taken with some caution because the tool might include unnecessary curly braces which you then have to remove.
Hi there,
You can also use:
online to achieve this. Just enter a pubmed PMID and it does the work for you.
HTH,
C
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Thanks! Excellent ways to do this. I wish I could mark more than one as correct.
Not a direct solution if you only have PMID's, but if you save your papers in Zotero it is easy to export a BiBTeX format list of citations.