From 705a4e6eafa5e48c776feb2273559717d33dad5a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 21 Mar 2018 18:20:52 +0000 Subject: [PATCH] max retmax as an argument in id mapping --- dc/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dc/utils.py b/dc/utils.py index 177b2ac..ef76b2f 100644 --- a/dc/utils.py +++ b/dc/utils.py @@ -8,11 +8,11 @@ Entrez.email = "hsiaoyi0504@gmail.com" -def get_pubmed_ids_from_phenotypes(phenotypes): +def get_pubmed_ids_from_phenotypes(phenotypes, retmax=200): pubmed_ids = [] for phen in phenotypes: query = phen - handle = Entrez.esearch(db='pubmed', term=query, rettype='medline', retmode='text', retmax=200) + handle = Entrez.esearch(db='pubmed', term=query, rettype='medline', retmode='text', retmax=retmax) record = Entrez.read(handle) handle.close() idList = record['IdList'] @@ -20,11 +20,11 @@ def get_pubmed_ids_from_phenotypes(phenotypes): return list(set(pubmed_ids)) -def get_pubmed_ids_from_rsids(rsids): +def get_pubmed_ids_from_rsids(rsids, retmax=200): pubmed_ids = [] for id in rsids: query = 'rs' + id + 'AND pubmed_snp_cited[sb]' - handle = Entrez.esearch(db='pubmed', term=query, rettype="medline", retmode="text", retmax=200) + handle = Entrez.esearch(db='pubmed', term=query, rettype="medline", retmode="text", retmax=retmax) record = Entrez.read(handle) handle.close() idList = record['IdList']