sequence-viewer
Version:
A protein sequence viewer written in javascript
106 lines (63 loc) • 2.87 kB
Markdown
This is a code repository for the SIB - Swiss Institute of Bioinformatics CALIPHO group neXtProt project
See: http://www.nextprot.org/
[](https://travis-ci.org/calipho-sib/sequence-viewer)
> The sequence viewer is a super easy javascript library to use in order to draw a protein sequence in a readable way.

Live demo: https://cdn.rawgit.com/calipho-sib/sequence-viewer/master/examples/index.html
Simple example: https://cdn.rawgit.com/calipho-sib/sequence-viewer/master/examples/simple.html
1) Include the library using bower or npm or simply by including the javascript sequence-viewer.js
```
//BOWER//
bower install sequence-viewer
//NODE//
npm install sequence-viewer
```
2) Specify a div in your html
```
<div id="sequence-viewer"></div>
```
3) Create an instance of Sequence in javascript and apply the render method
```javascript
//For Node add before : var Sequence = require("sequence-viewer"); //
var seq = new Sequence('MALWMRLLPLLALLALWGPGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN');
// Render the sequence with or without rendering options
// (Check the interactive documentation)
seq.render('#sequence-viewer');
```
4) Et voila!

Note: if you choose the later approach with only the main javascript you should also include the dependencies, jquery,handlebars and bootstrap.min.css
Check out this interactive page for a better understanding of how to use the sequence viewer and its possibilities :
* https://cdn.rawgit.com/calipho-sib/sequence-viewer/master/examples/index.html
* Show chars per line
* Wrap lines
* Highlight
* Coverage
* Labels
* Toolbar (chars per line)
* Search
* Title
* sequenceMaxHeight
* Events
* Badge
[](https://search.nextprot.org/entry/NX_P01308/view/proteomics)
If you have any problem or suggestion please open an issue [here](https://github.com/calipho-sib/sequence-viewer/issues).
`git clone https://github.com/calipho-sib/sequence-viewer.git`
`npm install` (will install the development dependencies)
`bower install` (will install the browser dependencies)
...make your changes and modifications...
`npm run dist` (will create the min & bundle versions in dist/)
`npm run build` (will create the bundle js & css in build/ for node)
`grunt bump` (will push and add a new release)
`npm publish` (will publish in npm)
This software is licensed under the GNU GPL v2 license, quoted below.
Copyright (c) 2015, SIB Swiss Institute of Bioinformatics