X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=blobdiff_plain;f=htsworkflow%2Fsubmission%2Fncbi.py;fp=htsworkflow%2Fsubmission%2Fncbi.py;h=89c0dc2f2e9d697ca66ded2fc911445de3152ec6;hp=3cc87365ce0186fdeb2c6024bbba84fd04c6c4fa;hb=53ebb47e86e81ce349d4ef4e16aef94be93486ea;hpb=4262586d10cc0cc227390873b301b55244204c11 diff --git a/htsworkflow/submission/ncbi.py b/htsworkflow/submission/ncbi.py index 3cc8736..89c0dc2 100644 --- a/htsworkflow/submission/ncbi.py +++ b/htsworkflow/submission/ncbi.py @@ -9,7 +9,7 @@ from lxml.etree import parse, XSLT, tostring, fromstring from optparse import OptionParser import os import RDF -import urllib +import urllib.request, urllib.parse, urllib.error from htsworkflow.util.rdfhelp import get_model, dump_model @@ -35,7 +35,7 @@ def search_ncbi_ids(database, term, return_max=200): search = {'db': database, 'term': term, 'retmax': return_max} - tree = parse(ESEARCH_URL + urllib.urlencode(search)) + tree = parse(ESEARCH_URL + urllib.parse.urlencode(search)) root = tree.getroot() count = get_node_scalar(root, '/eSearchResult/Count', int) retmax_node = get_node_scalar(root, '/eSearchResult/RetMax', int) @@ -56,7 +56,7 @@ def parse_sra_metadata_into_model(model, ncbi_id): """ search = {'db':DB, 'id': ncbi_id} - url = EFETCH_URL + urllib.urlencode(search) + url = EFETCH_URL + urllib.parse.urlencode(search) tree = parse(url) context = Context()