diff --git a/app/scripts/src/Eplant.BaseViews/EFPView/Eplant.BaseViews.EFPView.js b/app/scripts/src/Eplant.BaseViews/EFPView/Eplant.BaseViews.EFPView.js index 01756ca..aa38d42 100644 --- a/app/scripts/src/Eplant.BaseViews/EFPView/Eplant.BaseViews.EFPView.js +++ b/app/scripts/src/Eplant.BaseViews/EFPView/Eplant.BaseViews.EFPView.js @@ -711,8 +711,6 @@ }, dataType: "json", type: "GET", - async: false, - cache: false, url: this.webService + "id=" + this.geneticElement.identifier + "&samples=" + JSON.stringify(sampleNames), success: $.proxy(function(response) { this.eFPView.Xhrs.loadSamplesXhr =null; diff --git a/app/scripts/src/Eplant.ExpressionAngler.js b/app/scripts/src/Eplant.ExpressionAngler.js index 80d6fe0..1c118a5 100644 --- a/app/scripts/src/Eplant.ExpressionAngler.js +++ b/app/scripts/src/Eplant.ExpressionAngler.js @@ -59,10 +59,16 @@ url: ExpressionAnglerUrl + 'getData.php?id=' + dataId, type: 'get', success: $.proxy(function( res) { - $.get( tempDistributionLink, $.proxy(function(distribution) { - var jsondis = $.parseJSON( distribution.replace(/bin/g,'"bin"').replace(/val/g,'"val"')); - },this)); - Eplant.rawEAText=res; + $.ajax({ + beforeSend: function(request) { + request.setRequestHeader('Authorization', 'Bearer ' + Agave.token.accessToken); + }, + url: ExpressionAnglerUrl + 'getHistogram.php?id=' + dataId, + type: 'get', + success: $.proxy(function(distribution) { + var jsondis = $.parseJSON( distribution.replace(/bin/g,'"bin"').replace(/val/g,'"val"')); + },this) + }); var list = Eplant.processEAList(res,mainIdentifier,resultCount); Eplant.closeEADialog(); this.showFoundGenes(list,mainIdentifier,URL,resultCount); @@ -83,10 +89,8 @@ Eplant.closeEADialog(); Eplant.expressionAnglerResultDialog = DialogManager.artDialogDynamic(dom[0],{ close:Eplant.cancelXhr - }); - + }); } - },this) }); }; @@ -231,52 +235,65 @@ var eaRegEx = /(.*)\?(agi_id=.*)/gmi; var eaMatch = eaRegEx.exec(Eplant.currentEAQuery); - Eplant.expressionXhrService = $.post(eaMatch[1], eaMatch[2], $.proxy(function( data ) { - var doc = $.parseHTML(data) - var tempLinkEle = $('b:contains("View data set as text")', doc); - if(tempLinkEle.length>0){ - var tempFileLink = tempLinkEle.parent().attr('href').replace('..','//bar.utoronto.ca/ntools'); - var tempDistributionLink = tempFileLink.replace("ExpressionAngler","pcc_histogram"); - Eplant.expressionXhrLink = $.get( tempFileLink, $.proxy(function( res ) { - $.get( tempDistributionLink, $.proxy(function( distribution ) { - var jsondis = $.parseJSON( distribution.replace(/bin/g,'"bin"').replace(/val/g,'"val"')); - },this)); - var list = this.processEAList(res,Eplant.mainIdentifier,resultCount); - if(list.length0){ + + var tempFileLink = tempLinkEle.parent().attr('href').replace(/..\/.+_/i,''); + var dataId = tempFileLink.replace(/.txt/i,''); + var tempDistributionLink = tempFileLink.replace("ExpressionAngler","pcc_histogram"); + + Eplant.expressionXhrLink = $.ajax({ + beforeSend: function(request) { + request.setRequestHeader('Authorization', 'Bearer ' + Agave.token.accessToken); + }, + url: ExpressionAnglerUrl + 'getData.php?id=' + dataId, + type: 'get', + success: $.proxy(function( res) { + $.ajax({ + beforeSend: function(request) { + request.setRequestHeader('Authorization', 'Bearer ' + Agave.token.accessToken); + }, + url: ExpressionAnglerUrl + 'getHistogram.php?id=' + dataId, + type: 'get', + success: $.proxy(function(distribution) { + var jsondis = $.parseJSON( distribution.replace(/bin/g,'"bin"').replace(/val/g,'"val"')); + },this) + }); + var list = Eplant.processEAList(res,mainIdentifier,resultCount); + Eplant.closeEADialog(); + this.showFoundGenes(list,mainIdentifier,URL,resultCount); + },this) + }); + } else { + var dom = $('
', { + }); + dom.css({'text-align':'center'}); + var p = $('
', { + html: '

Results


Expression Angler found 0 matches.
' + }).css({ + 'max-height': '400px', + 'overflow': 'auto' + }); + $(dom).append(p); Eplant.closeEADialog(); - }); - } - else{ - var dom = $('
', { - }); - dom.css({'text-align':'center'}); - var p = $('
', { - html: '

Results


Expression Angler found 0 matches.
' - }).css({ - 'max-height': '400px', - 'overflow': 'auto' - }); - $(dom).append(p); - Eplant.closeEADialog(); - Eplant.expressionAnglerResultDialog = DialogManager.artDialogDynamic(dom[0],{ - close:Eplant.cancelXhr - }); + Eplant.expressionAnglerResultDialog = DialogManager.artDialogDynamic(dom[0],{ + close:Eplant.cancelXhr + }); - } - - },this)) - .always(function() { + } + },this) }); - }; - + Eplant.showFoundGenes = function(list,mainIdentifier,URL,resultCount) { var dom = $('
', { }); diff --git a/app/scripts/src/Eplant.Views/GeneInfoView/Eplant.Views.GeneInfoView.js b/app/scripts/src/Eplant.Views/GeneInfoView/Eplant.Views.GeneInfoView.js index 0d155cb..7af3a52 100644 --- a/app/scripts/src/Eplant.Views/GeneInfoView/Eplant.Views.GeneInfoView.js +++ b/app/scripts/src/Eplant.Views/GeneInfoView/Eplant.Views.GeneInfoView.js @@ -177,8 +177,6 @@ beforeSend: function(request) { request.setRequestHeader('Authorization', 'Bearer ' + Agave.token.accessToken); }, - async: false, - cache: false, type: 'GET', url: 'https://api.araport.org/community/v0.3/araport/gene_summary_by_locus_v0.2/search?locus=' + this.geneticElement.identifier, dataType: 'json', @@ -228,8 +226,6 @@ }, type: "GET", dataType: "json", - async: false, - cache: false, url: 'https://api.araport.org/community/v0.3/araport/araport11_gff_region_to_jbrowse_v0.1/search?q=features&chr='+this.geneticElement.chromosome.identifier+'&start='+this.chromosome_start+'&end='+this.chromosome_end+'&completely_within=true&interbase=true', //data: { locus: this.geneticElement.identifier }, success: $.proxy(function(data) { @@ -381,8 +377,6 @@ }, type: "GET", dataType: "json", - async: false, - cache: false, url: 'https://api.araport.org/community/v0.3/aip/get_sequence_by_identifier_v0.3/search?identifier=' + this.geneticElement.identifier, success: $.proxy(function(data) { @@ -405,8 +399,6 @@ }, type: "GET", dataType: "json", - async: false, - cache: false, url: 'https://api.araport.org/community/v0.3/aip/get_protein_sequence_by_identifier_v0.2/search?identifier='+this.geneticElement.identifier+'.1', error: $.proxy(function() { $("#"+config.IDs.divProteinSequenceId,this.domContainer).text("The service is not responding, please try again later."); diff --git a/app/scripts/src/Eplant.Views/MoleculeView/Eplant.Views.MoleculeView3.js b/app/scripts/src/Eplant.Views/MoleculeView/Eplant.Views.MoleculeView3.js index 73b82d2..e6b5556 100644 --- a/app/scripts/src/Eplant.Views/MoleculeView/Eplant.Views.MoleculeView3.js +++ b/app/scripts/src/Eplant.Views/MoleculeView/Eplant.Views.MoleculeView3.js @@ -162,8 +162,6 @@ request.setRequestHeader('Authorization', 'Bearer ' + Agave.token.accessToken); }, dataType: "json", - async: false, - cache: false, url: Eplant.ServiceUrl + 'JSMol.cgi?agi=' + this.geneticElement.identifier, success: $.proxy(function(response) { var moleculeSequenceStringArr = []; @@ -177,8 +175,6 @@ request.setRequestHeader('Authorization', 'Bearer ' + Agave.token.accessToken); }, dataType: "json", - async: false, - cache: false, url: 'https://api.araport.org/community/v0.3/aip/get_protein_sequence_by_identifier_v0.2/search?identifier='+this.geneticElement.identifier+'.1', type: 'GET', error: $.proxy(function() { diff --git a/app/scripts/src/Eplant.Views/PublicationView/Eplant.Views.PublicationView.js b/app/scripts/src/Eplant.Views/PublicationView/Eplant.Views.PublicationView.js index c810333..dda763f 100644 --- a/app/scripts/src/Eplant.Views/PublicationView/Eplant.Views.PublicationView.js +++ b/app/scripts/src/Eplant.Views/PublicationView/Eplant.Views.PublicationView.js @@ -168,8 +168,6 @@ beforeSend: function(request) { request.setRequestHeader('Authorization', 'Bearer ' + Agave.token.accessToken); }, - async: false, - cache: false, type: "GET", url: 'https://api.araport.org/community/v0.3/araport/publications_by_locus_v0.1/search?locus=' + this.geneticElement.identifier, dataType: 'json', @@ -209,8 +207,6 @@ beforeSend: function(request) { request.setRequestHeader('Authorization', 'Bearer ' + Agave.token.accessToken); }, - async: false, - cache: false, type: "GET", url: 'https://api.araport.org/community/v0.3/araport/generifs_by_locus_v0.1/search?locus=' + this.geneticElement.identifier, dataType: 'json',