Commit 4123a20b authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

Merge branch 'feature-c/4034-genescan-cluster' into 'dev'

Resolve "Genescan gris et clones clusterisés"

Closes #4303 and #4034

See merge request !692
parents f73e2878 0d4fc90d
Pipeline #150695 passed with stages
in 9 minutes and 39 seconds
......@@ -478,6 +478,15 @@ changeAlleleNotation: function(alleleNotation) {
var new_cluster = [];
var tmp = [];
var lpos = []
for (var seq=0; seq<clusters[i].length;seq++){
if (typeof this.mapID[clusters[i][seq]] != 'undefined'){
lpos.push(this.mapID[clusters[i][seq]])
}
}
// order may be unconserved...
var biggest_clone = Math.min.apply(null, lpos)
for (var j=0; j<clusters[i].length;j++){
if (typeof this.mapID[clusters[i][j]] != 'undefined'){
var cloneID = this.mapID[clusters[i][j]]
......@@ -485,10 +494,9 @@ changeAlleleNotation: function(alleleNotation) {
this.clusters[cloneID] = [];
// Set the mergeId value for cluterized clones
var clone = this.clones[cloneID]
if (j != 0){
clone.mergedId = this.mapID[clusters[i][0]]
if (clone.index != biggest_clone){
clone.mergedId = biggest_clone
}
}else{
tmp.push(clusters[i][j])
}
......
......@@ -103,6 +103,33 @@ class TestCluster < BrowserTest
end
def test_06_cluster_not_ordered
# cluster of clone in an inverted order (considering size)
# clone 1 (biggest) should be before the second; even if clone 2 is before in cluster from analysis file
assert ($b.div(:id => 'cluster5').exists? ), '>> cluster5 exist'
assert (not $b.clone_cluster('5').present?), '>> cluster5 is not display'
assert ( $b.clone_in_list('5').present? ), ">> clone 5 is present"
assert ( not $b.clone_in_list('6').present? ), ">> clone 6 is not present as it is clutered into clone 5"
$b.clone_in_list('5').click
assert ( not $b.clone_in_segmenter('6').present? ), ">> The second clone of the cluster is NOT present in segmenter"
$b.a(:id => 'list_split_all').click
$b.update_icon.wait_while(&:present?)
assert ( $b.clone_in_segmenter('5').present? ), ">> The first clone of the cluster is present in segmenter"
assert ( $b.clone_in_segmenter('6').present? ), ">> The second clone of the cluster is present in segmenter"
# Add test on order of clones in list
cluster = $b.clone_cluster('5')
assert ( cluster.div(index: 0).id == "_6" ), ">> first clone in cluster is the 6th"
assert ( cluster.div(index: 1).id == "_5" ), ">> second clone in cluster is the 5th"
end
# Not really a test
def test_zz_close
......
......@@ -73,11 +73,11 @@ class TestList < BrowserTest
$b.update_icon.wait_while(&:present?)
# Clone order should have changed (sort 'size')
l0 = $listClone.div(index: 0)
assert ( l0.id == "listElem_5" ), "opening; correct id of the first element (clone other)"
assert ( l0.id == "listElem_7" ), "opening; correct id of the first element (clone other)"
$lock.click # remove lock
l0 = $listClone.div(index: 0)
assert ( l0.id == "listElem_5" ), "opening; correct id of the first element (clone other)"
assert ( l0.id == "listElem_7" ), "opening; correct id of the first element (clone other)"
$b.div(:id => "left-container").click # get out of the select list
end
......
......@@ -168,6 +168,26 @@ do a correct gathering.
"reads": [ 1021, 0 ],
"germline": "TRG",
"top": 5
},
{
"id": "clone_cluster1",
"name": "clone_cluster1",
"sequence": "GATACAaaaaaccccc",
"reads": [ 1021, 0 ],
"germline": "TRG",
"top": 6
},
{
"id": "clone_cluster2",
"name": "clone_cluster2",
"sequence": "AAAAATTTTTAAAAATTTTTAAAAATTTTT",
"reads": [ 521, 42 ],
"germline": "TRG",
"top": 7,
"seg":
{
"cdr3": {"start": 10, "stop": 20}
}
}
]
}
......@@ -233,7 +253,8 @@ some clones, and added external data (`data`).
],
"clusters": [
[ "clone2", "clone3"],
[ "clone3", "clone2"],
[ "clone_cluster2", "clone_cluster1"],
[ "clone-5", "clone-10", "clone-179" ]
],
......
......@@ -12,7 +12,7 @@ $ IGH and TRG germlines
# !! If doc change, number should sometimes be updated
$ Default top threshold is set to 50, so each clone should be present
5:"sequence"
7:"sequence"
!LAUNCH: python ../../fuse.py --top 3 ../../../doc/analysis-example2.vidjil ; cat fused.vidjil
$ Change top to 3 (for 4 clones present)
......
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