icn3d 3.25.3 → 3.25.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/icn3d.js CHANGED
@@ -41922,10 +41922,10 @@ class ShowSeq {
41922
41922
  // sometimes one chain may have several Ig domains,set an index for each IgDomain
41923
41923
  let index = 1, bStart = false;
41924
41924
 
41925
- // get the range of each strand excluding loops
41926
- let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0;
41925
+ // 1. get the range of each strand excluding loops
41926
+ let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0, resCntBfAnchor = 0;
41927
41927
  if(!bCustom && !kabat_or_imgt) {
41928
- for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt) {
41928
+ for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt, ++resCntBfAnchor) {
41929
41929
  let currResi = ic.ParserUtilsCls.getResi(chnid, i);
41930
41930
  let residueid = chnid + '_' + currResi;
41931
41931
  refnumLabel = ic.resid2refnum[residueid];
@@ -41954,6 +41954,8 @@ class ShowSeq {
41954
41954
 
41955
41955
  if(currStrand && currStrand != ' ') {
41956
41956
  if(refnum3c.substr(0,1) != '9') {
41957
+ let lastTwo = parseInt(refnum.toString().substr(refnum.toString().length - 2, 2));
41958
+
41957
41959
  if(currStrand != prevStrand) { // reset currCnt
41958
41960
  if(strandHash[currStrand + postfix]) {
41959
41961
  ++index;
@@ -41965,10 +41967,17 @@ class ShowSeq {
41965
41967
  strandArray[strandCnt] = {};
41966
41968
  strandArray[strandCnt].startResi = currResi;
41967
41969
  strandArray[strandCnt].startRefnum = refnum; // 1250 in A1250a
41970
+
41971
+ resCntBfAnchor = 0;
41968
41972
 
41969
41973
  strandArray[strandCnt].endResi = currResi;
41970
41974
  strandArray[strandCnt].endRefnum = refnum; // 1250a
41971
41975
 
41976
+ if(lastTwo == 50) {
41977
+ strandArray[strandCnt].anchorRefnum = refnum;
41978
+ strandArray[strandCnt].resCntBfAnchor = resCntBfAnchor;
41979
+ }
41980
+
41972
41981
  strandArray[strandCnt].strandPostfix = strandPostfix; // a in A1250a
41973
41982
  strandArray[strandCnt].strand = currStrand; // A in A1250a
41974
41983
 
@@ -41984,6 +41993,11 @@ class ShowSeq {
41984
41993
  strandArray[strandCnt - 1].endResi = currResi;
41985
41994
  strandArray[strandCnt - 1].endRefnum = refnum; // 1250a
41986
41995
 
41996
+ if(lastTwo == 50) {
41997
+ strandArray[strandCnt - 1].anchorRefnum = refnum;
41998
+ strandArray[strandCnt - 1].resCntBfAnchor = resCntBfAnchor;
41999
+ }
42000
+
41987
42001
  resCnt = 0;
41988
42002
  }
41989
42003
  }
@@ -41994,13 +42008,22 @@ class ShowSeq {
41994
42008
  prevStrand = currStrand;
41995
42009
  }
41996
42010
 
42011
+ // 2. remove strands with less than 3 residues
42012
+ for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
42013
+ if(strandArray[i].endRefnum - strandArray[i].startRefnum < 3 - 1) { // remove the strand
42014
+ strandArray.splice(i, 1);
42015
+ }
42016
+ }
42017
+
42018
+ // 3. assign refnumLabel for each resid
41997
42019
  strandCnt = 0;
41998
42020
  let loopCnt = 0;
41999
42021
 
42000
42022
  let bNterminal = true, refnumLabelNoPostfix, prevStrandCnt = 0, currRefnum;
42001
42023
  bStart = false;
42024
+ let refnumInStrand = 0;
42002
42025
  if(strandArray.length > 0) {
42003
- for(let i = 0, il = giSeq.length; i < il; ++i, ++loopCnt) {
42026
+ for(let i = 0, il = giSeq.length; i < il; ++i, ++loopCnt, ++refnumInStrand) {
42004
42027
  let currResi = ic.ParserUtilsCls.getResi(chnid, i);
42005
42028
  let residueid = chnid + '_' + currResi;
42006
42029
  refnumLabel = ic.resid2refnum[residueid];
@@ -42072,6 +42095,19 @@ class ShowSeq {
42072
42095
  else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
42073
42096
  bNterminal = false;
42074
42097
 
42098
+ if(strandArray[strandCnt].anchorRefnum) { // use anchor to name refnum
42099
+ if(currResi == strandArray[strandCnt].startResi) {
42100
+ refnumInStrand = strandArray[strandCnt].anchorRefnum - strandArray[strandCnt].resCntBfAnchor;
42101
+ strandArray[strandCnt].startRefnum = refnumInStrand;
42102
+ }
42103
+ else if(currResi == strandArray[strandCnt].endResi) {
42104
+ strandArray[strandCnt].endRefnum = refnumInStrand;
42105
+ }
42106
+
42107
+ refnumLabelNoPostfix = strandArray[strandCnt].strand + refnumInStrand;
42108
+ refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
42109
+ }
42110
+
42075
42111
  if(currResi == strandArray[strandCnt].endResi) {
42076
42112
  ++strandCnt; // next strand
42077
42113
  loopCnt = 0;
@@ -44096,7 +44132,11 @@ class GetGraph {
44096
44132
  let fontsize = '6px'; // '6';
44097
44133
  //let html = (bAfMap) ? "<g>" : "<g class='icn3d-node' resid='" + resid + "' >";
44098
44134
  let html = "<g class='icn3d-node' resid='" + resid + "' >";
44099
- html += "<title>" + node.id + "</title>";
44135
+ let title = node.id;
44136
+ if(ic.resid2refnum[resid]) {
44137
+ title += '=>' + ic.resid2refnum[resid];
44138
+ }
44139
+ html += "<title>" + title + "</title>";
44100
44140
  if(bVertical) {
44101
44141
  html += "<circle cx='" + y + "' cy='" + x + "' r='" + r + "' fill='" + color + "' stroke-width='" + strokewidth + "' stroke='" + strokecolor + "' resid='" + resid + "' />";
44102
44142
  html += "<text x='" +(y - 20).toString() + "' y='" +(x + 2).toString() + "' fill='" + textcolor + "' stroke='none' style='font-size:" + fontsize + "; text-anchor:middle' >" + nodeName + "</text>";
@@ -50276,7 +50316,7 @@ class RealignParser {
50276
50316
 
50277
50317
  async realignOnStructAlign() { let ic = this.icn3d, me = ic.icn3dui;
50278
50318
  // each 3D domain should have at least 3 secondary structures
50279
- let minSseCnt = 3;
50319
+ let minSseCnt = (me.cfg.aligntool != 'tmalign') ? 3 : 0;
50280
50320
  let struct2domain = {};
50281
50321
  for(let struct in ic.structures) {
50282
50322
  struct2domain[struct] = {};