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

pviz

v0.1.14

Published

###Head straight for working examples, demo applications and code documentation [here](http://research-pub.gene.com/pviz/examples/)

Downloads

105

Readme

#pViz.js: a dynamic JavaScript & SVG library for visualization of protein sequence features

###Head straight for working examples, demo applications and code documentation here

##What is pViz.js? pViz.js is a protein sequence features viewer for modern browsers, based on a JavaScript library, SVG and css.

Given a sequence and a list of positioned features, it displays the sequence and aligns the features to the sequence. Features are layed out to not overlap each other, allowing zooming, interaction and customization.

Default sources can be explicitly defined in JavaScript (sky is the limit), DAS servers, PEFF (PSI extended Fasta format) or any combination of them.

Warning! pViz prefers modern browsers, such as Firefox, Chrome and Safari. Do not expect it to work on IE7, just upgrade.

##Hello World Creating a basic pViz application takes only three steps:

  1. Download two files from github.

    -pviz-bundle.min.js

    -pviz-core.css

  2. Create an HTML file in the directory, with the content shown below.

  3. Open the file in your browser.

.

<head>
  <link rel="stylesheet" type="text/css" href="pviz-core.css">
  <script src="pviz-bundle.min.js"></script>
</head>
<body>
  <div id="main"></div>
  <script>
    var pviz = this.pviz;
    var seqEntry = new pviz.SeqEntry({sequence : 'ABCDEFGIJKLMNOPQRSTUVWXYZ'});
    
    new pviz.SeqEntryAnnotInteractiveView({
      model : seqEntry,
      el : '#main'
      }).render();
      
    seqEntry.addFeatures([
      {category : 'foo', type : 'bar', start : 5, end : 12, text : 'hello'},
      {category : 'foo', type : 'bar', start : 9, end : 15, text : 'world'}]);
  </script>
</body>

Et voilà...The rendered features. In practice, the widget is zoomable

##How does it work? ###Principles A SeqEntry object contains a sequence, a list of features (and whatever you may find convenient for later display).

###Structure

Features are added to the model (if the view is already instanciated, it will be updated once the features are received, thanks to backbone.js). A feature is a JavaScript object (a plain hashmap, though), containing several fields

  • groupSet [optional]: a group of categories which allows features with the same category name, to be grouped at first by groupSet;
  • category: all features from the same category will be handled in the same layer;
  • categoryType [optional]: has no grouping purpose, but allows to define properties among different categories (track height, css);
  • type: within a category, features can have different types, offering the possibility for custom render (default is just a rectangle) or interaction;
  • start: starting position (0 is the first amino acid of the sequence);
  • end: an inclusive end position;
  • text [optional]: text to be be displayed in the default rectangle;
  • Whatever you may need for customized display or interaction.

###Third parties dependencies pViz library uses D3 for SVG generation, backbone.js framework for the model/view framework, Twitter Bootstrap for the css, underscore.js library for convenient utilities, and require.js for dependency management.

But do not worry, including the packaged distribution bundles all of them for you.

##Examples ###The working examples and demo applications can be found here.

####Full documentation can be found here.

Easier than a full documentation, we bring some demonstration use cases:

NB: download the project locally, at least on your file system, to get javascript executed;

##And more ###A few comments on the code The JavaScript library relies on some "modern" language components. That said, you can either use the bundled library (with all dependencies) or created you own application using require.js and checked out source code.

####Unit testing Via Jasmine, either in the browser (test/index.html) or command line with phantom.js

####Continuous integration Testing, distribution etc. can be launched in a CI environment via grunt tasks grunt test, build...

####Build code documentation JsDoc3 annotations were used to document the library. To generate the doc (in examples/doc directory):

grunt jsdoc

####Build code documentation JsDoc3 annotations were used to document the library. To generate the doc (in examples/doc directory):

###Authors

This library was initiated by Alexandre Masselot ([email protected]) & Kiran Mukhyala ([email protected]) within Genentech Bioinformatics & Computational Biology Department.

###Reference Please refer to this library via "Visualization of protein sequence features using JavaScript and SVG with pViz.js - Mukhyala K, Masselot A - Bioinformatics. 2014 Aug"

###License The library is distributed under a BSD license. Full description can be found in LICENSE.txt