https://github.com/lh3/bioseq-js
For live demo, see http://lh3lh3.users.sourceforge.net/bioseq.shtml
https://github.com/lh3/bioseq-js
bioinformatics sequence-alignment
Last synced: 2 months ago
JSON representation
For live demo, see http://lh3lh3.users.sourceforge.net/bioseq.shtml
- Host: GitHub
- URL: https://github.com/lh3/bioseq-js
- Owner: lh3
- License: other
- Created: 2015-04-15T19:47:50.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-08-08T20:16:54.000Z (over 6 years ago)
- Last Synced: 2025-01-18T14:29:08.516Z (about 1 year ago)
- Topics: bioinformatics, sequence-alignment
- Language: HTML
- Homepage:
- Size: 16.6 KB
- Stars: 37
- Watchers: 4
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
In an online conversation, Istvan Albert was complaining he could not find a
good Smith-Waterman implementation in Javascript. I thought I could write one
over night by porting ksw.c to javascript. It took longer than I planned
because I found a couple of subtle bugs in ksw.c. And while I was porting the C
code to javascript, I realized that it is not that difficult to merge local and
banded global alignments in one function. Achieving that also took extra time.
The end product is a fast and lightweight javascript library for affine-gap
local and banded global pairwise alignment. With a modern Javascript engine, it
is not much slower than a non-SSE C implementation.
The inline comments briefly explain the APIs. Here is a tiny example:
```html
var target = 'ATAGCTAGCTAGCATAAGC';
var query = 'AGCTAcCGCAT';
var isLocal = false;
var match = 1, mis = -1, gapOpen = -1, gapExt = -1
var rst = bsa_align(isLocal, target, query, [match,mis], [gapOpen,gapExt]);
var str = 'score='+rst[0]+'; pos='+rst[1]+'; cigar='+bsa_cigar2str(rst[2])+"\n";
var fmt = bsa_cigar2gaps(target, query, rst[1], rst[2]);
str += fmt[0] + '\n' + fmt[1] + '\n';
alert(str);
```
More complete interface is the HTML page in this repo. A live demo is
[here][demo].
[demo]: http://lh3lh3.users.sourceforge.net/bioseq.shtml