Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit fd649cc1 authored by Thonier Florian's avatar Thonier Florian Committed by Mathieu Giraud

bioseq.js; add qunit file

Add test of basic alignement
add test with degenerated sequences
parent 81e20b50
QUnit.module("lib_bioseq", {
});
QUnit.test("degenerated alignment", function(assert) {
sequence = "CGTTTTACTACTGTGCTGCGTGTCTGGGGA"
prim_raw = "CGTTTTACTACTGTGCTGCGTGTCTGGGGA"
prim_degen = "CGTTyTACTACTGTsCTrvGTGTCTGGGGA"
prim_degen_last = "CGTTyTACTACTGTsCTrvGTGTCTGGGGd"
prim_degen_first = "vGTTyTACTACTGTsCTrvGTGTCTGGGGA"
// identical sequences
var rst = bsa_align(true, sequence, prim_raw, [1, -2], [-2, -1]) // return [score, start pos, ~cigar]
var nb_match = bsa_cigar2match(rst[2])
var cigar = bsa_cigar2str(rst[2])
assert.equal(30, nb_match, 'Correct alignment even with degenerated nucleotides (except if last nt is degenerated)')
assert.equal("30M", cigar, 'Correct cigar even with degenerated nucleotides (except if last nt is degenerated)')
// some degenerated nt
rst = bsa_align(true, sequence, prim_degen, [1, -2], [-2, -1])
nb_match = bsa_cigar2match(rst[2])
cigar = bsa_cigar2str(rst[2])
assert.equal(30, nb_match, 'Correct alignment even with degenerated nucleotides')
assert.equal("30M", cigar, 'Correct cigar even with degenerated nucleotides')
// some degenerated nt + one at last position
rst = bsa_align(true, sequence, prim_degen_last, [1, -2], [-2, -1])
nb_match = bsa_cigar2match(rst[2])
cigar = bsa_cigar2str(rst[2])
assert.equal(29, nb_match, 'Correct alignment even with degenerated nucleotides (except if last nt is degenerated)')
assert.equal("29M1S", cigar, 'Correct cigar even with degenerated nucleotides (except if last nt is degenerated)')
// some degenerated nt + one at first position
rst = bsa_align(true, sequence, prim_degen_first, [1, -2], [-2, -1])
nb_match = bsa_cigar2match(rst[2])
cigar = bsa_cigar2str(rst[2])
assert.equal(29, nb_match, 'Correct alignment even with degenerated nucleotides (except if last nt is degenerated)')
assert.equal("1S29M", cigar, 'Correct cigar even with degenerated nucleotides (except if last nt is degenerated)')
})
......@@ -16,12 +16,10 @@
}
</style>
<<<<<<< HEAD
<script type="text/javascript" src="../../js/lib/qunit-2.9.1.js"></script>
<script>QUnit.config.autostart=false; </script>
<script type="text/javascript" src="../../js/lib/qunit-tap.js"></script>
<script data-main="app.js" src="../../js/lib/require.js"></script>
=======
<script type="text/javascript" src='../../js/lib/d3.v5.min.js'></script>
<script type="text/javascript" src="../../js/lib/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../js/lib/jquery.form.js"></script>
......@@ -65,7 +63,6 @@
<script type="text/javascript" src='../../js/indexedDom.js' data-cover></script>
<script type="text/javascript" src='../../js/form_builder.js' data-cover></script>
>>>>>>> bioseq.js; Add an external script that allow to make alignment of sequence in the client
<script type="text/javascript" src="./testFiles/data_test.js"></script>
<script type="text/javascript" src="./testFiles/test2.analysis"></script>
</head>
......@@ -84,6 +81,58 @@
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<!-- Load QUnit -->
<script type="text/javascript" src="../../js/lib/qunit-2.9.1.js"></script>
<script type="text/javascript" src="./qunit-vidjil.js"></script>
<script type="text/javascript" src="../../js/lib/qunit-tap.js"></script>
<script src="../../js/lib/blanket.1.1.9.js"></script>
<script>
var tap_output;
qunitTap(QUnit, function() {
if (typeof arguments != "undefined"){
tap_output+=arguments[0]+"\n"
}
});
jQuery.fn.d3Click = function () {
this.each(function (i, e) {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
e.dispatchEvent(evt);
});
};
var c_attributes = C_CLUSTERIZABLE
| C_INTERACTABLE
| C_IN_SCATTERPLOT
| C_SIZE_CONSTANT
</script>
<script src="./testFiles/form_test.js"></script>
<script src="./testFiles/dbscan_test.js"></script>
<script src="./testFiles/model_test.js"></script>
<script src="./testFiles/model_loader_test.js"></script>
<script src="./testFiles/clone_test.js"></script>
<script src="./testFiles/scatterPlot_test.js"></script>
<!--<script src="./testFiles/axis_test.js"></script>-->
<script src="./testFiles/graph_test.js"></script>
<script src="./testFiles/com_test.js"></script>
<script src="./testFiles/info_test.js"></script>
<script src="./testFiles/list_test.js"></script>
<script src="./testFiles/indexedDom_test.js"></script>
<script src="./testFiles/segmenter_test.js"></script>
<script src="./testFiles/tools_test.js"></script>
<script src="./testFiles/germline_test.js"></script>
<script src="./testFiles/url_test.js"></script>
<script src="./testFiles/shortcut_test.js"></script>
<script src="./testFiles/speed_test.js"></script>
<script src="./testFiles/tokeniser_test.js"></script>
<script src="./testFiles/compare_test.js"></script>
<!-- libs -->
<script src="./testFiles/lib/bioseq_test.js"></script>
</body>
......
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