@@ -39530,12 +39530,12 @@ var icn3d = (function (exports) {
3953039530
3953139531 if (nsse <= 3)
3953239532 // too small, can't split or trim
39533- return {subdomains: subdomains, substruct: substruct};
39533+ return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
3953439534
3953539535 if (nsse > this.MAX_SSE) {
3953639536 // we have a problem...
3953739537
39538- return {subdomains: subdomains, substruct: substruct};
39538+ return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
3953939539 }
3954039540
3954139541 let seqLen = residueArray.length; // + resiOffset;
@@ -39807,7 +39807,7 @@ var icn3d = (function (exports) {
3980739807 let k = prts[i] - 1;
3980839808
3980939809 if ((k < 0) || (k >= substruct.length)) {
39810- return {subdomains: subdomains, substruct: substruct};
39810+ return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
3981139811 }
3981239812
3981339813 //SSE_Rec sserec = substruct[k];
@@ -39924,7 +39924,7 @@ var icn3d = (function (exports) {
3992439924 }
3992539925 }
3992639926
39927- return {subdomains: subdomains, substruct: substruct, pos2resi:pos2resi };
39927+ return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
3992839928 } // end c2b_NewSplitChain
3992939929
3993039930 getDomainJsonForAlign(atoms) { let ic = this.icn3d, me = ic.icn3dui;
@@ -42826,10 +42826,10 @@ var icn3d = (function (exports) {
4282642826 // sometimes one chain may have several Ig domains,set an index for each IgDomain
4282742827 let index = 1, bStart = false;
4282842828
42829- // get the range of each strand excluding loops
42830- let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0;
42829+ // 1. get the range of each strand excluding loops
42830+ let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0, resCntBfAnchor = 0, resCntAtAnchor = 0 ;
4283142831 if(!bCustom && !kabat_or_imgt) {
42832- for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt) {
42832+ for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt, ++resCntBfAnchor, ++resCntAtAnchor ) {
4283342833 let currResi = ic.ParserUtilsCls.getResi(chnid, i);
4283442834 let residueid = chnid + '_' + currResi;
4283542835 refnumLabel = ic.resid2refnum[residueid];
@@ -42858,6 +42858,8 @@ var icn3d = (function (exports) {
4285842858
4285942859 if(currStrand && currStrand != ' ') {
4286042860 if(refnum3c.substr(0,1) != '9') {
42861+ let lastTwo = parseInt(refnum.toString().substr(refnum.toString().length - 2, 2));
42862+
4286142863 if(currStrand != prevStrand) { // reset currCnt
4286242864 if(strandHash[currStrand + postfix]) {
4286342865 ++index;
@@ -42869,10 +42871,19 @@ var icn3d = (function (exports) {
4286942871 strandArray[strandCnt] = {};
4287042872 strandArray[strandCnt].startResi = currResi;
4287142873 strandArray[strandCnt].startRefnum = refnum; // 1250 in A1250a
42874+
42875+ resCntBfAnchor = 0;
4287242876
4287342877 strandArray[strandCnt].endResi = currResi;
4287442878 strandArray[strandCnt].endRefnum = refnum; // 1250a
4287542879
42880+ if(lastTwo == 50) {
42881+ strandArray[strandCnt].anchorRefnum = refnum;
42882+ strandArray[strandCnt].resCntBfAnchor = resCntBfAnchor;
42883+
42884+ resCntAtAnchor = 0;
42885+ }
42886+
4287642887 strandArray[strandCnt].strandPostfix = strandPostfix; // a in A1250a
4287742888 strandArray[strandCnt].strand = currStrand; // A in A1250a
4287842889
@@ -42885,8 +42896,23 @@ var icn3d = (function (exports) {
4288542896 }
4288642897 else {
4288742898 if(strandHash[currStrand + postfix]) {
42899+ if(lastTwo == 50) {
42900+ strandArray[strandCnt - 1].anchorRefnum = refnum;
42901+ strandArray[strandCnt - 1].resCntBfAnchor = resCntBfAnchor;
42902+
42903+ // update
42904+ strandArray[strandCnt - 1].startRefnum = strandArray[strandCnt - 1].anchorRefnum - strandArray[strandCnt - 1].resCntBfAnchor;
42905+
42906+ resCntAtAnchor = 0;
42907+ }
42908+
4288842909 strandArray[strandCnt - 1].endResi = currResi;
4288942910 strandArray[strandCnt - 1].endRefnum = refnum; // 1250a
42911+ strandArray[strandCnt - 1].resCntAtAnchor = resCntAtAnchor;
42912+
42913+ if(strandArray[strandCnt - 1].anchorRefnum) {
42914+ strandArray[strandCnt - 1].endRefnum = strandArray[strandCnt - 1].anchorRefnum + strandArray[strandCnt - 1].resCntAtAnchor;
42915+ }
4289042916
4289142917 resCnt = 0;
4289242918 }
@@ -42898,13 +42924,26 @@ var icn3d = (function (exports) {
4289842924 prevStrand = currStrand;
4289942925 }
4290042926
42927+ // 2. remove strands with less than 3 residues
42928+ for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
42929+ if(strandArray[i].endRefnum - strandArray[i].startRefnum + 1 < 3) { // remove the strand
42930+ if(i != il - 1) { // modify
42931+ strandArray[i + 1].loopResCnt += strandArray[i].endRefnum - strandArray[i].startRefnum + 1;
42932+ }
42933+
42934+ strandArray.splice(i, 1);
42935+ }
42936+ }
42937+
42938+ // 3. assign refnumLabel for each resid
4290142939 strandCnt = 0;
4290242940 let loopCnt = 0;
4290342941
42904- let bNterminal = true, refnumLabelNoPostfix, prevStrandCnt = 0, currRefnum;
42942+ let bNterminal = true, bCterminal = true, refnumLabelNoPostfix, prevStrandCnt = 0, currRefnum;
4290542943 bStart = false;
42944+ let refnumInStrand = 0;
4290642945 if(strandArray.length > 0) {
42907- for(let i = 0, il = giSeq.length; i < il; ++i, ++loopCnt) {
42946+ for(let i = 0, il = giSeq.length; i < il; ++i, ++loopCnt, ++refnumInStrand ) {
4290842947 let currResi = ic.ParserUtilsCls.getResi(chnid, i);
4290942948 let residueid = chnid + '_' + currResi;
4291042949 refnumLabel = ic.resid2refnum[residueid];
@@ -42975,6 +43014,20 @@ var icn3d = (function (exports) {
4297543014 }
4297643015 else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
4297743016 bNterminal = false;
43017+ //bCterminal = true; // The next will be C-terminal
43018+
43019+ if(strandArray[strandCnt].anchorRefnum) { // use anchor to name refnum
43020+ if(currResi == strandArray[strandCnt].startResi) {
43021+ refnumInStrand = strandArray[strandCnt].anchorRefnum - strandArray[strandCnt].resCntBfAnchor;
43022+ strandArray[strandCnt].startRefnum = refnumInStrand;
43023+ }
43024+ else if(currResi == strandArray[strandCnt].endResi) {
43025+ strandArray[strandCnt].endRefnum = refnumInStrand;
43026+ }
43027+
43028+ refnumLabelNoPostfix = strandArray[strandCnt].strand + refnumInStrand;
43029+ refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
43030+ }
4297843031
4297943032 if(currResi == strandArray[strandCnt].endResi) {
4298043033 ++strandCnt; // next strand
@@ -42988,14 +43041,28 @@ var icn3d = (function (exports) {
4298843041 else if(parseInt(currResi) > parseInt(strandArray[strandCnt].endResi)) {
4298943042 ic.residIgLoop[residueid] = 1;
4299043043
42991- // C-terminal
42992- if(!ic.resid2refnum[residueid]) {
42993- break ;
43044+ if(!bCterminal) {
43045+ refnumLabelNoPostfix = undefined;
43046+ refnumLabel = undefined ;
4299443047 }
4299543048 else {
42996- currRefnum = strandArray[strandCnt].endRefnum + loopCnt;
42997- refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
42998- refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
43049+ // C-terminal
43050+ if(!ic.resid2refnum[residueid]) {
43051+ //break;
43052+
43053+ bCterminal = false;
43054+ //bNterminal = true; // The next will be N-terminal
43055+
43056+ refnumLabelNoPostfix = undefined;
43057+ refnumLabel = undefined;
43058+ }
43059+ else {
43060+ bCterminal = true;
43061+
43062+ currRefnum = strandArray[strandCnt].endRefnum + loopCnt;
43063+ refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
43064+ refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
43065+ }
4299943066 }
4300043067 }
4300143068 }
@@ -45000,7 +45067,11 @@ var icn3d = (function (exports) {
4500045067 let fontsize = '6px'; // '6';
4500145068 //let html = (bAfMap) ? "<g>" : "<g class='icn3d-node' resid='" + resid + "' >";
4500245069 let html = "<g class='icn3d-node' resid='" + resid + "' >";
45003- html += "<title>" + node.id + "</title>";
45070+ let title = node.id;
45071+ if(ic.resid2refnum[resid]) {
45072+ title += '=>' + ic.resid2refnum[resid];
45073+ }
45074+ html += "<title>" + title + "</title>";
4500445075 if(bVertical) {
4500545076 html += "<circle cx='" + y + "' cy='" + x + "' r='" + r + "' fill='" + color + "' stroke-width='" + strokewidth + "' stroke='" + strokecolor + "' resid='" + resid + "' />";
4500645077 html += "<text x='" +(y - 20).toString() + "' y='" +(x + 2).toString() + "' fill='" + textcolor + "' stroke='none' style='font-size:" + fontsize + "; text-anchor:middle' >" + nodeName + "</text>";
@@ -51180,7 +51251,7 @@ var icn3d = (function (exports) {
5118051251
5118151252 async realignOnStructAlign() { let ic = this.icn3d, me = ic.icn3dui;
5118251253 // each 3D domain should have at least 3 secondary structures
51183- let minSseCnt = 3 ;
51254+ let minSseCnt = (me.cfg.aligntool != 'tmalign') ? 3 : 0 ;
5118451255 let struct2domain = {};
5118551256 for(let struct in ic.structures) {
5118651257 struct2domain[struct] = {};
@@ -56268,11 +56339,13 @@ var icn3d = (function (exports) {
5626856339 }
5626956340 }
5627056341
56271- setSsbond() { let ic = this.icn3d; ic.icn3dui;
56342+ setSsbond(chainidHash ) { let ic = this.icn3d; ic.icn3dui;
5627256343 // get all Cys residues
5627356344 let structure2cys_resid = {};
5627456345
5627556346 for(let chainid in ic.chainsSeq) {
56347+ if(chainidHash && !chainidHash.hasOwnProperty(chainid)) continue;
56348+
5627656349 let seq = ic.chainsSeq[chainid];
5627756350 let structure = chainid.substr(0, chainid.indexOf('_'));
5627856351
@@ -71288,7 +71361,7 @@ var icn3d = (function (exports) {
7128871361 //even when multiple iCn3D viewers are shown together.
7128971362 this.pre = this.cfg.divid + "_";
7129071363
71291- this.REVISION = '3.25.0 ';
71364+ this.REVISION = '3.25.1 ';
7129271365
7129371366 // In nodejs, iCn3D defines "window = {navigator: {}}"
7129471367 this.bNode = (Object.keys(window).length < 2) ? true : false;
0 commit comments