Commit f8595f77 authored by Marc Duez's avatar Marc Duez

merge

parent c0f8293c
......@@ -733,7 +733,7 @@ span .substitution{
}
.axis_select select {
background: #073642;
background: @background;
color: @default;
border: 0;
height: 16px;
......
......@@ -106,7 +106,7 @@
<div class="menu" onmouseover="showSelector('loadSelector');"> file
<div id="loadSelector" class="selector">
<!-- <a class="buttonSelector" onclick="javascript:loadData()">load data/analysis</a> -->
<a class="buttonSelector" onclick="javascript:loadAnalysis()">load analysis</a>
<!--<a class="buttonSelector" onclick="javascript:loadAnalysis()">load analysis</a> -->
<a class="buttonSelector" onclick="javascript:m.saveAnalysis()">save analysis</a>
<!--<a class="buttonSelector" onclick="javascript:m.resetAnalysis()">reset analysis</a> -->
<!--<a class="buttonSelector" onclick="javascript:reset()">reset all</a> -->
......@@ -299,7 +299,6 @@
</body>
<script type="text/javascript" src="js/main.js"> </script>
</html>
......@@ -431,7 +431,6 @@ Graph.prototype = {
*
* */
stopDrag : function(time_point){
if (this.drag_on){
this.drag_on=false;
......
......@@ -180,6 +180,13 @@ Model.prototype = {
self.n2_max=n2_max;
self.normalization_factor = data.normalization_factor;
self.reads_segmented = data.reads_segmented;
self.reads_segmented_total = self.reads_segmented.reduce(function(a, b) { return a + b; });
self.reads_total = data.reads_total;
if (self.reads_total){
self.reads_total_total = self.reads_total.reduce(function(a, b) { return a + b; });
}else{
self.reads_total_total=self.reads_segmented_total;
}
self.timestamp = data.timestamp;
self.time = data.point;
self.scale_color = d3.scale.log()
......@@ -1336,7 +1343,9 @@ window.onresize = initCoef;
+"<br />Marc Duez, Mathieu Giraud and Mikaël Salson"
+" &ndash; <a href='http://bioinfo.lifl.fr/vidjil'>http://bioinfo.lifl.fr/vidjil</a>"
+"</br>"
+"</br>Vidjil is developed by the <a href='http://www.lifl.fr/bonsai'>Bonsai bioinformatics team</a> (LIFL, CNRS, U. Lille 1, Inria Lille), in collaboration with the <a href='http://biologiepathologie.chru-lille.fr/organisation-fbp/91210.html'>department of Hematology</a> of CHRU Lille and the <a href='http://www.ircl.org/plate-forme-genomique.html'>Functional and Structural Genomic Platform</a> (U. Lille 2, IFR-114, IRCL)."
+"</br>Vidjil is developed by the <a href='http://www.lifl.fr/bonsai'>Bonsai bioinformatics team</a> (LIFL, CNRS, U. Lille 1, Inria Lille), in collaboration with the <a href='http://biologiepathologie.chru-lille.fr/organisation-fbp/91210.html'>department of Hematology</a> of CHRU Lille"
+ " the <a href='http://www.ircl.org/plate-forme-genomique.html'>Functional and Structural Genomic Platform</a> (U. Lille 2, IFR-114, IRCL)"
+ " and the <a href='http://www.euroclonality.org/'>EuroClonality-NGS</a> working group."
+"</br>"
+"</br>This is a beta version, please use it only for test purposes."
/*
......
......@@ -104,17 +104,30 @@
var elem = document.getElementById("visu2_svg").cloneNode(true);
var opt={};
var doc = new jsPDF();
// The clones should have their natural (tag) color, even if two have the same color...
for (var i = 0; i<m.n_windows; i++){
var polyline = elem.getElementById("polyline"+i)
polyline.setAttribute("style","stroke-width:1px; stroke: #dddddd");
polyline.setAttribute("stroke","#dddddd");
polyline.setAttribute("style","stroke-width:1px; stroke:"+ tagColor[m.windows[i].tag]);
polyline.setAttribute("stroke", tagColor[m.windows[i].tag]);
// polyline.setAttribute("style","stroke-width:1px; stroke: #dddddd");
// polyline.setAttribute("stroke","#dddddd");
// Hide 'other' line (TODO: really remove this line !)
if (m.windows[i].window == "other")
{
polyline.setAttribute("style","stroke-width:0px; stroke: #ffffff");
polyline.setAttribute("stroke", "#ffffff");
}
}
for (var i = 0; i<list.length; i++){
var polyline = elem.getElementById("polyline"+list[i])
polyline.setAttribute("style","stroke-width:6px; stroke:"+tagColor[i]);
polyline.setAttribute("stroke",tagColor[i]);
polyline.setAttribute("style","stroke-width:6px; stroke:"+tagColor[m.windows[i].tag]);
polyline.setAttribute("stroke", tagColor[m.windows[i].tag]);
elem.getElementById("polyline_container").appendChild(polyline);
}
......@@ -140,15 +153,16 @@
opt.y_offset=60;
doc.setFontSize(12);
doc.text(130, 20, 'Vidjil (beta) - http://bioinfo.lifl.fr/vidjil');
doc.text(130, 20, 'Vidjil -- http://bioinfo.lifl.fr/vidjil');
doc.rect(15, 15, 60, 23);
doc.text(20, 20, document.getElementById("upload_json").files[0].name);
doc.text(20, 25, 'run: 2013-10-03');
doc.text(20, 30, 'analysis: '+m.timestamp.split(' ')[0]);
doc.text(20, 25, 'run: 2014-xx-xx');
doc.text(20, 30, 'analysis: '+m.timestamp[0].split(' ')[0]);
doc.text(20, 35, 'germline: '+m.system);
doc.text(20, 45, 'reads: ' + m.total_size);
doc.text(20, 45, 'reads: ' + m.reads_segmented_total + ' / ' + m.reads_total_total
+ ' (' + (100 * m.reads_segmented_total / m.reads_total_total).toFixed(3) + '%)');
doc.text(20, 55, 'This PDF export is in beta version...');
doc.text(130, 25, '**beta** PDF export');
svgElementToPdf(elem, doc, opt)
doc.setFillColor(255, 255, 255);
......@@ -162,7 +176,7 @@
var polyline = document.getElementById("polyline"+id).cloneNode(true);
polyline.setAttribute("style","stroke-width:40px");
polyline.setAttribute("stroke",tagColor[i]);
polyline.setAttribute("stroke",tagColor[m.windows[i].tag]);
var res =elem.getElementById("resolution1").cloneNode(true);
res.firstChild.setAttribute("fill","white");
var icon=document.createElement("svg");
......@@ -178,7 +192,7 @@
doc.setDrawColor(150,150,150);
doc.rect(10, y-2, 18, 8);
/*
polyline.setAttribute("stroke",tagColor[i]);
polyline.setAttribute("stroke",tagColor[m.windows[i].tag]);
polyline.setAttribute("style","stroke-width:6px");
opt_icon.scaleX=180/document.getElementById("visu2_svg").getAttribute("width");
opt_icon.scaleY=30/document.getElementById("visu2_svg").getAttribute("height");
......@@ -188,7 +202,7 @@
*/
doc.setFont('courier', 'bold');
doc.setTextColor(tagColor[i]);
doc.setTextColor(tagColor[m.windows[i].tag]);
doc.text(30, y, m.getName(id));
doc.setFont('courier', 'normal');
doc.setTextColor(0,0,0);
......
......@@ -29,6 +29,30 @@
"window": "ACTGTGCCACCTGGGATACGAGGAATTATTATAAGAAACT",
"tag": 3,
"name": "BCD-D"
},
{
"window": "GCGAGAGATCGGGGGCCAGCGTCGTCAGTGGCTGGTAAATTTTTCCGGCCGGTACTACTA",
"tag": 0
},
{
"name": "WTK-1 | 66.3%",
"window": "TGTGCAAAAGATATTCTTAAATCACTTAAGCAGCAGCTGGCCACCCCGAACTGGTTCGAC",
"tag": 3
},
{
"name": "WTK-2 | 3.5%",
"window": "ATCAGCAGCCTAAAGGCTGAGGACACCCGACAGGGTATGGACGTCTGGGGCCAAGGGACC",
"tag": 3
},
{
"name": "WTK-3 | 2.6%",
"window": "GTGCAAAAGATATTCTTAAAATCACTTAAGCAGCAGCTGGCCACCCCGAACTGGTTCGAC",
"tag": 3
},
{
"name": "WTK-4 | 2.3%",
"window": "TATCAGCAGCCTAAAGGCTGAGGACACCCGACAGGTATGGACGTCTGGGGCCAAGGGACC",
"tag": 3
}
],
"cluster": [
......
# Vidjil -- V(D)J recombinations analysis <http://bioinfo.lifl.fr/vidjil>
# Copyright (C) 2011, 2012, 2013, 2014 by Bonsai bioinformatics at LIFL (UMR CNRS 8022, Université Lille) and Inria Lille
# Contact: mathieu.giraud@lifl.fr, mikael.salson@lifl.fr
# contact@vidjil.org
V(D)J recombinations in lymphocytes are essential for immunological
......
......@@ -411,22 +411,30 @@ def common_substring(l):
else:
return ""
def interesting_substrings(l):
def interesting_substrings(l, target_length=6):
'''Return a list with intersting substrings.
Now it removes common prefixes and suffixes, and then the longest
common substring.
common substring.
But it stops removing once all lengths are at most 'target_length'.
>>> interesting_substrings(['ec-3--bla', 'ec-512-bla', 'ec-47-bla'])
>>> interesting_substrings(['ec-3--bla', 'ec-512-bla', 'ec-47-bla'], target_length=0)
['3-', '512', '47']
>>> interesting_substrings(['ec-A-seq-1-bla', 'ec-B-seq-512-bla', 'ec-C-seq-21-bla'])
>>> interesting_substrings(['ec-A-seq-1-bla', 'ec-B-seq-512-bla', 'ec-C-seq-21-bla'], target_length=0)
['A1', 'B512', 'C21']
>>> interesting_substrings(['ec-A-seq-1-bla', 'ec-B-seq-512-bla', 'ec-C-seq-21-bla'], target_length=9)
['A-seq-1', 'B-seq-512', 'C-seq-21']
'''
if not l:
return {}
if max(map (len, l)) <= target_length:
return l
min_length = min(map (len, l))
### Remove prefixes
common_prefix = 0
for i in range(min_length):
if all(map(lambda x: x[i] == l[0][i], l)):
......@@ -434,17 +442,30 @@ def interesting_substrings(l):
else:
break
substrings = [x[common_prefix:] for x in l]
if max(map (len, substrings)) <= target_length:
return substrings
### Remove suffixes
common_suffix = 0
for i in range(min_length - common_prefix):
if all(map(lambda x: x[-(i+1)] == l[0][-(i+1)], l)):
common_suffix = i
else:
break
### Build list
substrings = [x[common_prefix:-(common_suffix+1)] for x in l]
substrings = [x[common_prefix:-(common_suffix+1)] for x in l]
if max(map (len, substrings)) <= target_length:
return substrings
### Remove the longest common substring
common = common_substring(substrings)
substrings = [s.replace(common, '') for s in substrings]
return substrings
# ### Build dict
......
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