icn3d 3.31.5 → 3.31.6

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
@@ -37080,7 +37080,7 @@ class Alternate {
37080
37080
 
37081
37081
  ic.drawCls.draw();
37082
37082
 
37083
- ic.bShowHighlight = true;
37083
+ ic.bShowHighlight = true; //reset
37084
37084
  }
37085
37085
 
37086
37086
  async alternateWrapper() { let ic = this.icn3d; ic.icn3dui;
@@ -42070,7 +42070,7 @@ class AnnoIg {
42070
42070
 
42071
42071
  let tmscore = info.score;
42072
42072
 
42073
- let igType = (parseFloat(tmscore) < ic.refnumCls.TMThreshold ) ? 'Ig' : ic.ref2igtype[info.refpdbname];
42073
+ let igType = (parseFloat(tmscore) < ic.refnumCls.TMThresholdIgType ) ? 'Ig' : ic.ref2igtype[info.refpdbname];
42074
42074
  titleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + ')');
42075
42075
  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);
42076
42076
 
@@ -47119,36 +47119,32 @@ class Annotation {
47119
47119
  }
47120
47120
 
47121
47121
  async updateIg(bSelection, template) { let ic = this.icn3d, me = ic.icn3dui;
47122
- if(bSelection) { // clear previous refnum
47123
- let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.hAtoms);
47124
- for(let resid in residueHash) {
47125
- if(ic.resid2refnum) delete ic.resid2refnum[resid];
47126
- if(ic.residIgLoop) delete ic.residIgLoop[resid];
47127
- if(ic.resid2domainid) delete ic.resid2domainid[resid];
47122
+ ic.opts['color'] = 'ig strand';
47123
+
47124
+ // if(!bSelection && !template) {
47125
+ if(!bSelection) {
47126
+ // select all protein chains
47127
+ ic.hAtoms = {};
47128
+ for(let chainid in ic.protein_chainid) {
47129
+ ic.hAtoms = me.hashUtilsCls.unionHash(ic.hAtoms, ic.chains[chainid]);
47128
47130
  }
47129
47131
  }
47130
47132
 
47131
- // if(!ic.bIgShown) {
47132
- if(!bSelection && !template) {
47133
- // select all protein chains
47134
- ic.hAtoms = {};
47135
- for(let chainid in ic.protein_chainid) {
47136
- ic.hAtoms = me.hashUtilsCls.unionHash(ic.hAtoms, ic.chains[chainid]);
47137
- }
47138
- }
47133
+ // clear previous refnum
47134
+ let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.hAtoms);
47135
+ for(let resid in residueHash) {
47136
+ if(ic.resid2refnum) delete ic.resid2refnum[resid];
47137
+ if(ic.residIgLoop) delete ic.residIgLoop[resid];
47138
+ if(ic.resid2domainid) delete ic.resid2domainid[resid];
47139
+ }
47139
47140
 
47140
- ic.bRunRefnumAgain = true;
47141
- for(let chainid in ic.protein_chainid) {
47142
- await ic.annoIgCls.showIg(chainid, template);
47143
- ic.bRunRefnumAgain = false; // run it once for all chains
47144
- }
47145
- // }
47146
- // ic.bIgShown = true;
47141
+ ic.bRunRefnumAgain = true;
47142
+ for(let chainid in ic.protein_chainid) {
47143
+ await ic.annoIgCls.showIg(chainid, template);
47144
+ ic.bRunRefnumAgain = false; // run it once for all chains
47145
+ }
47147
47146
 
47148
47147
  if(ic.bShowRefnum) {
47149
- // ic.opts.color = 'ig strand';
47150
- // ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
47151
-
47152
47148
  ic.hlUpdateCls.updateHlAll();
47153
47149
  ic.drawCls.draw();
47154
47150
  }
@@ -48883,10 +48879,14 @@ class HlSeq {
48883
48879
  }
48884
48880
  */
48885
48881
 
48886
- if(($(that).attr('domain') !== undefined || $(that).attr('feat') !== undefined) || $(that).attr('3ddomain') !== undefined || $(that).attr('ig') !== undefined) {
48882
+ if(($(that).attr('domain') !== undefined || $(that).attr('feat') !== undefined) || $(that).attr('ig') !== undefined) {
48887
48883
  let residNCBI = chainid + '_' + (j+1).toString();
48888
48884
  residueid = ic.ncbi2resid[residNCBI];
48889
48885
  }
48886
+ else if($(that).attr('3ddomain') !== undefined) {
48887
+ // the position of residues with coordinates
48888
+ residueid = ic.posid2resid[chainid + '_' + (j+1).toString()];
48889
+ }
48890
48890
  else {
48891
48891
  residueid = chainid + '_' + (j+1).toString();
48892
48892
  }
@@ -50862,7 +50862,7 @@ class ShowInter {
50862
50862
  }
50863
50863
  }
50864
50864
 
50865
- ic.bShowHighlight = false;
50865
+ //!!!ic.bShowHighlight = false;
50866
50866
  }
