This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to the file that has list of all PMIDs with corresponding authors?

Hi all,

I have a huge list of pubmed IDs, 48157 IDs to be precise. I am working on extracting the list of authors from these IDs. I wrote a python script to do that. however its not a fast method and the connection with the server keeps breaking up and I have to follow up the process. Is there any way that I could get a csv file that has all these information? Thanks in advance.

pubmed ncbi

1 answer

using a Makefile:

PMIDS=$(shell cat your_list_of_pmid.txt)
define fun
$(1).txt:
    wget -O - "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=$(1)&retmode=text&rettype=medline" | grep "^FAU - " | cut -c 7- | awk '{printf("$(1)\t%s\n",$$$$0);}' > $$(addsuffix .tmp,$$@) && mv $$(addsuffix .tmp,$$@) $$@

endef

all: $(addsuffix .txt,$(PMIDS))

$(eval $(foreach P,$(PMIDS),$(call fun,$P)))

then, invoke this Makefile using a parallel option (.e.g 5 parallel jobs), non-breaking:

make -j 5 -k 

Log in to answer this question.