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

nextprot-cli

v0.3.1

Published

neXtProt API and SPARQL client (for node command line interface)

Downloads

31

Readme

nextprot-cli

NPM version

Javasript Client of neXtProt (https://search.nextprot.org).

neXtProt contains a comprehensive set of human proteins knwoledge.

This module contains methods to access the neXtProt API (https://api.nextprot.org) as well as the SPARQL endpoint (http://snorql.nextprot.org).

Getting Started

Install the module with:

npm install nextprot-cli

Create a file, for example test-nextprot.js and write some javascript code: Import the module in your code and provide some information about your application:

var NextProtClient = require("nextprot-cli");

//neXtProt is free to use but we appreciate some information about your application and who you are :)
var applicationName = "my test application";
var clientInformation = "Student at UNIGE";
var nx = new NextProtClient(applicationName, clientInformation);

Once you have initialized the object you can either request the API directly in the following manner:

//Refer to API (https://api.nextprot.org) to get an extensive list of possible protein blocks
nx.getProteinBlock('NX_P01308', 'isoform', function (data) {
    data.entry.isoforms.map(function (i) {
        console.log(i.sequence)
    })
});

//node test-nextprot.js
//Will print out the sequence of the protein P01308 (insulin)
MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN

Or run a SPARQL query against the neXtProt SPARQL endpoint. See https://snorql.nextprot.org for more examples


var chromosome = 13;
//Refer to http://snorql.nextprot.org for more example queries
var sparqlQuery = 'select distinct ?entry where { ?entry :gene / :chromosome "'+ chromosome +'"^^xsd:string}'

nx.executeSPARQL(sparqlQuery, function(data) {
	console.log("Found " + data.results.bindings.length + " entries ");
});

//node test-nextprot.js
//Will print the number of entries that have a gene on chromosome 13
Found 328 entries

You can even combine both (API and SPARQL), look at the examples folder for working code.

Support

If you have any problem or suggestion please open an issue here.

License

This software is licensed under the GNU GPL v2 license, quoted below.

Copyright (c) 2015, SIB Swiss Institute of Bioinformatics