50867
50867
 
50868
50868
  hideHydrogens() { let ic = this.icn3d; ic.icn3dui;
@@ -52442,8 +52442,10 @@ class ContactMap {
52442
52442
  // json format: [{"residue1": [1, ..., 1, ..., n, ..., n], "residue2": [1, 2, ..., n, ..., 1, 2, ..., n],
52443
52443
  // "distance": [n*n matrix],"max_predicted_aligned_error":31.75}]
52444
52444
  //let distMatrix = dataJson[0].distance; // version 2, one dimension
52445
- let distMatrix = dataJson[0].predicted_aligned_error; // version 3, two dimensions
52446
- let max = dataJson[0].max_predicted_aligned_error;
52445
+ let data = (dataJson[0]) ? dataJson[0] : dataJson; // dataJson[0] is from AlphaFold UniProt database
52446
+ let distMatrix = data.predicted_aligned_error || data.pae; // version 3, two dimensions
52447
+ let max = data.max_predicted_aligned_error || data.max_pae; // max_predicted_aligned_error is from AlphaFold UniProt database
52448
+
52447
52449
  if(!distMatrix || !max) {
52448
52450
  alert("The PAE file didn't have the right format...");
52449
52451
  return;
@@ -53844,7 +53846,7 @@ class ChainalignParser {
53844
53846
  ic.init();
53845
53847
  }
53846
53848
  else {
53847
- ic.resetConfig();
53849
+ //ic.resetConfig();
53848
53850
 
53849
53851
  ic.bResetAnno = true;
53850
53852
  ic.bResetSets = true;
@@ -53940,7 +53942,9 @@ class ChainalignParser {
53940
53942
  let hAtoms = {}, hAtomsTmp = {};
53941
53943
  let bLastQuery = false;
53942
53944
 
53943
- ic.opts['color'] = (ic.structArray.length > 1) ? 'structure' : ((structArray[0].length > 5) ? 'confidence' : 'chain');
53945
+ let opts = {};
53946
+
53947
+ opts['color'] = (structArray.length > 1) ? 'structure' : ((structArray[0].length > 5) ? 'confidence' : 'chain');
53944
53948
 
53945
53949
  for(let i = 0, il = structArray.length; i < il; ++i) {
53946
53950
  if(i == structArray.length - 1) bLastQuery = true;
@@ -53972,11 +53976,22 @@ class ChainalignParser {
53972
53976
  hAtoms = me.hashUtilsCls.unionHash(hAtoms, hAtomsTmp);
53973
53977
  }
53974
53978
 
53975
- // parseMmdbData() didn't render structures for mmdbafid input
53976
- if(ic.structArray.length > 1) ic.opts['color'] = 'structure';
53977
- ic.setColorCls.setColorByOptions(ic.opts, ic.atoms);
53979
+ // add color only for the newly loaded structures
53980
+ ic.setColorCls.setColorByOptions(opts, hAtoms);
53978
53981
 
53979
- await ic.ParserUtilsCls.renderStructure();
53982
+ if(ic.bAnnoShown) {
53983
+ await ic.showAnnoCls.showAnnotations();
53984
+ ic.annotationCls.resetAnnoTabAll();
53985
+ }
53986
+
53987
+ // await ic.ParserUtilsCls.renderStructure();
53988
+ // ic.drawCls.draw();
53989
+
53990
+ // if(ic.bAnnoShown) {
53991
+ // await ic.showAnnoCls.showAnnotations();
53992
+ // ic.annotationCls.resetAnnoTabAll();
53993
+ // }
53994
+
53980
53995
  if(me.cfg.rotate !== undefined) ic.resizeCanvasCls.rotStruc(me.cfg.rotate, true);
53981
53996
 
53982
53997
  if(bQuery && me.cfg.matchedchains) {
@@ -65629,7 +65644,7 @@ class ApplyCommand {
65629
65644
  else if(command == 'clear selection') {
65630
65645
  ic.hlObjectsCls.removeHlObjects();
65631
65646
  ic.hlUpdateCls.removeHl2D();
65632
- ic.bShowHighlight = false;
65647
+ // !!!ic.bShowHighlight = false;
65633
65648
 
65634
65649
  ic.bSelectResidue = false;
65635
65650
  }
@@ -67786,6 +67801,8 @@ class SelectCollections {
67786
67801
  true
67787
67802
  );
67788
67803
  ic.bSelectResidue = false;
67804
+
67805
+ ic.bShowHighlight = true; // reset
67789
67806
  }
67790
67807
  });
67791
67808
 
@@ -71214,7 +71231,8 @@ class Dssp {
71214
71231
  class Refnum {
71215
71232
  constructor(icn3d) {
71216
71233
  this.icn3d = icn3d;
71217
- this.TMThreshold = 0.85;
71234
+ this.TMThresholdIgType = 0.85;
71235
+ this.TMThresholdTemplate = 0.4;
71218
71236
  this.topClusters = 5;
71219
71237
  }
71220
71238
 
@@ -71684,9 +71702,6 @@ class Dssp {
71684
71702
 
71685
71703
  parseAlignData_part1(dataArray, domainidpairArray, bRound1) { let ic = this.icn3d, me = ic.icn3dui;
71686
71704
  // async parseAlignData(dataArray, domainidpairArray, bRound1) { let ic = this.icn3d, me = ic.icn3dui;
71687
- let tmscoreThreshold = 0.45; // 0.4; //0.5;
71688
- //let rmsdThreshold = 10;
71689
-
71690
71705
  // find the best alignment for each chain
71691
71706
  let domainid2segs = {};
71692
71707
  let domainid2refpdbnamelist = {};
@@ -71710,6 +71725,7 @@ class Dssp {
71710
71725
  }
71711
71726
 
71712
71727
  if(queryData[0].score === undefined) continue;
71728
+ let score = parseFloat(queryData[0].score);
71713
71729
 
71714
71730
  //let domainid_index = domainidpairArray[i].split(',');
71715
71731
  //let domainid = domainid_index[0];
@@ -71718,13 +71734,13 @@ class Dssp {
71718
71734
  //let chainid = domainid.split('-')[0];
71719
71735
 
71720
71736
  if(!bRound1) {
71721
- if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) {
71722
- if(!me.bNode) console.log("bRound1: " + bRound1 + ": domainid " + domainid + " and refpdbname " + refpdbname + " were skipped due to a TM-score less than " + tmscoreThreshold);
71737
+ if(queryData[0].score < this.TMThresholdTemplate || queryData[0].num_res < minResidues) {
71738
+ if(!me.bNode) console.log("bRound1: " + bRound1 + ": domainid " + domainid + " and refpdbname " + refpdbname + " were skipped due to a TM-score less than " + this.TMThresholdTemplate);
71723
71739
  continue;
71724
71740
  }
71725
71741
  }
71726
71742
  else {
71727
- if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues / 2) {
71743
+ if(queryData[0].score < this.TMThresholdTemplate || queryData[0].num_res < minResidues / 2) {
71728
71744
  continue;
71729
71745
  }
71730
71746
  }
@@ -71735,6 +71751,9 @@ class Dssp {
71735
71751
  else {
71736
71752
  // if(!me.bNode) console.log("domainid: " + domainid + " refpdbname " + refpdbname + " RMSD: " + queryData[0].super_rmsd + ", num_seg: " + queryData[0].num_seg + ", 10/RMSD + num_seg/5: " + (10 / queryData[0].super_rmsd + queryData[0].num_seg / 5).toFixed(1));
71737
71753
  if(!me.bNode) console.log("domainid: " + domainid + " refpdbname " + refpdbname + " TM-score: " + queryData[0].score);
71754
+
71755
+ if(!domainid2refpdbnamelist[domainid]) domainid2refpdbnamelist[domainid] = {};
71756
+ domainid2refpdbnamelist[domainid][refpdbname] = score;
71738
71757
  }
71739
71758
 
71740
71759
  // Ig-like domains: B (2150, 2150a, 2150b), C (3150, 3250), E (7150, 7250), F (8150, 8250) strands
@@ -71794,8 +71813,7 @@ class Dssp {
71794
71813
  delete ic.domainid2refpdbname[domainid];
71795
71814
  delete ic.domainid2score[domainid];
71796
71815
  }
71797
- continue;
71798
- }
71816
+ continue; }
71799
71817
  // }
71800
71818
 
71801
71819
  }
@@ -71815,7 +71833,6 @@ class Dssp {
71815
71833
  // }
71816
71834
 
71817
71835
  // let tmAdjust = 0.1;
71818
- let score = parseFloat(queryData[0].score);
71819
71836
 
71820
71837
  // if the TM score difference is within 0.1 and more strands are found, use the template with more strands
71821
71838
  // if(!domainid2segs.hasOwnProperty(domainid) ||
@@ -71828,9 +71845,7 @@ class Dssp {
71828
71845
  ic.domainid2score[domainid] = queryData[0].score + '_' + queryData[0].frac_identical + '_' + queryData[0].num_res ;
71829
71846
 
71830
71847
  if(bRound1) {
71831
- // ic.domainid2refpdbname[domainid] = score > 0.75 ? [refpdbname] : ['all_templates'];
71832
- ic.domainid2refpdbname[domainid] = score >= this.TMThreshold ? [refpdbname] : ['all_templates'];
71833
- // if(me.bNode) ic.domainid2refpdbname[domainid] = ['all_templates'];
71848
+ ic.domainid2refpdbname[domainid] = score >= this.TMThresholdIgType ? [refpdbname] : ['all_templates'];
71834
71849
  }
71835
71850
  else {
71836
71851
  ic.domainid2refpdbname[domainid] = [refpdbname];
@@ -71842,11 +71857,6 @@ class Dssp {
71842
71857
  ic.domainid2ig2kabat[domainid] = queryData[0].ig2kabat;
71843
71858
  ic.domainid2ig2imgt[domainid] = queryData[0].ig2imgt;
71844
71859
  }
71845
-
71846
- if(bRound1) {
71847
- if(!domainid2refpdbnamelist[domainid]) domainid2refpdbnamelist[domainid] = {};
71848
- domainid2refpdbnamelist[domainid][refpdbname] = score;
71849
- }
71850
71860
  }
71851
71861
 
71852
71862
  // combine the top clusters for the 2nd round alignment
@@ -72407,50 +72417,55 @@ class Dssp {
72407
72417
  }
72408
72418
  }
72409
72419
 
72410
- let bIgDomain = (ic.domainid2info && Object.keys(ic.domainid2info).length > 0) ? 1 : 0;
72420
+ // let bIgDomain = (ic.domainid2info && Object.keys(ic.domainid2info).length > 0) ? 1 : 0;
72421
+ let stru2bIgDomain = {};
72422
+ for(let domainid in ic.domainid2info) {
72423
+ let stru = domainid.split('_')[0];
72424
+ stru2bIgDomain[stru] = 1;
72425
+ }
72411
72426
 
72412
-
72427
+ // if(bIgDomain) {
72428
+ for(let structure in ic.structures) {
72429
+ let bIgDomain = stru2bIgDomain.hasOwnProperty(structure) ? 1 : 0;
72413
72430
 
72414
- if(bIgDomain) {
72415
- for(let structure in ic.structures) {
72416
- refData += '{"' + structure + '": {"Ig domain" : ' + bIgDomain + ', "igs": [\n';
72417
- for(let m = 0, ml = ic.structures[structure].length; m < ml; ++m) {
72418
- let chnid = ic.structures[structure][m];
72419
- let igArray = ic.chain2igArray[chnid];
72420
-
72421
- if(igArray && igArray.length > 0) {
72422
- refData += '{"' + chnid + '": {\n';
72423
-
72424
- for(let i = 0, il = igArray.length; i < il; ++i) {
72425
- let startPosArray = igArray[i].startPosArray;
72426
- let endPosArray = igArray[i].endPosArray;
72427
- let domainid = igArray[i].domainid;
72428
- let info = ic.domainid2info[domainid];
72429
- if(!info) continue;
72430
-
72431
- refData += '"' + domainid + '": {\n';
72432
-
72433
- refData += '"refpdbname":"' + info.refpdbname + '", "score":' + info.score + ', "seqid":' + info.seqid + ', "nresAlign":' + info.nresAlign + ', "data": [';
72434
- for(let j = 0, jl = startPosArray.length; j < jl; ++j) {
72435
- let startPos = startPosArray[j];
72436
- let endPos = endPosArray[j];
72437
- for(let k = startPos; k <= endPos; ++k) {
72438
- const resid = chnid + '_' + ic.chainsSeq[chnid][k].resi + '_' + ic.chainsSeq[chnid][k].name;
72439
- refData += '{"' + resid + '": "' + resid2refnum[resid] + '"},\n';
72440
- }
72441
- }
72442
- refData += '],\n';
72431
+ refData += '{"' + structure + '": {"Ig domain" : ' + bIgDomain + ', "igs": [\n';
72432
+ for(let m = 0, ml = ic.structures[structure].length; m < ml; ++m) {
72433
+ let chnid = ic.structures[structure][m];
72434
+ let igArray = ic.chain2igArray[chnid];
72435
+
72436
+ if(igArray && igArray.length > 0) {
72437
+ refData += '{"' + chnid + '": {\n';
72438
+
72439
+ for(let i = 0, il = igArray.length; i < il; ++i) {
72440
+ let startPosArray = igArray[i].startPosArray;
72441
+ let endPosArray = igArray[i].endPosArray;
72442
+ let domainid = igArray[i].domainid;
72443
+ let info = ic.domainid2info[domainid];
72444
+ if(!info) continue;
72443
72445
 
72444
- refData += '},\n';
72446
+ refData += '"' + domainid + '": {\n';
72447
+
72448
+ refData += '"refpdbname":"' + info.refpdbname + '", "score":' + info.score + ', "seqid":' + info.seqid + ', "nresAlign":' + info.nresAlign + ', "data": [';
72449
+ for(let j = 0, jl = startPosArray.length; j < jl; ++j) {
72450
+ let startPos = startPosArray[j];
72451
+ let endPos = endPosArray[j];
72452
+ for(let k = startPos; k <= endPos; ++k) {
72453
+ const resid = chnid + '_' + ic.chainsSeq[chnid][k].resi + '_' + ic.chainsSeq[chnid][k].name;
72454
+ refData += '{"' + resid + '": "' + resid2refnum[resid] + '"},\n';
72455
+ }
72445
72456
  }
72457
+ refData += '],\n';
72446
72458
 
72447
- refData += '}},\n';
72459
+ refData += '},\n';
72448
72460
  }
72449
- }
72450
72461
 
72451
- refData += ']}},\n';
72462
+ refData += '}},\n';
72463
+ }
72452
72464
  }
72465
+
72466
+ refData += ']}},\n';
72453
72467
  }
72468
+ // }
72454
72469
  }
72455
72470
  // 2. show Kabat ref numbers
72456
72471
  else if(type == 'kabat' || type == 'Kabat') {
@@ -78429,6 +78444,8 @@ class ThreeDPrint {
78429
78444
  }
78430
78445
 
78431
78446
  ic.drawCls.draw();
78447
+
78448
+ ic.bShowHighlight = true; // reset
78432
78449
  }
78433
78450
 
78434
78451
  //Reset the hydrogen bonds, distance lines to dashed lines. Reset the thickness to the default values.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.31.5",
3
+ "version": "3.31.6",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {