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.module.js CHANGED
@@ -42823,10 +42823,10 @@ class ShowSeq {
42823
42823
  // sometimes one chain may have several Ig domains,set an index for each IgDomain
42824
42824
  let index = 1, bStart = false;
42825
42825
 
42826
- // get the range of each strand excluding loops
42827
- let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0;
42826
+ // 1. get the range of each strand excluding loops
42827
+ let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0, resCntBfAnchor = 0;
42828
42828
  if(!bCustom && !kabat_or_imgt) {
42829
- for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt) {
42829
+ for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt, ++resCntBfAnchor) {
42830
42830
  let currResi = ic.ParserUtilsCls.getResi(chnid, i);
42831
42831
  let residueid = chnid + '_' + currResi;
42832
42832
  refnumLabel = ic.resid2refnum[residueid];
@@ -42855,6 +42855,8 @@ class ShowSeq {
42855
42855
 
42856
42856
  if(currStrand && currStrand != ' ') {
42857
42857
  if(refnum3c.substr(0,1) != '9') {
42858
+ let lastTwo = parseInt(refnum.toString().substr(refnum.toString().length - 2, 2));
42859
+
42858
42860
  if(currStrand != prevStrand) { // reset currCnt
42859
42861
  if(strandHash[currStrand + postfix]) {
42860
42862
  ++index;
@@ -42866,10 +42868,17 @@ class ShowSeq {
42866
42868
  strandArray[strandCnt] = {};
42867
42869
  strandArray[strandCnt].startResi = currResi;
42868
42870
  strandArray[strandCnt].startRefnum = refnum; // 1250 in A1250a
42871
+
42872
+ resCntBfAnchor = 0;
42869
42873
 
42870
42874
  strandArray[strandCnt].endResi = currResi;
42871
42875
  strandArray[strandCnt].endRefnum = refnum; // 1250a
42872
42876
 
42877
+ if(lastTwo == 50) {
42878
+ strandArray[strandCnt].anchorRefnum = refnum;
42879
+ strandArray[strandCnt].resCntBfAnchor = resCntBfAnchor;
42880
+ }
42881
+
42873
42882
  strandArray[strandCnt].strandPostfix = strandPostfix; // a in A1250a
42874
42883
  strandArray[strandCnt].strand = currStrand; // A in A1250a
42875
42884
 
@@ -42885,6 +42894,11 @@ class ShowSeq {
42885
42894
  strandArray[strandCnt - 1].endResi = currResi;
42886
42895
  strandArray[strandCnt - 1].endRefnum = refnum; // 1250a
42887
42896
 
42897
+ if(lastTwo == 50) {
42898
+ strandArray[strandCnt - 1].anchorRefnum = refnum;
42899
+ strandArray[strandCnt - 1].resCntBfAnchor = resCntBfAnchor;
42900
+ }
42901
+
42888
42902
  resCnt = 0;
42889
42903
  }
42890
42904
  }
@@ -42895,13 +42909,22 @@ class ShowSeq {
42895
42909
  prevStrand = currStrand;
42896
42910
  }
42897
42911
 
42912
+ // 2. remove strands with less than 3 residues
42913
+ for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
42914
+ if(strandArray[i].endRefnum - strandArray[i].startRefnum < 3 - 1) { // remove the strand
42915
+ strandArray.splice(i, 1);
42916
+ }
42917
+ }
42918
+
42919
+ // 3. assign refnumLabel for each resid
42898
42920
  strandCnt = 0;
42899
42921
  let loopCnt = 0;
42900
42922
 
42901
42923
  let bNterminal = true, refnumLabelNoPostfix, prevStrandCnt = 0, currRefnum;
42902
42924
  bStart = false;
42925
+ let refnumInStrand = 0;
42903
42926
  if(strandArray.length > 0) {
42904
- for(let i = 0, il = giSeq.length; i < il; ++i, ++loopCnt) {
42927
+ for(let i = 0, il = giSeq.length; i < il; ++i, ++loopCnt, ++refnumInStrand) {
42905
42928
  let currResi = ic.ParserUtilsCls.getResi(chnid, i);
42906
42929
  let residueid = chnid + '_' + currResi;
42907
42930
  refnumLabel = ic.resid2refnum[residueid];
@@ -42973,6 +42996,19 @@ class ShowSeq {
42973
42996
  else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
42974
42997
  bNterminal = false;
42975
42998
 
42999
+ if(strandArray[strandCnt].anchorRefnum) { // use anchor to name refnum
43000
+ if(currResi == strandArray[strandCnt].startResi) {
43001
+ refnumInStrand = strandArray[strandCnt].anchorRefnum - strandArray[strandCnt].resCntBfAnchor;
43002
+ strandArray[strandCnt].startRefnum = refnumInStrand;
43003
+ }
43004
+ else if(currResi == strandArray[strandCnt].endResi) {
43005
+ strandArray[strandCnt].endRefnum = refnumInStrand;
43006
+ }
43007
+
43008
+ refnumLabelNoPostfix = strandArray[strandCnt].strand + refnumInStrand;
43009
+ refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
43010
+ }
43011
+
42976
43012
  if(currResi == strandArray[strandCnt].endResi) {
42977
43013
  ++strandCnt; // next strand
42978
43014
  loopCnt = 0;
@@ -44997,7 +45033,11 @@ class GetGraph {
44997
45033
  let fontsize = '6px'; // '6';
44998
45034
  //let html = (bAfMap) ? "<g>" : "<g class='icn3d-node' resid='" + resid + "' >";
44999
45035
  let html = "<g class='icn3d-node' resid='" + resid + "' >";
45000
- html += "<title>" + node.id + "</title>";
45036
+ let title = node.id;
45037
+ if(ic.resid2refnum[resid]) {
45038
+ title += '=>' + ic.resid2refnum[resid];
45039
+ }
45040
+ html += "<title>" + title + "</title>";
45001
45041
  if(bVertical) {
45002
45042
  html += "<circle cx='" + y + "' cy='" + x + "' r='" + r + "' fill='" + color + "' stroke-width='" + strokewidth + "' stroke='" + strokecolor + "' resid='" + resid + "' />";
45003
45043
  html += "<text x='" +(y - 20).toString() + "' y='" +(x + 2).toString() + "' fill='" + textcolor + "' stroke='none' style='font-size:" + fontsize + "; text-anchor:middle' >" + nodeName + "</text>";
@@ -51177,7 +51217,7 @@ class RealignParser {
51177
51217
 
51178
51218
  async realignOnStructAlign() { let ic = this.icn3d, me = ic.icn3dui;
51179
51219
  // each 3D domain should have at least 3 secondary structures
51180
- let minSseCnt = 3;
51220
+ let minSseCnt = (me.cfg.aligntool != 'tmalign') ? 3 : 0;
51181
51221
  let struct2domain = {};
51182
51222
  for(let struct in ic.structures) {
51183
51223
  struct2domain[struct] = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.25.3",
3
+ "version": "3.25.5",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {