GithubHelp home page GithubHelp logo

jamesjeffryes / pyclassyfire Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 4.0 202 KB

A python client for the ClassyFire API

Home Page: https://jamesjeffryes.github.io/pyclassyfire/

License: MIT License

Python 100.00%
cheminformatics ontologies api-client

pyclassyfire's Introduction

pyclassyfire

Build Status Codacy Badge

This package provides a set of helper functions in python for annotating chemical structures with the chemical ontology developed by Djoumbou et. al using the ClassyFire API

pyclassyfire's People

Contributors

jamesjeffryes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pyclassyfire's Issues

Unicode decoding problem with function client.sdf_query()

Dear James,

Thank you for having written such a Python interface to Classyfire!

I submitted the unzipped file
buffer16.zip
to function call client.sdf_query(filenameBuffer, filenameOut) and an exception was raised:

1 queries submitted to ClassyFire API
0 percent complete
Traceback (most recent call last):
File "run2.py", line 93, in
client.sdf_query(filenameBuffer, filenameOut)
File "C:\Users\jmn\Documents\CNRS20\Publis\PNMRNP_STARTED\Biblio\pyclassyfire-master\pyclassyfire\client.py", line 223, in sdf_query
outfile.write(get_results(query_ids[i], return_format='sdf'))
File "C:\Users\jmn\Anaconda3\envs\rdkit3\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u03b1' in position 8847: character maps to

It looks like classification by classyfire was successful but some unicode character cannot be inserted in the resulting .sdf file.

\u03b1 is the unicode encoding for the greek letter alpha, not so uncommon in chemistry.

Could you please indicate a fix or a workaround?

Many thanks in advance.
Best regards,

Jean-Marc

KeyError: 'number_of_pages'

Hello,

Do you know why i get the following error with the test file?:

Line of code:
open("test_datatable_result_inchi.json", "w").write(json.dumps(get_results_multientry_multipage_patient(query_ids, return_format="json")))

Thanks a lot in advance!!
Best, Michelle

DEBUG:urllib3.connectionpool:http://classyfire.wishartlab.com:80 "GET /queries/6188679.json HTTP/1.1" 500 48

KeyError Traceback (most recent call last)
in
----> 1 open("test_datatable_result_inchi.json", "w").write(json.dumps(get_results_multientry_multipage_patient(query_ids, return_format="json")))

~\anaconda3\lib\site-packages\pybatchclassyfire\pybatchclassyfire.py in get_results_multientry_multipage_patient(query_ids_list, return_format)
596
597 result = json.loads(r.text)
--> 598 num_pages = result["number_of_pages"]
599
600

KeyError: 'number_of_pages'

batch queries (SMILES)

Hi! I am new using this classyfire API. I just wanna know how to do queries with multiple SMILES.
Is that possible?

For example: O=Cc1ccc(O)c(OC)c1, CC(=O)NCCC1=CNc2c1cc(OC)cc2, CN1CCC[C@H]1c2cccnc2

Can I use this 3 SMILES in the same input file? I didn´t find how to do it.

thanks!

regards!

"0 percent complete" forever

Dear James,

I am facing a new problem now.
After a successful trial of client.sdf_query() with a batch of 1000 molecules in about 1 minute,
running a second batch of 1000 molecules resulted after about 15 minutes (still running...)
in many "0 percent complete" lines (about 1 per minute).
Is this a problem from the server side?
Is there some usage quota?

Best regards,

Jean-Marc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.