How to connect to PubMed database?
1
0
Entering edit mode
7.7 years ago
agata88 ▴ 870

Hi all!

I would like to write a program in python which will connect to PubMed database and according to rs number or nucleotide change find all PubMed Ids. In addition I would like to have PubMed ID only for polish population - publications where polish population is mentioned.

Could you please give me some suggestion? Maybe there is a python library which could make everything easier?

Best,

Agata

ncbi pubmed • 1.3k views
ADD COMMENT
4
Entering edit mode
7.7 years ago
Medhat 9.7k

Entrez package from BioPython will help you to achieve your goal and also here is a full documentation of BioPython

example to get article Id about Polish

from Bio import Entrez
def search(query):
    Entrez.email = 'yourEmail@example.com'
    handle = Entrez.esearch(db='pubmed', 
                            sort='relevance', 
                            retmax='20',
                            retmode='xml', 
                            term=query)
    results = Entrez.read(handle)
    return results

my_id_list = search("poland")["IdList"]

Good luck.

ADD COMMENT
0
Entering edit mode

That is great! Thank you a lot!

ADD REPLY

Login before adding your answer.

Traffic: 2956 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6