diff --git a/pypath/inputs/biomart.py b/pypath/inputs/biomart.py index 21f7ce329..5b576f9d5 100644 --- a/pypath/inputs/biomart.py +++ b/pypath/inputs/biomart.py @@ -30,6 +30,7 @@ import pypath.share.common as common import pypath_common.data as _data import pypath.share.curl as curl +import pypath.share.settings as settings import pypath.resources.urls as urls import pypath.utils.taxonomy as taxonomy @@ -135,7 +136,12 @@ def biomart_query( xml_query = rewsp.sub('', xml_query) biomart_url = urls.urls['ensembl']['biomart_url'] % xml_query - c = curl.Curl(biomart_url, large = True, silent = False) + c = curl.Curl( + biomart_url, + req_headers = [settings.get('user_agent')], + large = True, + silent = False, + ) success = False for line in c.result: @@ -231,7 +237,7 @@ def biomart_microarray_types(organism: int | str = 9606): organism = taxonomy.ensure_ensembl_name(organism) url = urls.urls['ensembl']['arraytypes'] % organism - c = curl.Curl(url) + c = curl.Curl(url, req_headers = [settings.get('user_agent')]) result = json.loads(c.result) _ = [ diff --git a/pypath/inputs/ensembl.py b/pypath/inputs/ensembl.py index 157b349e9..15306fd4f 100644 --- a/pypath/inputs/ensembl.py +++ b/pypath/inputs/ensembl.py @@ -24,6 +24,7 @@ import pypath.resources.urls as urls import pypath.share.curl as curl +import pypath.share.settings as settings """ @@ -43,7 +44,7 @@ def ensembl_organisms(): record = None result = [] url = urls.urls['ensembl']['species'] - c = curl.Curl(url) + c = curl.Curl(url, req_headers = [settings.get('user_agent')]) with warnings.catch_warnings():