Commit 99ed41da authored by Thonier Florian's avatar Thonier Florian Committed by Mathieu Giraud

bioseq.js; add simple qunit tests

Test simple case with or without mismatchs
parent fd649cc1
Pipeline #234930 failed with stages
in 1 minute and 5 seconds
...@@ -4,6 +4,29 @@ QUnit.module("lib_bioseq", { ...@@ -4,6 +4,29 @@ QUnit.module("lib_bioseq", {
}); });
QUnit.test("simple alignment", function(assert) {
var sequence = "catcatcatgatgctacg" // clone test5; pos 6 in list
var mismatch = "catcGtcaCCatgctacg" // 3x mismatch
// identical sequences
var rst = bsa_align(true, sequence, sequence, [1, -2], [-2, -1]) // return [score, start pos, ~cigar]
var nb_match = bsa_cigar2match(rst[2])
var cigar = bsa_cigar2str(rst[2])
assert.equal(18, nb_match, 'Correct alignment')
assert.equal("18M", cigar, 'Correct cigar')
// sequences with 3 mimsmatch
var rst = bsa_align(true, sequence, mismatch, [1, -2], [-2, -1]) // return [score, start pos, ~cigar]
var nb_match = bsa_cigar2match(rst[2])
var cigar = bsa_cigar2str(rst[2])
assert.equal(15, nb_match, 'Correct alignment')
assert.equal("5M1S3M2S8M", cigar, 'Correct cigar')
})
QUnit.test("degenerated alignment", function(assert) { QUnit.test("degenerated alignment", function(assert) {
sequence = "CGTTTTACTACTGTGCTGCGTGTCTGGGGA" sequence = "CGTTTTACTACTGTGCTGCGTGTCTGGGGA"
......
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