Commit b55bcc90 authored by Marc Duez's avatar Marc Duez

export.js : clone size by system

parent ddb95672
......@@ -144,6 +144,26 @@ Clone.prototype = {
return this.m.formatSize(size, true)
},
getSystemSize: function (time) {
time = typeof time !== 'undefined' ? time : this.m.t;
var system_reads = this.m.reads.segmented[time]
if (this.germline in this.m.reads.germline) system_reads = this.m.reads.germline[this.germline][time]
if (system_reads == 0 ) return 0
var result = this.getReads(time) / system_reads
if (this.m.norm) result = this.m.normalize(result, time)
return result
},
getStrSystemSize: function (time) {
time = typeof time !== 'undefined' ? time : this.m.t;
var size = this.getSystemSize(time);
return this.m.formatSize(size, true)
},
/*
*
* */
......
......@@ -386,13 +386,14 @@ Report.prototype = {
clone : function(cloneID, time) {
if (typeof time == "undefined") time = -1
var color = tagColor[m.clone(cloneID).getTag()]
var system = m.clone(cloneID).germline
var clone = $('<div/>', {class: 'clone'})
graph.resize(791,300)
graph.draw(0)
var head = $('<span/>', {class: 'clone_head'}).appendTo(clone);
//clone svg path icon
if (time == -1){
var icon = $('<span/>', {class: 'icon'}).appendTo(head);
var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
......@@ -406,21 +407,34 @@ Report.prototype = {
icon.append(svg)
}
//clone label
$('<span/>', {text: ">"+m.clone(cloneID).getCode()+'\u00a0', class: 'clone_name', style : 'color:'+color}).appendTo(head);
if (typeof m.clone(cloneID).c_name != "undefined"){
$('<span/>', {text: m.clone(cloneID).c_name+'\u00a0', class: 'clone_name', style : 'color:'+color}).appendTo(head);
}
//clone reads stats
if (time == -1){
var reads_stats = $('<span/>', {class: 'clone_table'}).appendTo(clone);
for (var i=0; i<m.samples.order.length; i++){
var t = m.samples.order[i]
$('<span/>', {text : m.clone(cloneID).getStrSize(t)+'\u00a0', class: 'clone_value'}).appendTo(reads_stats);
}
if (m.system_available.length>1){
var reads_system_stats = $('<span/>', {class: 'clone_table'}).appendTo(clone);
for (var i=0; i<m.samples.order.length; i++){
var t = m.samples.order[i]
$('<span/>', {text : m.clone(cloneID).getStrSystemSize(t)+'\u00a0', class: 'clone_value'}).appendTo(reads_system_stats);
}
}
}else{
if (m.system_available.length>1){
$('<span/>', {text : '('+m.clone(cloneID).getStrSystemSize(time)+' of '+system+')\u00a0', class: 'float-right'}).appendTo(head);
}
$('<span/>', {text : m.clone(cloneID).getStrSize(time)+'\u00a0', class: 'float-right'}).appendTo(head);
}
//colorized clone sequence
var sequence = $('<div/>', {class: 'sequence'}).appendTo(clone);
if (typeof m.clone(cloneID).seg != 'undefined'){
var seg = m.clone(cloneID).seg
......
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