Skip to content

Commit

Permalink
Fixed a bug with Invalid gene input for query
Browse files Browse the repository at this point in the history
  • Loading branch information
NoorMuhammad1 committed Jun 14, 2024
1 parent 25000d4 commit f9892bb
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions app/js/backbone-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,7 @@ var NeighborhoodQueryView = Backbone.View.extend({

$(document)
.off("click", "#save-query-neighborhood")
.on("click", "#save-query-neighborhood", function (evt) {
.on("click", "#save-query-neighborhood", async function (evt) {
// use active chise instance
var chiseInstance = appUtilities.getActiveChiseInstance();

Expand Down Expand Up @@ -2115,7 +2115,7 @@ var NeighborhoodQueryView = Backbone.View.extend({
}).render();
document.getElementById("query-neighborhood-length-limit").focus();
return;

}

var geneSymbolsArray = geneSymbols
Expand All @@ -2126,7 +2126,7 @@ var NeighborhoodQueryView = Backbone.View.extend({
if(handleDuplicateGenes(geneSymbolsArray,chiseInstance))return;

// Check if the gene symbols that are added even exist in the database or not
if(handleGeneDoesNotExist(geneSymbolsArray,chiseInstance))return;
if(await handleGeneDoesNotExist(geneSymbolsArray,chiseInstance))return;

var queryURL =
"http://www.pathwaycommons.org/pc2/graph?format=SBGN&kind=NEIGHBORHOOD&limit=" +
Expand Down Expand Up @@ -2412,7 +2412,9 @@ var PathsBetweenQueryView = Backbone.View.extend({
if(handleDuplicateGenes(geneSymbolsArray,chiseInstance))return;

// Check if the gene symbols that are added even exist in the database or not
if(handleGeneDoesNotExist(geneSymbolsArray,chiseInstance))return;
if(await handleGeneDoesNotExist(geneSymbolsArray,chiseInstance)){
return;
}



Expand Down Expand Up @@ -2445,7 +2447,6 @@ var PathsBetweenQueryView = Backbone.View.extend({
}
filename = filename + "_PATHSBETWEEN.nwt";
queryURL = queryURL + sources;

if (cy.nodes().length == 0) {
chiseInstance.startSpinner("paths-between-spinner");
var currentGeneralProperties = appUtilities.getScratch(
Expand Down Expand Up @@ -2650,7 +2651,7 @@ var PathsFromToQueryView = Backbone.View.extend({

$(document)
.off("click", "#save-query-pathsfromto")
.on("click", "#save-query-pathsfromto", function (evt) {
.on("click", "#save-query-pathsfromto", async function (evt) {
// use active chise instance
var chiseInstance = appUtilities.getActiveChiseInstance();

Expand Down Expand Up @@ -2718,6 +2719,21 @@ var PathsFromToQueryView = Backbone.View.extend({
.replaceAll("\t", " ")
.split(" ");


// Check if duplicate symbols are given or not
if(handleDuplicateGenes(sourceSymbolsArray,chiseInstance))return;
// Check if the gene symbols that are added even exist in the database or not
if(await handleGeneDoesNotExist(sourceSymbolsArray,chiseInstance)){
return;
}

// Check if duplicate symbols are given or not
if(handleDuplicateGenes(targetSymbolsArray,chiseInstance))return;
// Check if the gene symbols that are added even exist in the database or not
if(await handleGeneDoesNotExist(targetSymbolsArray,chiseInstance)){
return;
}

var filename = "";
var sources = "";
var targets = "";
Expand Down Expand Up @@ -2983,7 +2999,7 @@ var CommonStreamQueryView = Backbone.View.extend({

$(document)
.off("click", "#save-query-commonstream")
.on("click", "#save-query-commonstream", function (evt) {
.on("click", "#save-query-commonstream",async function (evt) {
// use active chise instance
var chiseInstance = appUtilities.getActiveChiseInstance();

Expand Down Expand Up @@ -3028,6 +3044,13 @@ var CommonStreamQueryView = Backbone.View.extend({
.replaceAll("\t", " ")
.split(" ");

// Check if duplicate symbols are given or not
if(handleDuplicateGenes(geneSymbolsArray,chiseInstance))return;
// Check if the gene symbols that are added even exist in the database or not
if(await handleGeneDoesNotExist(geneSymbolsArray,chiseInstance)){
return;
}

var filename = "";
var sources = "";
for (var i = 0; i < geneSymbolsArray.length; i++) {
Expand Down Expand Up @@ -3254,7 +3277,7 @@ var PathsByURIQueryView = Backbone.View.extend({

$(document)
.off("click", "#save-query-pathsbyURI")
.on("click", "#save-query-pathsbyURI", function (evt) {
.on("click", "#save-query-pathsbyURI",function (evt) {
// use the active chise instance
var chiseInstance = appUtilities.getActiveChiseInstance();

Expand Down

0 comments on commit f9892bb

Please sign in to comment.