Code Monkey home page Code Monkey logo

Comments (6)

mnowotka avatar mnowotka commented on September 15, 2024

Hi,
This week I'm working on improving the speed so I'm happy to have a look at your example and experiment with different settings both on the client and server side. Can you please give a list of ~5k targets that give take you 2m45s to retrive activities?

from chembl_webresource_client.

spadavec avatar spadavec commented on September 15, 2024

It appears that I goofed, and the slow part isn't the data retrieval, but the conversion/looping-through the list of dicts to just a list of lists of the relevant properties:

for x in chembl_ids:
    if x not in existing_files:
        print("Checking CHEMBL id {}".format(x))
        res = activity.filter(target_chembl_id='{}'.format(x), relation='=', assay_type='B', standard_type="IC50")
        print("Data retrieved")

        for i,z in enumerate(res):
            if z['parent_molecule_chembl_id'] and z['canonical_smiles'] and z['standard_value'] is not None:
                temp.append([str(z['parent_molecule_chembl_id']), str(z['canonical_smiles']), float(z['standard_value'])])

        write_csv(x, temp)

The data retrieval itself looks to take ~1-2s, but the conversion takes the remaining few minutes, at least.

from chembl_webresource_client.

mnowotka avatar mnowotka commented on September 15, 2024

OK, in that case is there anything I can help you here?

from chembl_webresource_client.

mnowotka avatar mnowotka commented on September 15, 2024

BTW: if you just rerun your script and noticed it's much faster it can because now the results are cached on the client side so you may concider clearing cache or configuring the client not to use the cache during profiling.

from chembl_webresource_client.

spadavec avatar spadavec commented on September 15, 2024

Ah, thanks for the clarification. Didn't know things were getting cached on our side--it still seems that that bulk of the time is in processing of the dict being returned, so I'll close this out!

from chembl_webresource_client.

mnowotka avatar mnowotka commented on September 15, 2024

No worries, I'm still optimising the API performance, next week it should work smoother but don't expect any dramatic improvements.

from chembl_webresource_client.

Related Issues (20)

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.