icn3d 3.25.8 → 3.25.9

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
@@ -42024,18 +42024,18 @@ class ShowSeq {
42024
42024
  for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
42025
42025
  if(strandArray[i].endRefnum - strandArray[i].startRefnum + 1 < 3) { // remove the strand
42026
42026
  if(i != il - 1) { // modify
42027
- strandArray[i + 1].loopResCnt += strandArray[i].endRefnum - strandArray[i].startRefnum + 1;
42027
+ strandArray[i + 1].loopResCnt += strandArray[i].loopResCnt + strandArray[i].endRefnum - strandArray[i].startRefnum + 1;
42028
42028
  }
42029
42029
 
42030
42030
  strandArray.splice(i, 1);
42031
42031
  }
42032
42032
  }
42033
-
42033
+
42034
42034
  // 3. assign refnumLabel for each resid
42035
42035
  strandCnt = 0;
42036
42036
  let loopCnt = 0;
42037
42037
 
42038
- let bNterminal = true, bCterminal = true, refnumLabelNoPostfix, prevStrandCnt = 0, currRefnum;
42038
+ let bBeforeAstrand = true, bAfterGstrand = true, refnumLabelNoPostfix, prevStrandCnt = 0, currRefnum;
42039
42039
  bStart = false;
42040
42040
  let refnumInStrand = 0;
