icn3d 3.31.3 → 3.31.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
@@ -8902,7 +8902,7 @@ class ClickMenu {
8902
8902
  let resid = residueArray[i];
8903
8903
 
8904
8904
  if(ic.resid2refnum) delete ic.resid2refnum[resid];
8905
- if(ic.resid2refnum_ori) delete ic.resid2refnum_ori[resid];
8905
+ // if(ic.resid2refnum_ori) delete ic.resid2refnum_ori[resid];
8906
8906
  if(ic.resid2domainid) delete ic.resid2domainid[resid];
8907
8907
  }
8908
8908
 
@@ -41171,7 +41171,7 @@ class AnnoIg {
41171
41171
 
41172
41172
  let igType = (parseFloat(tmscore) < ic.refnumCls.TMThreshold ) ? 'Ig' : ic.ref2igtype[info.refpdbname];
41173
41173
  titleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + ')');
41174
- fullTitleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + '), template: ' + info.refpdbname + ', type: ' + ic.ref2igtype[info.refpdbname] + ' Seq. identity: ' + parseFloat(info.seqid).toFixed(2) + ', aligned residues: ' + info.nresAlign);
41174
+ fullTitleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + '), template: ' + info.refpdbname + ', type: ' + ic.ref2igtype[info.refpdbname] + ', Seq. identity: ' + parseFloat(info.seqid).toFixed(2) + ', aligned residues: ' + info.nresAlign);
41175
41175
 
41176
41176
  domainArray.push(igType);
41177
41177
 
