npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ncbi-eutils-xml

v0.2.2

Published

Fork of ncbi-eutils using pixl-xml for XML parsing.

Downloads

3

Readme

ncbi-eutils

This package is a JavaScript wrapper for NCBI's E-utilities API documented at http://www.ncbi.nlm.nih.gov/books/NBK25500/. It uses ES6 promises to support "piping" to combine successive E-utility calls, e.g. piping esearch results to elink, then piping its result to esummary. This can be used in node (CommonJS) or the browser.

npm version npm version

Usage

Access a single eutil:

  var eutils = require('ncbi-eutils');
  eutils.esearch({db:'gene', term: 'foxp2[sym] AND human[orgn]'})
    .then(function(d){console.log(d)}) 

Basic data pipelines: esearch -> esummay

  eutils.esearch({db:'gene', term: 'ltf[sym] AND human[orgn]'})
    .then(eutils.esummary)
    .then(function(d){console.log(d)})

More complex data pipelines: esearch -> elink -> esummary

  eutils.esearch({db: 'protein', term: '15718680[UID]'})
    .then(eutils.elink({dbto:'gene'}))
    .then(function(d) {
      //supported eutil parameters can be added like this
      d.retstart = 5;
      return eutils.esummary(d);
    })
    .then(function (d) {console.log(d)})
    .catch(function (d) {console.log(d)});

Install

npm install --save ncbi-eutils

or in a browser

<script src="ncbi-eutils.min.js"></script>
<script>
      var eutils = require('ncbi-eutils');
      ...
</script>

API

All calls in this package return a promise object. To get the return values, pass a function to .then() or .catch() to get the results and errors, respectively. Alternatively, pass another eutil function to .then() to create a data pipeline. For detailed descriptions of each E-utility, please visit NCBI's documentations.

eutils.einfo([db])

If db is specified, return all metadata for that database. Otherwise, return the list of all available NCBI databases. To see a live example of this, go to: http://linjoey.github.io/ncbi-eutils/docs/dbinfo.html.

eutils.esearch(options)

Provides a list of UIDs matching a text query

options.db a valid NCBI database name

options.term a valid search term

eutils.esummary(options)

Returns document summaries (DocSums) for a list of input UIDs

options.db a valid NCBI database name

options.id array of ids to pass to esummary e.g ['12345', '67890']. Only required if called as the start of a pipeline.

eutils.efetch(options)

Returns formatted data records for a list of input UIDs

options.db a valid NCBI database name

options.id array of ids to pass to efetch e.g ['12345', '67890']. Only required if called as the start of a pipeline.

eutils.elink(options)

Returns UIDs linked to an input set of UIDs in either the same or a different Entrez database

options.dbto a valid NCBI database name

options.dbfrom a valid NCBI database name. Only required if called as the start of a pipeline.

options.id array of ids to pass to esummary e.g ['12345', '67890']. Only required if called as the start of a pipeline.

Dev Agenda

  • [ ] Fix up efetch to support more user options
  • [x] test complex pipelines e.g. esearch | elink | efetch
  • [ ] implement other eutils: espell, egquery, ecitmatch?
  • [x] implement convenience calls for esearch -> esummary
  • [ ] write test test test
  • [ ] elink-> results dont have auto history server, relinking to other eutils use manual id passing. Implement epost to support large tasks

NCBI Copyright & Disclaimers

Please visit http://www.ncbi.nlm.nih.gov/About/disclaimer.html for NCBI's copyright notice.

License

MIT