Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 743dca4f authored by flothoni's avatar flothoni Committed by Mikaël Salson

exportFasta; update functions from model and segmenter

Remove the html <pre> of functions and add it to the opener window function call
link to 2876
parent 08ec65cf
......@@ -2213,11 +2213,11 @@ changeAlleleNotation: function(alleleNotation) {
* save a csv file of the currently visibles clones.
* @return {string} csv
* */
exportFasta: function () {
getFasta: function () {
var list = this.getSelected()
if (list.length>0){
var fasta = '<pre>'
var fasta = ''
for (var i=0; i<list.length; i++){
fasta += this.clone(list[i]).getFasta() + '\n'
}
......@@ -2247,11 +2247,18 @@ changeAlleleNotation: function(alleleNotation) {
}
}
}
openAndFillNewTab( fasta )
}else{
return fasta
} else {
console.log({msg: "Export FASTA: please select clones to be exported", type: 'flash', priority: 2});
}
return -1
},
exportFasta: function () {
var fasta = this.getFasta()
if (fasta != -1) {
openAndFillNewTab( "<pre>" + fasta )
}
},
......
......@@ -954,7 +954,7 @@ Segment.prototype = {
* */
toFasta: function () {
var selected = this.sequenceListInSegmenter();
var result = '<pre>';
var result = '';
for (var i = 0; i < selected.length; i++) {
if (typeof this.sequence[selected[i]] !== "undefined" &&
......@@ -982,7 +982,7 @@ Segment.prototype = {
if (list.length>0){
var fasta = this.toFasta()
openAndFillNewTab( fasta )
openAndFillNewTab( "<pre>" + fasta )
}else{
console.log({msg: "Export FASTA: please select clones to be exported", type: 'flash', priority: 2});
}
......
......@@ -145,9 +145,9 @@ QUnit.test("segt", function (assert) {
assert.deepEqual(segment.sequence[3].get_positionned_highlight("test_feature",""),{"color": "", "css": "highlight_seq", "seq": "CACCCAGGAGGTGGAGCTGGATATTGAGACT", "start": 94, "stop": 124, "tooltip": ""}, "test feature value")
assert.equal(m.clone(3).getSegLength('test_feature'),31, "feature length");
m.unselectAll();
assert.equal(segment.toFasta(), "<pre>");
assert.equal(segment.toFasta(), "");
m.select(3);
assert.equal(segment.toFasta(), "<pre>> test4 // 2.500%\nGGAAGGCCCCACAGCGTCTTCTGTACTATGACGTCTCCACCGCAAGGGATGTGTTGGAATCAGGACTCAGTCCAGGAAAGTATTATACTCATACACCCAGGAGGTGGAGCTGGATATTGAGACTGCAAAATCTAATTGAAAATGATTCTGGGGTCTATTACTGTGCCACCTGGGACAGGCTGAAGGATTGGATCAAGACGTTTGCAAAAGGGACTAGGCTCATAGTAACTTCGCCTGGTAA\n", "fasta seq ")
assert.equal(segment.toFasta(), "> test4 // 2.500%\nGGAAGGCCCCACAGCGTCTTCTGTACTATGACGTCTCCACCGCAAGGGATGTGTTGGAATCAGGACTCAGTCCAGGAAAGTATTATACTCATACACCCAGGAGGTGGAGCTGGATATTGAGACTGCAAAATCTAATTGAAAATGATTCTGGGGTCTATTACTGTGCCACCTGGGACAGGCTGAAGGATTGGATCAAGACGTTTGCAAAAGGGACTAGGCTCATAGTAACTTCGCCTGGTAA\n", "fasta seq ")
assert.ok(segment.isDNA('CACCCAGGAGGTGGAGCTGGATATTGAGACT'), "test dna")
assert.ok(segment.isAA('CACCCAGGAGGTGGAGCTGGATATTGAGACT'), "test AA")
assert.ok(segment.isPos(h), "test if an object contain pos")
......
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