@@ -42516,13 +42516,11 @@ class Domain3d {
42516
42516
  init3ddomain() { let ic = this.icn3d; ic.icn3dui;
42517
42517
  //this.dcut = 8; // threshold for C-alpha interactions
42518
42518
 
42519
- // It seemed the threshold 7 angstrom works better
42520
- //this.dcut = 7; // threshold for C-alpha interactions
42521
42519
  this.dcut = 8; // threshold for C-alpha interactions
42522
42520
 
42523
42521
  // added by Jiyao
42524
- // pdbid 1CD8 requires a min contact 4, not 5
42525
- this.min_contacts = 4; //5; //3; // minimum number of contacts to be considered as neighbors
42522
+ // Ig domain should not be separated into two parts, set min as 2
42523
+ this.min_contacts = 2; //3; // minimum number of contacts to be considered as neighbors
42526
42524
 
42527
42525
  this.MAX_SSE = 512;
42528
42526
 
@@ -46238,8 +46236,10 @@ class Annotation {
46238
46236
  }
46239
46237
  }
46240
46238
 
46239
+ ic.bRunRefnumAgain = true;
46241
46240
  for(let chainid in ic.protein_chainid) {
46242
46241
  await ic.annoIgCls.showIg(chainid, template);
46242
+ ic.bRunRefnumAgain = false; // run it once for all chains
46243
46243
  }
46244
46244
  // }
46245
46245
  // ic.bIgShown = true;
@@ -54627,7 +54627,7 @@ class MmdbParser {
54627
54627
  if(Object.keys(data.atoms).length == 0) { // for large structures such as 3J3Q
54628
54628
  // use mmtfid
54629
54629
  let pdbid = data.pdbId;
54630
- await ic.bciffParserCls.downloadBcif(pdbid);
54630
+ await ic.bcifParserCls.downloadBcif(pdbid);
54631
54631
 
54632
54632
  return;
54633
54633
  }
@@ -70547,6 +70547,7 @@ class Dssp {
70547
70547
  ic.domainid2pdb = {};
70548
70548
 
70549
70549
  let bNoMoreIg = true;
70550
+ let bFoundDomain = false;
70550
70551
  for(let i = 0, il = struArray.length; i < il; ++i) {
70551
70552
  let struct = struArray[i];
70552
70553
  let chainidArray = ic.structures[struct];
@@ -70560,6 +70561,12 @@ class Dssp {
70560
70561
  if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
70561
70562
  if(!ic.domainid2score) ic.domainid2score = {};
70562
70563
 
70564
+ if(domainAtomsArray.length == 0) {
70565
+ continue;
70566
+ }
70567
+
70568
+ bFoundDomain = true;
70569
+
70563
70570
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
70564
70571
  bNoMoreIg = false;
70565
70572
 
@@ -70573,6 +70580,10 @@ class Dssp {
70573
70580
  let resiSum = atomFirst.resi + ':' + atomLast.resi + ':' + Object.keys(domainAtomsArray[k]).length;
70574
70581
  //let domainid = chainid + '-' + k + '_' + Object.keys(domainAtomsArray[k]).length;
70575
70582
  let domainid = chainid + ',' + k + '_' + resiSum;
70583
+
70584
+ // clear score
70585
+ delete ic.domainid2score[domainid];
70586
+
70576
70587
  ic.domainid2pdb[domainid] = pdb_target;
70577
70588
 
70578
70589
  if(!template) {
@@ -70602,6 +70613,10 @@ class Dssp {
70602
70613
  }
70603
70614
  }
70604
70615
 
70616
+ if(!bFoundDomain) {
70617
+ return bNoMoreIg;
70618
+ }
70619
+
70605
70620
  //try {
70606
70621
  if(!template) {
70607
70622
  let dataArray2 = [];
@@ -70737,27 +70752,13 @@ class Dssp {
70737
70752
  // clear previous refnum assignment if any
70738
70753
  // delete ic.resid2refnum[resid];
70739
70754
  delete ic.residIgLoop[resid];
70755
+ delete ic.resid2domainid[resid];
70740
70756
  }
70741
70757
  }
70742
70758
 
70743
70759
  if(resCnt < minResidues) continue;
70744
70760
 
70745
70761
  domainAtomsArray.push(domainAtoms);
70746
- /*
70747
- let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(domainAtoms);
70748
- let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtoms);
70749
- let resiSum = atomFirst.resi + ':' + atomLast.resi + ':' + Object.keys(domainAtoms).length;
70750
-
70751
- for(let m = 0, ml = segArray.length; m < ml; m += 2) {
70752
- let startResi = segArray[m];
70753
- let endResi = segArray[m+1];
70754
- for(let n = parseInt(startResi); n <= parseInt(endResi); ++n) {
70755
- let resid = chainid + '_' + pos2resi[n - 1];
70756
- //domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
70757
- ic.resid2domainid[resid] = chainid + ',' + k + '_' + resiSum;
70758
- }
70759
- }
70760
- */
70761
70762
  }
70762
70763
  }
70763
70764
 
@@ -70797,6 +70798,7 @@ class Dssp {
70797
70798
  if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
70798
70799
 
70799
70800
  let minResidues = 20;
70801
+
70800
70802
  for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
70801
70803
  //let queryData = (me.bNode) ? dataArray[i] : dataArray[i].value; //[0];
70802
70804
  let queryData = (dataArray[i]) ? dataArray[i].value : undefined; //[0];
@@ -70816,15 +70818,12 @@ class Dssp {
70816
70818
 
70817
70819
  if(!bRound1) {
70818
70820
  if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) {
70819
- if(!me.bNode) console.log("domainid " + domainid + " and refpdbname " + refpdbname + " were skipped due to a TM-score less than " + tmscoreThreshold);
70821
+ if(!me.bNode) console.log("bRound1: " + bRound1 + ": domainid " + domainid + " and refpdbname " + refpdbname + " were skipped due to a TM-score less than " + tmscoreThreshold);
70820
70822
  continue;
70821
70823
  }
70822
70824
  }
70823
70825
  else {
70824
- // if(queryData[0].super_rmsd > rmsdThreshold || queryData[0].num_res < minResidues) {
70825
- // continue;
70826
- // }
70827
- if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) {
70826
+ if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues / 2) {
70828
70827
  continue;
70829
70828
  }
70830
70829
  }
@@ -70894,7 +70893,7 @@ class Dssp {
70894
70893
  delete ic.domainid2refpdbname[domainid];
70895
70894
  delete ic.domainid2score[domainid];
70896
70895
  }
70897
- // continue;
70896
+ continue;
70898
70897
  }
70899
70898
  // }
70900
70899
 
@@ -70973,6 +70972,7 @@ class Dssp {
70973
70972
  let domainid2segs = this.parseAlignData_part1(dataArray, domainidpairArray, bRound1);
70974
70973
 
70975
70974
  // no more Igs to detect
70975
+ // no need to rerun the rest residues any more
70976
70976
  if(Object.keys(domainid2segs).length == 0) {
70977
70977
  bNoMoreIg = true;
70978
70978
  return bNoMoreIg;
@@ -71044,7 +71044,7 @@ class Dssp {
71044
71044
 
71045
71045
  dataArray3 = await this.promiseWithFixedJobs(ajaxArray);
71046
71046
 
71047
- await this.parseAlignData(dataArray3, domainidpairArray3, false);
71047
+ bNoMoreIg = await this.parseAlignData(dataArray3, domainidpairArray3, false);
71048
71048
 
71049
71049
  // end of round 2
71050
71050
  return bNoMoreIg;
@@ -71094,7 +71094,7 @@ class Dssp {
71094
71094
 
71095
71095
  // assign ic.resid2refnum, ic.refnum2residArray, ic.chainsMapping
71096
71096
  if(!ic.resid2refnum) ic.resid2refnum = {};
71097
- if(!ic.resid2refnum_ori) ic.resid2refnum_ori = {};
71097
+ // if(!ic.resid2refnum_ori) ic.resid2refnum_ori = {};
71098
71098
  if(!ic.refnum2residArray) ic.refnum2residArray = {};
71099
71099
  if(!ic.chainsMapping) ic.chainsMapping = {};
71100
71100
 
@@ -71115,10 +71115,12 @@ class Dssp {
71115
71115
 
71116
71116
  if(refpdbname) {
71117
71117
  let message = "The reference PDB for domain " + domainid + " is " + refpdbname + ". The TM-score is " + score + ". The sequence identity is " + seqid + ". The number of aligned residues is " + nresAlign + ".";
71118
+
71118
71119
  if(!me.bNode) {
71119
71120
  console.log(message);
71120
71121
  me.htmlCls.clickMenuCls.setLogCmd(message, false, true);
71121
71122
  }
71123
+
71122
71124
  // ic.refPdbList.push(message);
71123
71125
  ic.domainid2info[domainid] = {'refpdbname': refpdbname, 'score': score, 'seqid': seqid, 'nresAlign': nresAlign};
71124
71126
  }
@@ -71265,7 +71267,7 @@ class Dssp {
71265
71267
  // only sheet or loop will be aligned
71266
71268
  if(atom.ss != 'helix') {
71267
71269
  ic.resid2refnum[resid] = refnumLabel;
71268
- ic.resid2refnum_ori[resid] = refnumLabel;
71270
+ // ic.resid2refnum_ori[resid] = refnumLabel;
71269
71271
  ic.resid2domainid[resid] = domainid;
71270
71272
  }
71271
71273
  //}
@@ -71322,7 +71324,7 @@ class Dssp {
71322
71324
  // loops may have numbers such as 1310, 1410
71323
71325
 
71324
71326
  let strand;
71325
-
71327
+ /*
71326
71328
  if(refnum < 1000) strand = undefined;
71327
71329
  else if(refnum >= 1200 && refnum < 1290) strand = "A---";
71328
71330
  else if(refnum >= 1320 && refnum < 1390) strand = "A--";
@@ -71345,6 +71347,34 @@ class Dssp {
71345
71347
  else if(refnum >= 9720 && refnum < 9790) strand = "G++";
71346
71348
  else if(refnum > 9900) strand = undefined;
71347
71349
  else strand = " ";
71350
+ */
71351
+
71352
+ // cover all ranges
71353
+ if(refnum < 1000) strand = undefined;
71354
+ else if(refnum >= 1200 && refnum < 1320) strand = "A---";
71355
+ else if(refnum >= 1320 && refnum < 1420) strand = "A--";
71356
+ else if(refnum >= 1420 && refnum < 1520) strand = "A-";
71357
+ else if(refnum >= 1520 && refnum < 1620) strand = "A";
71358
+ else if(refnum >= 1620 && refnum < 1720) strand = "A+";
71359
+ else if(refnum >= 1720 && refnum < 1820) strand = "A++";
71360
+ else if(refnum >= 1820 && refnum < 2000) strand = "A'";
71361
+ else if(refnum >= 2000 && refnum < 3000) strand = "B";
71362
+ else if(refnum >= 3000 && refnum < 3420) strand = "C--";
71363
+ else if(refnum >= 3420 && refnum < 3520) strand = "C-";
71364
+ else if(refnum >= 3520 && refnum < 4000) strand = "C";
71365
+ else if(refnum >= 4000 && refnum < 5000) strand = "C'";
71366
+ else if(refnum >= 5000 && refnum < 6000) strand = "C''";
71367
+ else if(refnum >= 6000 && refnum < 7000) strand = "D";
71368
+ else if(refnum >= 7000 && refnum < 7620) strand = "E";
71369
+ else if(refnum >= 7620 && refnum < 8000) strand = "E+";
71370
+ else if(refnum >= 8000 && refnum < 9000) strand = "F";
71371
+ else if(refnum >= 9000 && refnum < 9620) strand = "G";
71372
+ else if(refnum >= 9620 && refnum < 9720) strand = "G+";
71373
+ else if(refnum >= 9720 && refnum < 9820) strand = "G++";
71374
+ else if(refnum >= 9820 && refnum < 9900) strand = "G+++";
71375
+ else if(refnum > 9900) strand = undefined;
71376
+ else strand = " ";
71377
+
71348
71378
  if(prevStrand) strand = prevStrand;
71349
71379
 
71350
71380
  return strand
@@ -71666,7 +71696,7 @@ class Dssp {
71666
71696
  refnum3c = (refnum - parseInt(refnum/1000) * 1000).toString();
71667
71697
  refnum2c = (refnum - parseInt(refnum/100) * 100).toString();
71668
71698
 
71669
- // for extended strands, since A is 1550 and A+ is 1650, then the AA+ loop will be 1591, 1592, ... 1610, 1611, etc
71699
+ // for extended strands, since A is 1550 and A+ is 1650, then the AA+ loop will be 1591, 1592, ... 1618, 1619, etc
71670
71700
  bSecThird9 = refnum3c.substr(0,1) == '9' || refnum2c.substr(0,1) == '9' || refnum2c.substr(0,1) == '0' || refnum2c.substr(0,1) == '1';
71671
71701
  if(bSecThird9) ic.residIgLoop[residueid] = 1;
71672
71702
 
@@ -71812,6 +71842,7 @@ class Dssp {
71812
71842
  let domainid = ic.resid2domainid[currResid];
71813
71843
  if(currAtom.ssbegin) { // find the start of the sheet
71814
71844
  // update the following: startResi,startRefnum,endResi,endRefnum,loopResCnt,resCntBfAnchor,resCntAtAnchor
71845
+ let oriStartRefnum = strandArray[i].startRefnum;
71815
71846
  strandArray[i].startResi = currResi;
71816
71847
  strandArray[i].startRefnum -= j;
71817
71848
  strandArray[i].loopResCnt -= j;
@@ -71824,8 +71855,10 @@ class Dssp {
71824
71855
  currResi = ic.ParserUtilsCls.getResi(chnid, currPos);
71825
71856
  let currResid = chnid + '_' + currResi;
71826
71857
  delete ic.residIgLoop[currResid];
71858
+ ic.resid2refnum[currResid] = strandArray[i].strand + (oriStartRefnum - k).toString();
71859
+
71827
71860
  ic.resid2domainid[currResid] = domainid;
71828
- ic.resid2refnum_ori[currResid] = 1; // a hash to check which residues were assigned
71861
+ // ic.resid2refnum_ori[currResid] = 1; // a hash to check which residues were assigned
71829
71862
  }
71830
71863
 
71831
71864
  break;
@@ -71844,6 +71877,7 @@ class Dssp {
71844
71877
  let domainid = ic.resid2domainid[currResid];
71845
71878
  if(currAtom.ssend) { // find the end of the sheet
71846
71879
  // update the following: startResi,startRefnum,endResi,endRefnum,loopResCnt,resCntBfAnchor,resCntAtAnchor
71880
+ let oriEndRefnum = strandArray[i].endRefnum;
71847
71881
  strandArray[i].endResi = currResi;
71848
71882
  strandArray[i].endRefnum += j;
71849
71883
  if(i < il - 1) {
@@ -71858,8 +71892,10 @@ class Dssp {
71858
71892
  currResi = ic.ParserUtilsCls.getResi(chnid, currPos);
71859
71893
  let currResid = chnid + '_' + currResi;
71860
71894
  delete ic.residIgLoop[currResid];
71895
+ ic.resid2refnum[currResid] = strandArray[i].strand + (oriEndRefnum + k).toString();
71896
+
71861
71897
  ic.resid2domainid[currResid] = domainid;
71862
- ic.resid2refnum_ori[currResid] = 1; // a hash to check which residues were assigned
71898
+ // ic.resid2refnum_ori[currResid] = 1; // a hash to check which residues were assigned
71863
71899
  }
71864
71900
 
71865
71901
  break;
@@ -71890,7 +71926,7 @@ class Dssp {
71890
71926
  let domainid = ic.resid2domainid[resid];
71891
71927
  removeDomainidHash[domainid] = 1;
71892
71928
  continue;
71893
- }
71929
+ }
71894
71930
  }
71895
71931
  }
71896
71932
 
@@ -72083,6 +72119,7 @@ class Dssp {
72083
72119
  // remove domians without B,C,E,F strands
72084
72120
  if(removeDomainidHash.hasOwnProperty(domainid)) {
72085
72121
  delete ic.resid2refnum[residueid];
72122
+ delete ic.residIgLoop[residueid];
72086
72123
  delete ic.resid2domainid[residueid];
72087
72124
 
72088
72125
  continue;