Commit ffbf8812 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

js/clone.js, js/model.js: extract '.toCSVheader()' to clone.js

It will be easier to maintain this method just besides '.toCSV()'
See #2327.
parent 646ba52e
......@@ -1200,6 +1200,15 @@ Clone.prototype = {
return html
},
toCSVheader: function (m) {
var csv = "name,id,system,tag,v,d,j,sequence"
for (var i=0; i<m.samples.order.length; i++) csv += ",reads_"+i
for (var i=0; i<m.samples.order.length; i++) csv += ",ratio_"+i
for (var i=0; i<m.samples.order.length; i++) csv += ",ratios_"+i
return csv
},
toCSV: function () {
var csv = this.getName() + "," + this.id + "," + this.get('germline') + "," + this.getTagName() + ","
+ this.getGene("5") + "," + this.getGene("4") + "," + this.getGene("3") + "," + this.getSequence()
......
......@@ -1915,10 +1915,7 @@ changeCloneNotation: function(cloneNotationType) {
* */
toCSV: function () {
//header
var csv = "name,id,system,tag,v,d,j,sequence"
for (var i=0; i<this.samples.order.length; i++) csv += ",reads_"+i
for (var i=0; i<this.samples.order.length; i++) csv += ",ratio_"+i
for (var i=0; i<this.samples.order.length; i++) csv += ",ratios_"+i
var csv = Clone.prototype.toCSVheader(this)
csv += "\n"
//only non-empty active clones and virtual clones
......
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