42041
42041
  if(strandArray.length > 0) {
@@ -42054,7 +42054,7 @@ class ShowSeq {
42054
42054
  let firstChar = refnumLabel.substr(0,1);
42055
42055
  if(!bStart && (firstChar == ' ' || firstChar == 'A' || firstChar == 'B')) { // start of a new IG domain
42056
42056
  bStart = true;
42057
- bNterminal = true;
42057
+ bBeforeAstrand = true;
42058
42058
  loopCnt = 0;
42059
42059
  }
42060
42060
  }
@@ -42069,29 +42069,48 @@ class ShowSeq {
42069
42069
  if(parseInt(currResi) < parseInt(strandArray[strandCnt].startResi)) {
42070
42070
  ic.residIgLoop[residueid] = 1;
42071
42071
 
42072
- if(bNterminal) { // make it continuous to the 1st strand
42072
+ if(bBeforeAstrand) { // make it continuous to the 1st strand
42073
42073
  if(bStart) {
42074
42074
  currRefnum = strandArray[strandCnt].startRefnum - strandArray[strandCnt].loopResCnt + loopCnt;
42075
42075
  refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
42076
42076
  refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
42077
- }
42077
+ }
42078
+ else {
42079
+ //loopCnt = 0;
42080
+ refnumLabelNoPostfix = undefined;
42081
+ refnumLabel = undefined;
42082
+ }
42078
42083
  }
42079
42084
  else {
42080
- //currStrand = strandArray[prevStrandCnt].strand;
42081
-
42082
42085
  if(prevStrandCnt >= 0 && strandArray[prevStrandCnt].strand.substr(0, 1) == 'G') {
42083
- if(bStart && ic.resid2refnum[residueid]) {
42084
- currRefnum = strandArray[prevStrandCnt].endRefnum + loopCnt;
42085
- refnumLabelNoPostfix = strandArray[prevStrandCnt].strand + currRefnum;
42086
- refnumLabel = refnumLabelNoPostfix + strandArray[prevStrandCnt].strandPostfix;
42086
+ if(!bAfterGstrand) {
42087
+ //loopCnt = 0;
42088
+ refnumLabelNoPostfix = undefined;
42089
+ refnumLabel = undefined;
42087
42090
  }
42088
42091
  else {
42089
- bStart = false;
42090
- bNterminal = true;
42091
- loopCnt = 0;
42092
+ if(bStart && ic.resid2refnum[residueid]) {
42093
+ bAfterGstrand = true;
42094
+
42095
+ currRefnum = strandArray[prevStrandCnt].endRefnum + loopCnt;
42096
+ refnumLabelNoPostfix = strandArray[prevStrandCnt].strand + currRefnum;
42097
+ refnumLabel = refnumLabelNoPostfix + strandArray[prevStrandCnt].strandPostfix;
42098
+ }
42099
+ else {
42100
+ bStart = false;
42101
+ bBeforeAstrand = true;
42102
+ //loopCnt = 0;
42103
+
42104
+ bAfterGstrand = false;
42105
+
42106
+ refnumLabelNoPostfix = undefined;
42107
+ refnumLabel = undefined;
42108
+ }
42092
42109
  }
42093
42110
  }
42094
42111
  else {
42112
+ bAfterGstrand = true; // reset
42113
+
42095
42114
  let len = strandArray[strandCnt].loopResCnt;
42096
42115
  let halfLen = parseInt(len / 2.0 + 0.5);
42097
42116
 
@@ -42109,8 +42128,7 @@ class ShowSeq {
42109
42128
  }
42110
42129
  }
42111
42130
  else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
42112
- bNterminal = false;
42113
- //bCterminal = true; // The next will be C-terminal
42131
+ bBeforeAstrand = false;
42114
42132
 
42115
42133
  if(strandArray[strandCnt].anchorRefnum) { // use anchor to name refnum
42116
42134
  if(currResi == strandArray[strandCnt].startResi) {
@@ -42137,23 +42155,20 @@ class ShowSeq {
42137
42155
  else if(parseInt(currResi) > parseInt(strandArray[strandCnt].endResi)) {
42138
42156
  ic.residIgLoop[residueid] = 1;
42139
42157
 
42140
- if(!bCterminal) {
42158
+ if(!bAfterGstrand) {
42141
42159
  refnumLabelNoPostfix = undefined;
42142
42160
  refnumLabel = undefined;
42143
42161
  }
42144
42162
  else {
42145
42163
  // C-terminal
42146
42164
  if(!ic.resid2refnum[residueid]) {
42147
- //break;
42148
-
42149
- bCterminal = false;
42150
- //bNterminal = true; // The next will be N-terminal
42165
+ bAfterGstrand = false;
42151
42166
 
42152
42167
  refnumLabelNoPostfix = undefined;
42153
42168
  refnumLabel = undefined;
42154
42169
  }
42155
42170
  else {
42156
- bCterminal = true;
42171
+ bAfterGstrand = true;
42157
42172
 
42158
42173
  currRefnum = strandArray[strandCnt].endRefnum + loopCnt;
42159
42174
  refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
@@ -42289,7 +42304,8 @@ class ShowSeq {
42289
42304
  let color = this.getRefnumColor(currStrand, true);
42290
42305
  let colorStr = (!bLoop) ? 'style="color:' + color + '; text-decoration: underline overline;"' : 'style="color:' + color + '"';
42291
42306
 
42292
- let lastTwo = parseInt(refnum.substr(refnum.length - 2, 2));
42307
+ let lastTwoStr = refnum.substr(refnum.length - 2, 2);
42308
+ let lastTwo = parseInt(lastTwoStr);
42293
42309
  parseInt(refnum.substr(refnum.length - 3, 3));
42294
42310
 
42295
42311
  let html = '';
@@ -42302,7 +42318,7 @@ class ShowSeq {
42302
42318
  }
42303
42319
  else if(refnumLabel && lastTwo % 2 == 0 && lastTwo != 52 && !bHidelabel) { // don't show label for the first, middle, and last loop residues
42304
42320
  // e.g., 2152a
42305
- let lastTwoStr = isNaN(refnumStr) ? lastTwo + refnumStr.substr(refnumStr.length - 1, 1) : lastTwo;
42321
+ lastTwoStr = isNaN(refnumStr) ? lastTwoStr + refnumStr.substr(refnumStr.length - 1, 1) : lastTwoStr;
42306
42322
  html += '<span ' + colorStr + ' title="' + refnumLabel + '">' + lastTwoStr + '</span>';
42307
42323
  }
42308
42324
  else {