Commit 81e20b50 authored by flothoni's avatar flothoni Committed by Mathieu Giraud

tools.js; move a local function for bioseq lib into tools script

Also add informations about library in info.txt
parent 5f5ccdd2
......@@ -324,21 +324,3 @@ function bsa_cigar2str(cigar)
s.push((cigar[k]>>4).toString() + "MIDNSHP=XB".charAt(cigar[k]&0xf));
return s.join("");
}
/**
* Return the number of match from an alignment cigar
*/
function bsa_cigar2match(cigar)
{
var sum = 0
for (var k = 0; k < cigar.length; ++k){
var match = (cigar[k]>>4 )
var type = (cigar[k]&0xf)
if (type == 0){
sum += match
}
}
return sum
}
bioseq.js : fast and lightweight javascript library for affine-gap local and banded global pairwise alignment (Smith-Waterman)
* @version d8adcf1 (2019-08-08)
* @author Heng Li (lh3)
* @link https://github.com/lh3/bioseq-js
* @license MIT
d3-v3 : framework svg pour graphique/scatterplot
* @version 5.14.1 (2019)
* @author Michael Bostock
......
......@@ -819,3 +819,22 @@ function removeEltAndDecrease(array, value) {
}
return array
}
/**
* Return the number of match from an alignment cigar
* Cigar is given by function bsa_align of bioseq library
*/
function bsa_cigar2match(cigar)
{
var sum = 0
for (var k = 0; k < cigar.length; ++k){
var match = (cigar[k]>>4 )
var type = (cigar[k]&0xf)
if (type == 0){
sum += match
}
}
return sum
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment