Commit 56497336 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

Merge branch 'feature-c/4541-boucle-infinie-samples-caches' into 'dev'

Resolve "Boucle infinie au chargement d'un fichier avec des samples cachés"

Closes #4619 and #4541

See merge request !838

(cherry picked from commit 83160213)

74cd7e22 tools.js; add a function to clean an array of duplicates
e7231026 Add a condition to use calculateOrder function
8f4e88db qunit, add test for tools script and removeDuplicate function
0cb094b4 tools; add a function to remove position from array and decrease upper values
50ae1a2f model_loader; refactor copySampleFields function
82d39914 Apply path change
3f27ec73 functional tests; refactor tooltip container close
db18d827 model_loader; fix jshint quality
ae3236b8 model_loader; fix error if analysis.order field is undefined
84386a8b model_loader; update test on order/stock_order at analysis loading
1e6681ac doc/vidjil-format; remove useless field
959fdaa0 model_loader; remove dead code
1140d331 model_loader; fix error if an loaded analysis haven't id field
3af09d41 model_test.js; remove a test on a deleted function
667ef5b1 model_loader; refactor function that allow to keep consistant order even with added/deleted sampels
0aee6311 model_test.js; update a test on analysis order field
ec9c2ee3 model_loader; add a fix for first analisys file that not include order field
fbc74bfe tools.js; add a function to clean an array of duplicates
de17b2ae Add a condition to use calculateOrder function
86e98e42 qunit, add test for tools script and removeDuplicate function
1dd096b3 tools; add a function to remove position from array and decrease upper values
c988b9e1 model_loader; refactor copySampleFields function
7cb951c9 Apply path change
c4e2c08e functional tests; refactor tooltip container close
bcdefeda model_loader; fix jshint quality
fc7f86b0 model_loader; fix error if analysis.order field is undefined
8601a782 model_loader; update test on order/stock_order at analysis loading
2006114d doc/vidjil-format; remove useless field
96761b0b model_loader; remove dead code
a3b077a5 model_loader; fix error if an loaded analysis haven't id field
3ae87eb0 model_test.js; remove a test on a deleted function
1791cd51 model_loader; refactor function that allow to keep consistant order even with added/deleted sampels
22d27789 model_test.js; update a test on analysis order field
a4a4bc8c model_loader; add a fix for first analisys file that not include order field
8897426d Merge branch 'feature-c/4541-boucle-infinie-samples-caches' of...
74925998 test_scatterplot; add a log on failure test
bed6f130 test_scatterplot; adda wait-until on a test
147f4c89 Apply 1 suggestion(s) to 1 file(s)
parent ae5d0775
Pipeline #214116 passed with stages
in 15 seconds
......@@ -68,7 +68,7 @@ Builder.prototype = {
this.build_clusterSelector()
this.initTag();
if (this.m.samples.order.length == 1)
if (this.m.samples.stock_order.length == 1)
// One sample, two scatterplots
setTimeout(function() {
switch_visu2('scatterplot');
......
......@@ -425,32 +425,6 @@ Model_loader.prototype = {
return fields;
},
/**
* recalculating the array is sometimes necessary if the analysis and fused_file have diverged.
* @param {Array} arr [description]
* @return {Array} [description]
*/
calculateOrder: function(arr) {
tmp = arr.slice();
res = arr.slice();
previous = -1;
while(tmp.length > 0) {
min = tmp[0];
min_idx = 0;
for(var i = 0; i < tmp.length; i++) {
if (tmp[i] < min) {
min = tmp[i];
min_idx = i;
}
}
idx = arr.indexOf(min);
tmp.splice(min_idx, 1);
res[idx] = ++previous;
}
return res;
},
buildDict: function(first, second) {
dict = {};
for (var i = 0; i < first.length; i++){
......@@ -475,6 +449,7 @@ Model_loader.prototype = {
copySampleFields: function(samples, analysis) {
var clone = $.extend({}, samples);
if ('id' in analysis) {
//replace names, timestamps, order...
dict = this.buildDict(analysis.id, clone.original_names);
......@@ -489,47 +464,104 @@ Model_loader.prototype = {
clone[key][idx] = dict[id][key];
}
}
if (!("order" in analysis)){
// Possible case for first analysis. In this case, don't hide previous samples
analysis.order = []
for (var j = 0; j < analysis.id.length; j++) {
analysis.order.push( j )
}
}
} else {
analysis.id = []
analysis.order = []
analysis.stock_order = []
}
// Fix case of error where same timepoint is present multiple time in order
if (clone.order != undefined){
clone.order = removeDuplicate(clone.order)
}
if (analysis.order != undefined){
analysis.order = analysis.order.filter(function(item, pos) {
return analysis.order.indexOf(item) == pos;
})
analysis.order = removeDuplicate(analysis.order)
}
if (analysis.stock_order != undefined){
analysis.stock_order = analysis.stock_order.filter(function(item, pos) {
return analysis.stock_order.indexOf(item) == pos;
})
}
if ('order' in analysis && 'stock_order' in analysis) {
// Jquery Extend don't work on samples.order.
clone.order = analysis.order
clone.stock_order = analysis.stock_order
// Check if new sample have been added
if (clone.stock_order.length < this.samples.number){
for (var j = clone.stock_order.length; j < this.samples.number; j++) {
clone.order.push(j)
clone.stock_order.push(j)
}
analysis.stock_order = removeDuplicate(analysis.stock_order)
} else {
// Create new values of stock_order for old analysis files
if (analysis.order != undefined) {
analysis.stock_order = JSON.parse(JSON.stringify(analysis.order));
} else {
analysis.order = []
analysis.stock_order = []
}
// stock_order should not be different than number of samples present in vidjil/analysis (issue #4408).
// Order should not be bigger than number of samples present in vidjil/analysis (but can have less)
// TODO: be able to reset order in case of config 1 have same number of sample than config 2 (particular case of #4407)
if (typeof this.samples != 'undefined' && (clone.stock_order.length != this.samples.number || clone.order.length > this.samples.number)){
clone.order = Array.from(Array(this.samples.number).keys())
clone.stock_order = Array.from(Array(this.samples.number).keys())
for (var i = 0; i < analysis.id.length; i++) {
if (analysis.order.indexOf(i) == -1){
analysis.stock_order.push(i)
}
}
} else if ('order' in analysis && !('stock_order' in analysis)) {
// Keep this behavior to ope old samples/analysis
clone.order = this.calculateOrder(clone.order);
}
this.delRemovedSample(analysis, samples)
clone.order = analysis.order
clone.stock_order = analysis.stock_order
return clone;
},
/**
* Make housekeeping of order_stock_order field of analysis
* Allow to remove deleted samples and add new one and keep a consistant order
* @param {string} analysis - json_text / content of .analysis file
* @param {string} samples - json_text / content of .vidjil file
* */
delRemovedSample: function (analysis, samples) {
var self = this
var current_names = samples.original_names
var analysis_names = analysis.id
var order = analysis.order
var stock = analysis.stock_order
// Convert value into filename and delete delted samples from arrays
// ... for order field
for (var i = 0; i < order.length; i++) {
order[i] = analysis_names[order[i]]
}
for (var k = order.length - 1; k >= 0; k--) {
if (current_names.indexOf(order[k]) == -1){
order.splice(k, 1)
}
}
// ... for stock_order field
for (var j = 0; j < stock.length; j++) {
stock[j] = analysis_names[stock[j]]
}
for (var l = stock.length - 1; l >= 0; l--) {
if (current_names.indexOf(stock[l]) == -1){
stock.splice(l, 1)
}
}
// Add new samples
for (var m = 0; m < current_names.length; m++) {
if (stock.indexOf(current_names[m]) == -1){
order.push(current_names[m])
stock.push(current_names[m])
}
}
// retro convert filename into position in the loaded analysis
for (var p = 0; p < order.length; p++) {
order[p] = current_names.indexOf(order[p])
}
for (var q = 0; q < stock.length; q++) {
stock[q] = current_names.indexOf(stock[q])
}
},
/**
* parse a json or a json_text and complete the model with it's content
* @param {string} analysis - json_text / content of .analysis file
......
......@@ -791,3 +791,28 @@ function getProxy() {
});
throw "No proxy";
}
/**
* @return an array without duplication
*/
function removeDuplicate(array) {
clean_array = array.filter(function(item, pos) {
return array.indexOf(item) == pos;
})
return clean_array
}
/**
* Filter value given of an array and decrease greater values
*/
function removeEltAndDecrease(array, value) {
for (var i = 0; i < array.length; i++) {
if (array[i] > value) {
array[i] = array[i] - 1
} else if (array[i] == value) {
array.splice(i, 1)
i = i-1
}
}
return array
}
......@@ -50,3 +50,17 @@ QUnit.test("loadCluster", function(assert) {
assert.deepEqual(m.clusters[2], [], "another top order; Correct cluster for clone 2" )
});
QUnit.test("copySampleFields", function(assert) {
model_loader = new Model_loader()
var samples = {"original_names": ["f0", "f1", "f3", "f4", "f5", "f7"], "order": [0,1,2,3,4,5] , "stock_order": [0,1,2,3,4,5] }
var analysis = {"id": ["f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7"], "order": [0,2,6,4], "stock_order": [0,1,2,3,7,6,5,4] }
var loaded = model_loader.copySampleFields(samples, analysis)
console.log(loaded)
assert.deepEqual(loaded.original_names, ["f0", "f1", "f3", "f4", "f5", "f7"], "original_names" )
assert.deepEqual(loaded.order, [0,3], "order" )
assert.deepEqual(loaded.stock_order, [0,1,2,5,4,3], "stock_order" )
});
\ No newline at end of file
......@@ -65,29 +65,34 @@ QUnit.test("load", function(assert) {
QUnit.test("load with new order && stock_order", function(assert) {
var m = new Model();
m.parseJsonData(json_data, 100)
m.parseJsonData(json_data, 100) //[ "Diag.fa", "Fu-1.fa", "Fu-2.fa", "Fu-3.fa" ]
m.initClones()
m.parseJsonAnalysis(analysis_data_stock_order)
m.parseJsonAnalysis(JSON.parse(JSON.stringify(analysis_data_stock_order))) // [ "Diag.fa", "Fu-0.fa", "Fu-1.fa", "Fu-2.fa" ]
m.initClones()
// fu-3 is replaced with fu-0
// "order": [ 3, 0, 1 ],
// "stock_order": [2, 3, 0, 1 ]
// become ==> "order": [ 2, 0, 3 ] and "stock_order": [1, 2, 0, 3 ]
assert.deepEqual(m.samples.order, [3,0,1], "Correct order after loading" )
assert.deepEqual(m.samples.stock_order, [2,3,0,1], "Correct stock_order after loading" )
assert.equal(m.t, 3, "Correct time selected after analysis loading")
assert.deepEqual(m.samples.order, [ 2, 0, 3], "Correct order after loading" )
assert.deepEqual(m.samples.stock_order, [1, 2, 0, 3], "Correct stock_order after loading" )
assert.equal(m.t, 2, "Correct time selected after analysis loading")
// Note, respective clone 0 size: 0.05, 0.1, 0.075, 0.15
assert.equal( m.clones[0].getSize(), m.clones[0].getSize(3), "clone 0 hve size corresponding to timepoint 3 (loading order)")
assert.equal( m.clones[0].getSize(), m.clones[0].getSize(2), "clone 0 hve size corresponding to timepoint 2 (loading order)")
// Test loading file with duplicate sample present in order field of analysis
var m = new Model();
m.parseJsonData(json_data, 100)
m.initClones()
// Copy and modify
analysis_data_stock_order_with_error = JSON.parse(JSON.stringify(analysis_data_stock_order))
analysis_data_stock_order_with_error.samples.order = [3, 3, 0, 1]
analysis_data_stock_order_with_error.samples.order = [3, 3, 0, 1] // become [2, 0]
m.parseJsonAnalysis(analysis_data_stock_order_with_error)
m.initClones()
assert.deepEqual(m.samples.order, [3,0,1], "Correct order after loading analysis with dusplicate sample in order" )
assert.deepEqual(m.samples.stock_order, [2,3,0,1], "Correct stock_order after loading analysis with dusplicate sample in order" )
assert.deepEqual(m.samples.order, [2, 0, 3], "Correct order after loading analysis with dusplicate sample in order" )
assert.deepEqual(m.samples.stock_order, [1, 2, 0, 3], "Correct stock_order after loading analysis with dusplicate sample in order" )
});
......@@ -340,9 +345,6 @@ QUnit.test("model: analysis sample data application", function(assert) {
assert.equal(bool, true, "sample fields filtered");
assert.equal(ff.length, 2, "remaining sample fields");
var order = m.calculateOrder([0, 1, 5, 2, 3]);
assert.deepEqual(order, [0, 1, 4, 2, 3], "reorder array of order values");
var dict = m.buildDict(["1", "3", "4", "6"], ["1", "3", "4", "5"]);
assert.deepEqual(dict, {"1":{}, "3":{}, "4":{}, "5":{}, "6":{}}, "build a dict of all present ids");
......@@ -351,10 +353,12 @@ QUnit.test("model: analysis sample data application", function(assert) {
var field = m.copyField(dest, src, "val");
assert.deepEqual(field, {"1": {"val": "f"}, "2": {"val": "o"}}, "copy the contents of analysis sample fields");
// Here sample "3" is deleted as it is not present, and sample "4" is added.
// It take position of 3
dest = {"original_names": ["1", "4", "2"], "val": ["a", "b", "c"], "lav": ["c", "b", "a"]};
src = {"id": ["1", "2", "3"], "val": ["f", "o", "o"]};
var res = m.copySampleFields(dest, src);
var expected = {"original_names": ["1", "4", "2"], "val": ["f", "b", "o"], "lav": ["c", "b", "a"]};
var expected = {"original_names": ["1", "4", "2"], "val": ["f", "b", "o"], "lav": ["c", "b", "a"],"order": [0, 2, 1],"stock_order": [0, 2, 1]};
assert.deepEqual(res, expected, "copy all relevant fields from analysis to samples");
m.parseJsonData(json_data, 100);
......@@ -363,7 +367,7 @@ QUnit.test("model: analysis sample data application", function(assert) {
assert.notEqual(m.samples.names[1], "fu0", "missing sample successfully ignored");
assert.equal(m.samples.names[1], "fu1", "correctly shifted samples");
assert.deepEqual(m.samples.order, [0,3,1,2], "order converted");
assert.deepEqual(m.samples.order, [0,1,2,3], "order converted");
});
......
......@@ -424,3 +424,21 @@ QUnit.test("Get n first sequences", function(assert) {
assert.equal(getNFirstSequences(seqs, -1), seqs);
assert.equal(getNFirstSequences(seqs, 2), ">seq1\nAT\n>seq2\nTC\n");
});
QUnit.test("remove duplicates", function(assert) {
var array = [1,2,3,4]
assert.deepEqual(removeDuplicate(array), [1,2,3,4], "correct array after removeDuplicate (1)")
var array = [4,3,2,1]
assert.deepEqual(removeDuplicate(array), [4,3,2,1], "correct array after removeDuplicate (2)")
var array = [0,1,2,3,6,7]
assert.deepEqual(removeDuplicate(array), [0,1,2,3,6,7], "correct array after removeDuplicate (3)")
var array = [0,1,2,3,3,3,4,0]
assert.deepEqual(removeDuplicate(array), [0,1,2,3,4], "correct array after removeDuplicate (4)")
});
QUnit.test("remove elt in decrease", function(assert) {
var listel = [0,1,2,4,5,7,8]
assert.deepEqual(removeEltAndDecrease(listel, 3), [0,1,2,3,4,6,7], "correct array after removeEltAndDecrease (3)")
});
{"clones":[{"germline":"TRD+","id":"cid_1","name":"c_name_1","reads":[18290,421157,0],"sequence":0,"top":1},{"germline":"IGK+","id":"cid_2","name":"c_name_2","reads":[111765,0,0],"sequence":0,"top":1},{"germline":"IGH","id":"cid_3","name":"c_name_3","reads":[2113,21638,258546],"sequence":0,"top":1},{"germline":"IGH","id":"cid_4","name":"c_name_4","reads":[60,296,3528],"sequence":0,"top":2},{"germline":"IGH+","id":"cid_5","name":"c_name_5","reads":[782,12753,48504],"sequence":0,"top":2},{"germline":"TRD+","id":"cid_6","name":"c_name_6","reads":[2720,36889,0],"sequence":0,"top":2}],"clusters":[0,0,0,0],"config_name":"multi+inc+xxx","dataFileName":"XXX (multi+inc+xxx)","germlines":{},"group_id":1,"info":"Patient de XXX","logs":[],"patient_id":1,"producer":"vidjil fuse","reads":{"germline":{"IGH":[6085,185456,532086],"IGH+":[62,2709,2640],"IGK":[1,0,0],"IGK+":[150436,3,0],"IGL":[0,0,0],"TRA":[0,1,0],"TRA+D":[1648,14218,0],"TRB":[0,0,0],"TRB+":[0,0,0],"TRD":[51,68,0],"TRD+":[23378,535563,0],"TRG":[112204,26,0],"unexpected":[189,6,345]},"segmented":[294054,738050,535071],"total":[316307,818553,625708]},"sample_name":"KXXX","sample_set_id":1,"samples":{"commandline":["cmdline 0","cmdline 1","cmdline 2"],"config_id":["25","25","25"],"db_key":["","",""],"id":[101,102,103],"info":["file0_info","file1_info","file2_info"],"log":["log 0","log 1","log 2"],"names":["file0_name","file1_name","file2_name"],"number":3,"original_names":["file0.fastq","file1.fastq","file2.fastq"],"patient_id":[100,100,100],"producer":["2017.03","2017.03","2017.09"],"results_file_id":[29410,29204,29699],"run_id":[101,102,103],"run_timestamp":["2017-05-29 11:47:47","2017-07-17 10:48:38","2017-10-09 13:03:33"],"sample_name":[101,102,103],"sequence_file_id":[101,102,103],"timestamp":["2015-10-19","2015-10-19","None"]},"similarity":[],"timestamp":"2017-10-09 13:12:40","vidjil_json_version":"2016b"}
\ No newline at end of file
{"clones":[],"clusters":[],"custom":[],"samples":{"id":["file0.fastq","file1.fastq","file2.fastq"],"info":["file0_info","file1_info","file2_info"],"names":["file0_name","file1_name","file2_name"],"order":[0,2],"stock_order":[1,0,2]},"tags":{"hide":[],"names":{"0":"clone 1","1":"clone 2","2":"clone 3","3":"standard","4":"standard (noise)","5":"custom 1","6":"custom 2","7":"custom 3","8":"-/-"}},"vidjil_json_version":"2014.09"}
\ No newline at end of file
{"clones":[],"clusters":[],"custom":[],"samples":{"id":["file0.fastq","file1.fastq","file2.fastq"],"info":["file0_info","file1_info","file2_info"],"names":["file0_name","file1_name","file2_name"],"order":[0,2]},"tags":{"hide":[],"names":{"0":"clone 1","1":"clone 2","2":"clone 3","3":"standard","4":"standard (noise)","5":"custom 1","6":"custom 2","7":"custom 3","8":"-/-"}},"vidjil_json_version":"2014.09"}
\ No newline at end of file
{"clones":[{"germline":"TRD+","id":"cid_1","name":"c_name_1","reads":[18290,421157,421157,0],"sequence":0,"top":1},{"germline":"IGK+","id":"cid_2","name":"c_name_2","reads":[111765,0,0,0],"sequence":0,"top":1},{"germline":"IGH","id":"cid_3","name":"c_name_3","reads":[2113,21638,21638,258546],"sequence":0,"top":1}],"clusters":[0,0,0,0],"config_name":"multi+inc+xxx","dataFileName":"XXX (multi+inc+xxx)","germlines":{},"group_id":1,"info":"Patient de XXX","logs":[],"patient_id":1,"producer":"vidjil fuse","reads":{"germline":{"IGH":[6085,185456,185456,532086],"IGH+":[62,2709,2709,2640],"IGK":[1,0,0,0],"IGK+":[150436,3,3,0],"IGL":[0,0,0,0],"TRA":[0,1,1,0],"TRA+D":[1648,14218,14218,0],"TRB":[0,0,0,0],"TRB+":[0,0,0,0],"TRD":[51,68,68,0],"TRD+":[23378,535563,535563,0],"TRG":[112204,26,26,0],"unexpected":[189,6,6,345]},"segmented":[294054,738050,738050,535071],"total":[316307,818553,818553,625708]},"sample_name":"KXXX","sample_set_id":1,"samples":{"commandline":["cmdline 0","cmdline 1","cmdline 2","cmdline 3"],"config_id":["25","25","25","25"],"db_key":["","","",""],"id":[101,102,103,104],"info":["file0_info","file1_info","file2_info","file3_info"],"log":["log 0","log 1","log 2","log 3"],"names":["file0_name","file1_name","file2_name","file3_name"],"number":4,"original_names":["file0.fastq","file1.fastq","file2.fastq","file3.fastq"],"patient_id":[100,100,100,100],"producer":["2017.03","2017.03","2017.03","2017.09"],"results_file_id":[210,211,212,213],"run_id":[101,102,103,104],"run_timestamp":["2017-05-29 11:47:47","2017-07-17 10:48:38","2017-07-17 10:48:38","2017-10-09 13:03:33"],"sample_name":[101,102,103,104],"sequence_file_id":[101,102,103,104],"timestamp":["2015-10-19","2015-10-19","2015-10-19","2015-10-19"]},"similarity":[],"timestamp":"2017-10-09 13:12:40","vidjil_json_version":"2016b"}
\ No newline at end of file
{"clones":[{"germline":"TRD+","id":"cid_1","name":"c_name_1","reads":[18290,421157],"sequence":0,"top":1},{"germline":"IGK+","id":"cid_2","name":"c_name_2","reads":[111765,0],"sequence":0,"top":1},{"germline":"IGH","id":"cid_3","name":"c_name_3","reads":[2113,21638],"sequence":0,"top":1},{"germline":"IGH","id":"cid_4","name":"c_name_4","reads":[60,296],"sequence":0,"top":2},{"germline":"IGH+","id":"cid_5","name":"c_name_5","reads":[782,12753],"sequence":0,"top":2},{"germline":"TRD+","id":"cid_6","name":"c_name_6","reads":[2720,36889],"sequence":0,"top":2}],"clusters":[0,0,0,0],"config_name":"multi+inc+xxx","dataFileName":"XXX (multi+inc+xxx)","germlines":{},"group_id":1,"info":"Patient de XXX","logs":[],"patient_id":1,"producer":"vidjil fuse","reads":{"germline":{"IGH":[6085,185456],"IGH+":[62,2709],"IGK":[1,0],"IGK+":[150436,3],"IGL":[0,0],"TRA":[0,1],"TRA+D":[1648,14218],"TRB":[0,0],"TRB+":[0,0],"TRD":[51,68],"TRD+":[23378,535563],"TRG":[112204,26],"unexpected":[189,6]},"segmented":[294054,738050],"total":[316307,818553]},"sample_name":"XXX","sample_set_id":1,"samples":{"commandline":["cmdline 0","cmdline 1"],"config_id":["25","25"],"db_key":["",""],"id":[101,102],"info":["file0_info","file1_info"],"log":["log 0","log 1"],"names":["file0_name","file1_name"],"number":2,"original_names":["file0.fastq","file1.fastq"],"patient_id":[100,100],"producer":["2017.03","2017.03"],"results_file_id":[29410,29204],"run_id":[101,102],"run_timestamp":["2017-05-29 11:47:47","2017-07-17 10:48:38"],"sample_name":[101,102],"sequence_file_id":[101,102],"timestamp":["2015-10-19","2015-10-19"]},"similarity":[],"timestamp":"2017-10-09 13:12:40","vidjil_json_version":"2016b"}
\ No newline at end of file
{"clones":[],"clusters":[],"custom":[],"samples":{"id":["file0b.fastq","file1b.fastq","file2b.fastq"],"info":["file0b_info","file1b_info","file2b_info"],"names":["file0b_name","file1b_name","file2b_name"],"order":[0,2]},"tags":{"hide":[],"names":{"0":"clone 1","1":"clone 2","2":"clone 3","3":"standard","4":"standard (noise)","5":"custom 1","6":"custom 2","7":"custom 3","8":"-/-"}},"vidjil_json_version":"2014.09"}
\ No newline at end of file
{"clones":[],"clusters":[],"custom":[],"samples":{"id":["file0.fastq","file1.fastq","file2.fastq"],"info":["file0_info","file1_info","file2_info"],"names":["file0_name","file1_name","file2_name"],"order":[0,2,2],"stock_order":[1,0,2]},"tags":{"hide":[],"names":{"0":"clone 1","1":"clone 2","2":"clone 3","3":"standard","4":"standard (noise)","5":"custom 1","6":"custom 2","7":"custom 3","8":"-/-"}},"vidjil_json_version":"2014.09"}
\ No newline at end of file
{
"clones": [],
"producer": "browser",
"samples": {
"id": [
"file_deleted_1",
"file_fu_1",
"file_fu_2",
"file_deleted_2",
"file_rechute"
],
"names": [
"impossible",
"Fu-1",
"Fu-2",
"impossible 2",
"Rechute"
],
"order": [
4, 1, 0
],
"stock_order": [
4, 1, 2, 0, 3
]
},
"timestamp": "2020-12-2 20:27:27",
"vidjil_json_version": "2014.09"
}
\ No newline at end of file
{
"germlines": {},
"producer": "vidjil fuse",
"similarity": [],
"timestamp": "2019-11-07 10:36:42",
"vidjil_json_version": "2016b",
"reads": {
"segmented": [
1967259, 1892061, 1950799, 1612765, 1819609
],
"total": [
2390273, 2451185, 2419756, 2037793, 2251642
],
"germline": {
}
},
"samples": {
"log": [
"log_0", "log_1", "log_2", "log_3", "log_4"
],
"producer": [
"algo", "algo", "algo", "algo", "algo"
],
"timestamp": [
"2019-11-06", "2019-11-06", "2019-11-06", "2019-11-06", "2019-11-06"
],
"commandline": [
"cmd line 0", "cmd line 1", "cmd line 2", "cmd line 3", "cmd line 4"
],
"number": 5,
"original_names": [
"file_diag_1",
"file_fu_1",
"file_fu_2",
"file_fu_3",
"file_rechute"
],
"run_timestamp": [
"2019-11-06", "2019-11-06", "2019-11-06", "2019-11-06", "2019-11-06"
]
},
"clones": [
],
"clusters": [
0,
0,
0
]
}
\ No newline at end of file
......@@ -26,7 +26,7 @@ class BrowserTest < MiniTest::Test
end
end
def set_browser(vidjil_file, analysis_file=nil, local_storage=nil)
def set_browser(vidjil_file, analysis_file=nil, local_storage=nil, close_tooltip=true)
folder_path = File.expand_path(File.dirname(__FILE__))
folder_path.sub! '/browser/test/functional', ''
index_path = 'file://' + folder_path + '/browser/index.html'
......@@ -105,6 +105,11 @@ class BrowserTest < MiniTest::Test
$b.div(:id => 'file_menu').button(:text => 'start').click
# close tooltip
if close_tooltip and $b.div(id: 'tip-container').present?
$b.div(:id => 'tip-container').div(:class => 'tip_1').element(:class => 'icon-cancel').click
end
end
def close_everything
......
......@@ -9,9 +9,6 @@ class TestGraph < BrowserTest
super
if not defined? $b
set_browser("/tools/tests/data/fused_multiple.vidjil")
if $b.div(id: 'tip-container').present?
$b.div(:id => 'tip-container').div(:class => 'tip_1').element(:class => 'icon-cancel').click
end
# Make upload menu appear to test the application with this menu too
$b.execute_script("$('#upload_summary')[0].style.display='block';")
......
......@@ -9,9 +9,6 @@ class TestGraph < BrowserTest
super
if not defined? $b
set_browser("")
if $b.div(id: 'tip-container').present?
$b.div(:id => 'tip-container').div(:class => 'tip_1').element(:class => 'icon-cancel').click
end
end
end
......
......@@ -9,9 +9,6 @@ class TestGraph < BrowserTest
super
if not defined? $b
set_browser("/browser/test/data/issues/4422.vidjil")
if $b.div(id: 'tip-container').present?
$b.div(:id => 'tip-container').div(:class => 'tip_1').element(:class => 'icon-cancel').click
end
end
end
......
......@@ -9,10 +9,6 @@ class TestGraph < BrowserTest
super
if not defined? $b
set_browser("/browser/test/data/issues/4472.vidjil")
if $b.div(id: 'tip-container').present?
$b.div(:id => 'tip-container').div(:class => 'tip_1').element(:class => 'icon-cancel').click
end
end
end
......
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