Giter Site home page Giter Site logo

retmax about bionode-ncbi HOT 3 CLOSED

bionode avatar bionode commented on September 25, 2024
retmax

from bionode-ncbi.

Comments (3)

bmpvieira avatar bmpvieira commented on September 25, 2024

Yes, I need to add two options. One for limiting the number of results (right now it returns everything for a particular search) and another for changing the number of items asked per internal bionode-ncbi request to NCBI servers (currently 50). The latter doesn't affect the number of results since bionode-ncbi will paginate internally until it returns everything, but can affect performance and stability.

So if you do a search that will return 1000 items, bionode-ncbi will currently do sequentially 20 requests to NCBI. Increasing retmax for example to 500 so that it only does 2 requests can improve speed. However if you're running it in an pipeline, in some cases, it's better/faster to do many small requests and pipe frequently to other steps downstream than to wait for NCBI to process 500 items and then pipe all those items at once on your downstream processing.

Another reason to ask for less items per request is that for some NCBI databases, each item can contain a lot of data so asking for 500 can actually cause a timeout of the request.

So I'll probably keep the number of items per request low, or adjusted to the average item size for each type of database (e.g., sra, pubmed, biosample) but I will provide an option to override it so that advanced users can tweak it.

from bionode-ncbi.

vid avatar vid commented on September 25, 2024

Great. I'm interested in the first option. I am not using dat currently but will replace my own ncbi search with this and work on transitioning to dat.

from bionode-ncbi.

bmpvieira avatar bmpvieira commented on September 25, 2024

Option added:
bionode-ncbi search human --limit 10 (or just -l)

or in JavaScript

ncbi.search({ db: 'sra', term: 'human', limit: 10 }).on('data', console.log)

from bionode-ncbi.

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.