From d929f199c39dcf919d4e4a619bdf7c46cfeac898 Mon Sep 17 00:00:00 2001 From: Colin Combe Date: Fri, 3 Nov 2017 16:22:38 +0000 Subject: [PATCH] better error message for proteins missing from FASTA files --- build/crosslinkviewer.js | 4 ++-- src/model/Match.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/crosslinkviewer.js b/build/crosslinkviewer.js index dfb5cb5d..2e600927 100644 --- a/build/crosslinkviewer.js +++ b/build/crosslinkviewer.js @@ -403,8 +403,8 @@ x.replace(m,"")):this.pepSeq2=null:this.pepSeq2=null;g=Z(g);k=Z(k);t=Z(t);u=Z(u) t&&(F+=t-1),null!==u&&(D+=u-1),this.associateWithLink(I,U,F,D,g[v]-0,this.pepSeq1.length,k[x],this.pepSeq2.length)}else for(v=0;v=c.length&&(I=c.length-1),U>=f.length&&(U=f.length-1),I=c[I],U=f[U],F=t[v]-0,D=u[x]-0,this.associateWithLink(I,U,F,D,null,null,null,null);this.hd=!1;this.overlap=[];I===U&&(this.pepSeq1&&this.pepSeq2?(I=g[0],U=k[0],D=I+(this.pepSeq1.length-1),F=U+(this.pepSeq2.length-1),I>=U&&I<=F?(this.hd=!0,this.overlap[0]=I-1,this.overlap[1]= D=I&&U<=D&&(this.hd=!0,this.overlap[0]=U-1,this.overlap[1]=F -ProteinLink.maxNoResidueLinks&&(ProteinLink.maxNoResidueLinks=y.residueLinks.keys().length));if("undefined"===typeof x.matches||null==x.matches)x.matches=[];!1===u?x.matches.push([this,m,p,s,t]):x.matches.push([this,s,t,m,p]);this.residueLinks.push(x)}; +c+"-"+g+" Are both of these IDs in your FASTA file?"),y=new ProteinLink(u,v,x,this.controller),this.controller.proteinLinks.set(u,y),v.addLink(y),null!==x&&x.addLink(y));u=!1;c===g||null===g?f-0ProteinLink.maxNoResidueLinks&&(ProteinLink.maxNoResidueLinks=y.residueLinks.keys().length));if("undefined"===typeof x.matches||null==x.matches)x.matches=[];!1===u?x.matches.push([this,m,p,s,t]):x.matches.push([this,s,t,m,p]);this.residueLinks.push(x)}; Match.prototype.meetsFilterCriteria=function(){return this.isAmbig()&&!1===this.controller.ambigShown?!1:"function"==typeof this.controller.filter?this.controller.filter(this):"undefined"!==typeof this.controller.cutOff&&"undefined"!==typeof this.score?this.score>=this.controller.cutOff?!0:!1:!0};Match.prototype.isAmbig=function(){return 1

"+this.id+"

");c+="

"+this.protein1+"

";c+="

"+this.pepPos1+"

";c+="

"+this.pepSeq1+"

";c+="

"+this.linkPos1+"

";c+="

"+this.protein2+"

";c+="

"+this.pepPos2+"

";c+="

"+this.pepSeq2+"

";c+="

"+this.linkPos2+"

";c+="

"+("undefined"!==typeof this.score?this.score.toFixed(4):"undefined")+"

";!0===this.controller.autoValidatedFound&& (c+="

"+this.autovalidated+"

");!0===this.controller.manualValidatedFound&&(c+="

"+this.validated+"

");return c+""};xiNET.Link=function(){};xiNET.Link.prototype.mouseDown=function(c){this.controller.preventDefaultsAndStopPropagation(c);this.controller.force&&this.controller.force.stop();this.controller.dragElement=this;this.controller.clearSelection();this.setSelected(!0);c=this.controller.getEventPoint(c);this.controller.dragStart=this.controller.mouseToSVG(c.x,c.y);return!1}; diff --git a/src/model/Match.js b/src/model/Match.js index c5ede5b8..8152f9f4 100644 --- a/src/model/Match.js +++ b/src/model/Match.js @@ -418,7 +418,7 @@ Match.prototype.associateWithLink = function (p1ID, p2ID, res1, res2, //followin if (link === undefined) { if (fromProt === undefined || toProt === undefined) { alert("Something has gone wrong; a link has been added before a protein it links to. " + - p1ID + "-" + p2ID); + p1ID + "-" + p2ID + " Are both of these IDs in your FASTA file?"); } link = new ProteinLink(proteinLinkID, fromProt, toProt, this.controller); this.controller.proteinLinks.set(proteinLinkID, link);