Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error for url #131

Open
RicardoMBorges opened this issue Jul 28, 2023 · 0 comments
Open

Error for url #131

RicardoMBorges opened this issue Jul 28, 2023 · 0 comments

Comments

@RicardoMBorges
Copy link

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"

href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.4/images/logos/EMBL-EBI/favicons/favicon.ico" />

<!-- 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 -->
<script src="https://assets.emblstatic.net/vf/v2.5.7/scripts/scripts.js"></script> <style>head, title, link, meta, style, script {--vf-stack-margin--custom: 0; }</style>
<!-- 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>
<style> .embl-grid { margin-bottom: 48px; } </style>

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.

Search
All Genomes & metagenomes Nucleotide sequences Protein sequences Small molecules Gene expression Gene-Disease Associations Diseases Molecular interactions Reactions & pathways Protein families Literature Samples & ontologies EMBL-EBI People EMBL-EBI web
      <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&amp;requestFrom=ebi_index&amp;query=blast">blast</a>
    <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&amp;query=keratin&amp;requestFrom=ebi_index">keratin</a>
    <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&amp;query=bfl1&amp;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>
<script nomodule crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default"></script> <script defer="defer" src="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.4/js/script.js"></script> <script> window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('create', 'UA-629242-1', 'auto'); </script> <script async src='https://www.google-analytics.com/analytics.js'></script> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function(event) { //- Code to execute when only the HTML document is loaded. //- This doesn't wait for stylesheets, // images, and subframes to finish loading. }); </script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant