Commit 0ed669d0 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Disable sort in All-vs-All mode, Fixes #81

parent 6391ff30
......@@ -90,6 +90,14 @@ d3.boxplot.launch = function(res, update=false) {
}
d3.boxplot.name_x = res["name_x"];
d3.boxplot.name_y = res["name_y"];
if (d3.boxplot.name_x === d3.boxplot.name_y) {
$("input#sort-contigs").hide();
}
else {
$("input#sort-contigs").show();
}
d3.boxplot.lines = res["lines"];
d3.boxplot.x_len = res["x_len"];
d3.boxplot.y_len = res["y_len"];
......
......@@ -25,7 +25,7 @@ dgenies.result.controls.launch_sort_contigs = function () {
}
else {
dgenies.hide_loading();
dgenies.notify("An error occurred! Please contact us to report the bug", "danger");
dgenies.notify(data["message"] || "An error occurred! Please contact us to report the bug", "danger");
}
}
);
......
......@@ -12,6 +12,7 @@ import requests
import wget
from jinja2 import Template
import traceback
from pathlib import Path
class JobManager:
......@@ -189,6 +190,7 @@ class JobManager:
Functions.index_file(self.query, query_index)
else:
shutil.copyfile(target_index, query_index)
Path(os.path.join(self.output_dir, ".all-vs-all")).touch()
job = Job.get(id_job=self.id_job)
job.status = "success"
db.commit()
......
......@@ -190,16 +190,18 @@ def get_graph():
@app.route('/sort/<id_res>', methods=['POST'])
def sort_graph(id_res):
paf = os.path.join(app_data, id_res, "map.paf")
idx1 = os.path.join(app_data, id_res, "query.idx")
idx2 = os.path.join(app_data, id_res, "target.idx")
paf = Paf(paf, idx1, idx2, False)
paf.sort()
if paf.parsed:
res = paf.get_d3js_data()
res["success"] = True
return jsonify(res)
return jsonify({"success": False, "message": paf.error})
if not os.path.exists(os.path.join(APP_DATA, id_res, ".all-vs-all")):
paf = os.path.join(app_data, id_res, "map.paf")
idx1 = os.path.join(app_data, id_res, "query.idx")
idx2 = os.path.join(app_data, id_res, "target.idx")
paf = Paf(paf, idx1, idx2, False)
paf.sort()
if paf.parsed:
res = paf.get_d3js_data()
res["success"] = True
return jsonify(res)
return jsonify({"success": False, "message": paf.error})
return jsonify({"success": False, "message": "Sort is not available for All-vs-All mode"})
@app.route('/get-fasta-query/<id_res>', methods=['POST'])
......
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