Commit 2da7c4fa authored by Mathieu Giraud's avatar Mathieu Giraud

tests: add test, getPrintableSize() and normalized_reads

parent 22537194
Pipeline #56906 failed with stages
in 18 seconds
......@@ -117,6 +117,7 @@ var json_clone5 = {
// Clone with normalized_reads
var json_clone6 = {
"id" : "id6",
"germline" : "TRG",
"reads" : [10,10,0,30],
"normalized_reads" : [20,20,0,30],
}
......
......@@ -357,7 +357,7 @@ QUnit.test("model: primer detection", function(assert) {
QUnit.test("normalization: test", function(assert) {
QUnit.test("normalization", function(assert) {
var m = new Model();
m.parseJsonData(json_data, 100)
var c1 = new Clone(json_clone1, m, 0)
......@@ -379,11 +379,15 @@ QUnit.test("normalization: test", function(assert) {
assert.equal(m.normalize(c2.getSize(),0),0.8000000000000002,"normalize")
m.set_normalization(m.NORM_FALSE)
m.compute_normalization(-1,0)
assert.equal(c6.getSize(), 0.05, "no normalization: 10 / 200")
assert.includes(c6.getPrintableSize(), "10 reads (5.000%", "no normalization: 10 / 200")
assert.equal(c2.getSize(), 0.05, "clone3 size ")
// Switch normalization to external (field normalized_reads)
m.set_normalization(m.NORM_EXTERNAL)
assert.equal(c6.getSize(), 0.1, "external normalization: 20 / 200")
assert.includes(c6.getPrintableSize(), "10 reads [20 normalized] (10.00%", "external normalization: 10 / 200, getPrintableSize")
assert.equal(c6.getSize(2), 0, "external normalization: 0 / 100")
assert.equal(c6.getSize(3), 0.3, "external normalization: 30 / 100")
assert.equal(c2.getSize(), 0.05, "external normalization have no effect on clone without field")
......
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