-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Hello,
I wrote a small jupyter notebook script that gets lists from chembl. It ran the first couple of times, but now is giving me this error and I don´t know how to go around this: HttpApplicationError: Error for url https://www.ebi.ac.uk/chembl/api/data/molecule.json, server response: <!doctype HTML>
Can someone give a help for these sort of things?
Thanks
My script:
chembl websource
from chembl_webresource_client.new_client import new_client
Filter CHEMBL for compound of interest. Note that this can be modified (see: )
molecules = new_client.molecule
Select Drugs with molecular weight <= 2000
small_molecules = molecules.filter(molecule_properties__mw_freebase__lte=2000)
Consider filtering for Natural Products. Note that this might be faulty.
NPs = small_molecules.filter(natural_product=1)
Select Approved Drugs
approved_drugs_small = NPs.filter(max_phase=4).order_by('molecule_properties__mw_freebase')
Approved_drugs_small_NP = pd.DataFrame(approved_drugs_small)
The error:
HttpApplicationError Traceback (most recent call last)
Input In [6], in <cell line: 12>()
10 # Select Approved Drugs
11 approved_drugs_small = NPs.filter(max_phase=4).order_by('molecule_properties__mw_freebase')
---> 12 Approved_drugs_small_NP = pd.DataFrame(approved_drugs_small)
14 Approved_drugs_small_NP2 = Approved_drugs_small_NP[["molecule_chembl_id","molecule_structures","pref_name","natural_product"]].copy()
15 Approved_drugs_small_NP2["molecule_structures"] = Approved_drugs_small_NP2["molecule_structures"].astype(str).str.split(",").str[0]
File ~/env_rmb_rdkit/lib/python3.8/site-packages/pandas/core/frame.py:710, in DataFrame.init(self, data, index, columns, dtype, copy)
708 data = np.asarray(data)
709 else:
--> 710 data = list(data)
711 if len(data) > 0:
712 if is_dataclass(data[0]):
File ~/env_rmb_rdkit/lib/python3.8/site-packages/chembl_webresource_client/query_set.py:127, in QuerySet.next(self)
126 def next(self):
--> 127 return self.next()
File ~/env_rmb_rdkit/lib/python3.8/site-packages/chembl_webresource_client/query_set.py:115, in QuerySet.next(self)
113 self.chunk = self.query.get_page()
114 if not self.chunk or self.current_index >= len(self.chunk):
--> 115 self.chunk = self.query.next_page()
116 if not self.chunk:
117 raise StopIteration
File ~/env_rmb_rdkit/lib/python3.8/site-packages/chembl_webresource_client/url_query.py:434, in UrlQuery.next_page(self)
432 start = self.start
433 self.current_index = int(start + self.limit * (self.current_page + 1))
--> 434 return self.get_page()
File ~/env_rmb_rdkit/lib/python3.8/site-packages/chembl_webresource_client/url_query.py:394, in UrlQuery.get_page(self)
392 self.logger.info('From cache: {0}'.format(res.from_cache if hasattr(res, 'from_cache') else False))
393 if not res.ok:
--> 394 handle_http_error(res)
395 if self.frmt == 'json':
396 json_data = res.json()
File ~/env_rmb_rdkit/lib/python3.8/site-packages/chembl_webresource_client/http_errors.py:113, in handle_http_error(request)
111 exception_class = status_to_exception.get(request.status_code, BaseHttpException)
112 if request.text:
--> 113 raise exception_class(request.url, request.text)
114 raise exception_class(request.url, request.content)
HttpApplicationError: Error for url https://www.ebi.ac.uk/chembl/api/data/molecule.json, server response: <!doctype html>
<script> // Detect if JS is on and swap vf-no-js for vf-js on the html element (function(H){H.className=H.className.replace(/\bvf-no-js\b/,'vf-js')})(document.documentElement); </script><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <link rel="stylesheet" media="all" href="/css/styles.css?" /> -->
<title>Error: 500 | EMBL�s European Bionformatics Institute</title>
<link rel="icon" type="image/x-icon"
<!-- Search indexing optimisations -->
<meta class="swiftype" name="what" data-type="string" content="none" />
<meta class="swiftype" name="where" data-type="string" content="EMBL-EBI" />
<!-- Descriptive meta -->
<meta name="title" content="Error: 500">
<meta name="author" content="European Bioinformatics Institute">
<meta name="robots" content="index, follow">
<meta name="keywords" content="">
<meta name="description" content="">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.ebi.ac.uk/info/error-pages/500-standalone/">
<meta property="og:title" content="Error: 500">
<meta property="og:description" content="">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="og:url" content="https://www.ebi.ac.uk/info/error-pages/500-standalone/">
<meta property="twitter:title" content="Error: 500">
<meta property="twitter:description" content="">
<!-- Content descriptors -->
<meta name="embl:who" content="EMBL-EBI Web Dev">
<meta name="embl:where" content="EMBL-EBI">
<meta name="embl:what" content="none">
<meta name="embl:active" content="where">
<!-- Content role -->
<meta name="embl:utility" content="10">
<meta name="embl:reach" content="0">
<!-- Page infromation -->
<meta name="embl:maintainer" content="EMBL-EBI Web Dev">
<meta name="embl:last-review" content="2021.04.01">
<meta name="embl:review-cycle" content="365">
<meta name="embl:expiry" content="never">
<!-- analytics -->
<meta name="vf:page-type" content="404;dimension1">
<!-- CSS only -->
<!-- See the EBI Header Footer docs: https://stable.visual-framework.dev/components/ebi-header-footer -->
<link rel="stylesheet" href="https://assets.emblstatic.net/vf/v2.4.5/assets/ebi-header-footer/ebi-header-footer.css" type="text/css" media="all">
<header id="masthead-black-bar" class="clearfix masthead-black-bar | ebi-header-footer vf-content vf-u-fullbleed"></header>
Error: 500
There was a technical error.
Something has gone wrong with our web server when attempting to make this page.
Unfortunately, the service you are trying to access is currently unavailable.
Please try again later.
<button type="submit" class="vf-search__button | vf-button vf-button--primary">
<span class="vf-button__text">Search</span>
</button>
</div>
</form>
<p class="vf-text-body--5 vf-u-margin__bottom--0">
Example searches: <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&requestFrom=ebi_index&query=blast">blast</a>
<a class="vf-link" href="/ebisearch/search.ebi?db=allebi&query=keratin&requestFrom=ebi_index">keratin</a>
<a class="vf-link" href="/ebisearch/search.ebi?db=allebi&query=bfl1&requestFrom=ebi_index">bfl1</a>
| <a class="vf-link" href="https://www.ebi.ac.uk/ebisearch/overview.ebi/about">About EBI Search</a>
</p>
</section>
Need assistance?
Contact our support team<!-- embl global footer -->
<script src="https://assets.emblstatic.net/vf/v2.4.9/scripts/scripts.js"></script>