Commit dc38385f authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-sc/3917-calling-subset' into 'dev'

Calling subset

Closes #3917 and vdj#893

See merge request !518
parents 19df7b47 80cfe04a
Pipeline #96935 passed with stages
in 7 minutes and 4 seconds
var DEFAULT_DB_ADDRESS="https://db.vidjil.org/vidjil/";
requirejs.config({
baseUrl: 'js/lib',
paths: {
......@@ -30,6 +32,12 @@ require(["../git-sha1"], function () { console.log("Vidjil client " + git_sha1)
function loadAfterConf() {
if (typeof config === "undefined") {
config = {};
config.db_address = DEFAULT_DB_ADDRESS;
config.use_database = false;
}
require(['../../doctips/tips'],
function(){},
function(err) {
......
......@@ -21,11 +21,6 @@ var config = {
"cgi_address" : "https://db.vidjil.org/cgi/", // Public test server
// "cgi_address" : "http://127.0.1.1/cgi-bin/",
/* Proxy config for IMGT querying */
/*
"proxy": "https://db.vidjil.org/vidjil/proxy/imgt",
*/
/* Used for the standalone http://app.vidjil.org/analyze page */
"segmenter_address" : "https://db.vidjil.org/vidjil/segmenter",
......
var PROXY_ADDRESS = "https://db.vidjil.org/vidjil/proxy/imgt"
var modelRef;
/**
......@@ -162,10 +161,14 @@ function imgtPostForSegmenter(species, data, system, segmenter, override_imgt_op
//disabled due to security concerns
//form.action = "http://www.imgt.org/IMGT_vquest/vquest";
//using proxy on server to allow requests on other site than vidjil one's in JS.
if (typeof config != 'undefined' && typeof config.proxy != 'undefined') {
form.action = config.proxy
if (typeof config != 'undefined' && typeof config.db_address != 'undefined') {
form.action = config.db_address+"/proxy/imgt"
} else {
form.action = PROXY_ADDRESS;
console.log({
"type": "flash",
"msg": "Your installation doesn't seem to be associated with a database.",
"priority": 2
});
}
form.method = "POST";
......@@ -427,10 +430,18 @@ function assignSubsetsPost(species, data, system) {
} else {
var form = document.getElementById("form");
form.removeAllChildren();
// form.target = "_blank";
form.target = "_blank";
form.enctype = 'multipart/form-data';
form.name = 'assignsubsets';
form.action = "http://tools.bat.infspire.org/cgi-bin/arrest/assignsubsets_html.pl";
if (typeof config != 'undefined' && typeof config.db_address != 'undefined') {
form.action = config.db_address+"/proxy/assign_subsets"
} else {
console.log({
"type": "flash",
"msg": "Your installation doesn't seem to be associated with a database.",
"priority": 2
});
}
form.method = "POST";
var formData = {};
formData.fastatext = data;
......
......@@ -187,7 +187,7 @@ Segment.prototype = {
div_menu.appendChild(span)
//toIMGT button
span = createSendToButton("toIMGT", 'imgt', "to IMGT/V-QUEST",
span = createSendToButton("toIMGT", 'imgt', "❯ IMGT/V-QUEST",
'Send sequences to IMGT/V-QUEST and see the results in a new tab', this);
div_menu.appendChild(span)
......@@ -198,18 +198,18 @@ Segment.prototype = {
div_menu.appendChild(span);
//toIgBlast button
span = createSendToButton("toIgBlast", 'igBlast', "to IgBlast",
span = createSendToButton("toIgBlast", 'igBlast', "❯ IgBlast",
'Send sequences to NCBI IgBlast and see the results in a new tab', this);
div_menu.appendChild(span);
//toARResT button
span = createSendToButton("toARResT", "arrest", "to ARResT/CJ",
span = createSendToButton("toARResT", "arrest", "❯ ARResT/CJ",
'Send sequences to ARResT/CompileJunctions and see the results in a new tab', this);
span.className += " devel-mode";
div_menu.appendChild(span);
//toCloneDB button
span = createSendToButton('toCloneDB', '', "to CloneDB",
span = createSendToButton('toCloneDB', '', "❯ CloneDB",
'Send sequences to EC-NGS/CloneDB in the background',
this,
function () {
......@@ -220,21 +220,20 @@ Segment.prototype = {
//toBlast button
span = createSendToButton("toBlast", "blast",
"to Blast",
"❯ Blast",
'Send sequences to Ensembl Blast and see the results in a new tab', this);
div_menu.appendChild(span);
// to AssignSubset
span = createSendToButton("toAssignSubsets", "assignSubsets", "to AssignSubsets",
span = createSendToButton("toAssignSubsets", "assignSubsets", "❯ AssignSubsets",
"Send sequences to ARResT/AssignSubsets to classify IGH sequence in a CLL subset", this);
span.className += " devel-mode";
div_menu.appendChild(span);
//toClipBoard button
span = document.createElement('span');
span.id = "toClipBoard";
span.className = "button";
span.appendChild(document.createTextNode("to clipBoard"));
span.appendChild(document.createTextNode("❯ clipBoard"));
// div_menu.appendChild(span)
//germline button
......
......@@ -10,17 +10,22 @@ if request.env.http_origin:
def index():
return gluon.contrib.simplejson.dumps("index()")
def imgt():
def proxy_request(url, headers={}):
if request.env.request_method == "POST":
payload = dict(request.post_vars)
if 'Session' in payload.keys():
del payload['Session']
response = requests.post("http://www.imgt.org/IMGT_vquest/analysis", data=payload)
response = requests.post(url, headers = headers, data=payload)
if response.status_code == requests.codes.ok:
return response
return gluon.contrib.simplejson.dumps("the site returned an invalid response")
return gluon.contrib.simplejson.dumps("improper method")
def imgt():
return proxy_request("http://www.imgt.org/IMGT_vquest/analysis")
def assign_subsets():
return proxy_request("http://tools.bat.infspire.org/cgi-bin/arrest/assignsubsets_html.pl",
{'referer': "http://tools.bat.infspire.org/arrest/assignsubsets/"})
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