icn3d 3.23.5 → 3.23.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
@@ -7946,6 +7946,12 @@ class ClickMenu {
7946
7946
  thisClass.setLogCmd('color ig strand', true);
7947
7947
  });
7948
7948
 
7949
+ me.myEventCls.onIds("#" + me.pre + "mn4_clrIgproto", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
7950
+ //ic.legendClick = 6;
7951
+ ic.setOptionCls.setOption('color', 'ig protodomain');
7952
+ thisClass.setLogCmd('color ig protodomain', true);
7953
+ });
7954
+
7949
7955
 
7950
7956
  me.myEventCls.onIds("#" + me.pre + "mn4_clrArea", "click", function(e) { me.icn3d; //e.preventDefault();
7951
7957
  me.htmlCls.dialogCls.openDlg('dl_colorbyarea', "Color based on residue's solvent accessibility");
@@ -10262,7 +10268,9 @@ class SetMenu {
10262
10268
  html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'AlphaFold<br><span style="padding-left:1.5em;">Confidence</span>', undefined, 1, 1);
10263
10269
  //}
10264
10270
 
10265
- html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
10271
+ //!!!
10272
+ //html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
10273
+ //html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
10266
10274
  }
10267
10275
  else {
10268
10276
  //if(!me.cfg.hidelicense) html += this.getRadio('mn4_clr', 'mn1_delphi2', 'DelPhi<br><span style="padding-left:1.5em;">Potential ' + me.htmlCls.licenseStr + '</span>');
@@ -10481,12 +10489,13 @@ class SetMenu {
10481
10489
  html += this.getMenuText('mn6_igrefwrap', 'Ref. Number', undefined, undefined, 1);
10482
10490
 
10483
10491
  html += "<ul>";
10484
-
10492
+ //!!!
10493
+ /*
10485
10494
  html += this.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
10486
10495
  html += this.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
10487
10496
 
10488
10497
  html += this.getMenuSep();
10489
-
10498
+ */
10490
10499
  html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
10491
10500
  html += "</ul>";
10492
10501
  html += "</li>";
@@ -32753,6 +32762,8 @@ class Alternate {
32753
32762
 
32754
32763
  ic.dAtoms = {};
32755
32764
 
32765
+ let bMutation = moleculeArray.length == 2 && moleculeArray[1].replace(moleculeArray[0], '') == '2';
32766
+
32756
32767
  for(let i = 0, il = moleculeArray.length; i < il; ++i) {
32757
32768
  let structure = moleculeArray[i];
32758
32769
  //if(i > ic.ALTERNATE_STRUCTURE || (ic.ALTERNATE_STRUCTURE === il - 1 && i === 0) ) {
@@ -32785,7 +32796,17 @@ class Alternate {
32785
32796
 
32786
32797
  if(ic.ALTERNATE_STRUCTURE < 0) ic.ALTERNATE_STRUCTURE += il;
32787
32798
 
32788
- $("#" + ic.pre + "title").html(structure);
32799
+ let label = '';
32800
+ if(bMutation) {
32801
+ if(i == 0) {
32802
+ label = "Wild Type ";
32803
+ }
32804
+ else if(i == 1) {
32805
+ label = "Mutant ";
32806
+ }
32807
+ }
32808
+
32809
+ $("#" + ic.pre + "title").html(label + structure);
32789
32810
 
32790
32811
  break;
32791
32812
  }
@@ -35311,6 +35332,35 @@ class SetColor {
35311
35332
 
35312
35333
  break;
35313
35334
 
35335
+ case 'ig protodomain':
35336
+ if(ic.bShowRefnum) {
35337
+ for(let resid in ic.resid2refnum) {
35338
+ let refnumLabel = ic.resid2refnum[resid];
35339
+ let color;
35340
+ if(!refnumLabel) {
35341
+ color = me.parasCls.thr(me.htmlCls.GREYB);
35342
+ }
35343
+ else {
35344
+ let refnumStr = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').substr(1); // C', C''
35345
+ let currStrand = refnumLabel.replace(new RegExp(refnumStr,'g'), '');
35346
+ color = ic.showSeqCls.getProtodomainColor(currStrand);
35347
+
35348
+ if(ic.residIgLoop.hasOwnProperty(resid)) {
35349
+ color = me.parasCls.thr(me.htmlCls.GREYB);
35350
+ }
35351
+ }
35352
+
35353
+ for (let i in ic.residues[resid]) {
35354
+ let atom = ic.atoms[i];
35355
+ atom.color = me.parasCls.thr(color);
35356
+
35357
+ ic.atomPrevColors[i] = atom.color;
35358
+ }
35359
+ }
35360
+ }
35361
+
35362
+ break;
35363
+
35314
35364
  case 'residue custom':
35315
35365
  for (let i in atoms) {
35316
35366
  let atom = ic.atoms[i];
@@ -35975,6 +36025,9 @@ class SetOption {
35975
36025
  else if(colorType == 'ig strand') {
35976
36026
  colorLabel = 'Ig Strand';
35977
36027
  }
36028
+ else if(colorType == 'ig protodomain') {
36029
+ colorLabel = 'Ig Protodomain';
36030
+ }
35978
36031
 
35979
36032
  let html = "Color by <b>" + colorLabel + "</b><br><br>";
35980
36033
 
@@ -35998,6 +36051,9 @@ class SetOption {
35998
36051
  else if (colorType == 'ig strand'){
35999
36052
  html += this.getColorLegendForIgstrand(ic.hAtoms);
36000
36053
  }
36054
+ else if (colorType == 'ig protodomain'){
36055
+ html += this.getColorLegendForIgproto(ic.hAtoms);
36056
+ }
36001
36057
  //else if (ic.legendClick == 4){
36002
36058
  else if (colorType == 'normalized hydrophobic' || colorType == 'hydrophobic') {
36003
36059
  let bOriResn = true;
@@ -36229,19 +36285,49 @@ class SetOption {
36229
36285
  "A^ Strand": "FF00FF",
36230
36286
  "A Strand": "663399",
36231
36287
  "A* Strand": "FFC0CB",
36232
- "A Strand": "9370db",
36288
+ "A' Strand": "663399", //"9370db",
36233
36289
  "B Strand": "ba55d3",
36234
36290
  "C Strand": "0000FF",
36235
36291
  "C' Strand": "6495ED",
36236
36292
  "C'' Strand": "006400",
36237
36293
  "D Strand": "00FF00",
36238
- "E Strand": "FFFF00",
36294
+ "E Strand": "F7DC6F", //"F0E68C",
36239
36295
  "F Strand": "FFA500",
36240
36296
  "G Strand": "FF0000",
36241
36297
  "G* Strand": "8B0000",
36242
36298
  "Loop": "CCCCCC"
36243
36299
  };
36244
-
36300
+
36301
+ html += "<div>";
36302
+ for (let name in name2color) {
36303
+ let color = name2color[name];
36304
+ html += "<span>";
36305
+ html += "<div style='width: 10px; height: 10px; background-color:#" + color + "; border: 0px;display:inline-block;' ></div> ";
36306
+ html += name;
36307
+ html += "</span><br>";
36308
+ }
36309
+
36310
+ html += "</div>";
36311
+
36312
+ return html;
36313
+ }
36314
+
36315
+ getColorLegendForIgproto(atomHash) { let ic = this.icn3d; ic.icn3dui;
36316
+ let html = '';
36317
+
36318
+ const name2color = {
36319
+ "A Strand": "0000FF",
36320
+ "B Strand": "006400",
36321
+ "C Strand": "F7DC6F", //"F0E68C",
36322
+ "C' Strand": "FFA500",
36323
+ "C'' Strand": "FF0000",
36324
+ "D Strand": "0000FF",
36325
+ "E Strand": "006400",
36326
+ "F Strand": "F7DC6F", //"F0E68C",
36327
+ "G Strand": "FFA500",
36328
+ "Loop": "CCCCCC"
36329
+ };
36330
+
36245
36331
  html += "<div>";
36246
36332
  for (let name in name2color) {
36247
36333
  let color = name2color[name];
@@ -42380,6 +42466,8 @@ class ShowSeq {
42380
42466
  let html = '', html3 = '';
42381
42467
 
42382
42468
  let chainList = '';
42469
+ if(!ic.chainid2index[chnid]) return {html: html, html3: html3};
42470
+
42383
42471
  for(let i = 0, il = ic.chainid2index[chnid].length; i < il; ++i) {
42384
42472
  chainList += ic.refpdbArray[ic.chainid2index[chnid][i]] + " ";
42385
42473
  }
@@ -42863,7 +42951,7 @@ class ShowSeq {
42863
42951
  return '#FFC0CB'; //'#9900ff'; //'#87CEEB';
42864
42952
  }
42865
42953
  else if(currStrand == "A'") { //medium purple // steel blue
42866
- return '#9370db'; //'#9900ff'; //'#4682B4';
42954
+ return '#663399'; //'#9370db'; //'#9900ff'; //'#4682B4';
42867
42955
  }
42868
42956
  else if(currStrand == "B") { //medium orchid // cyan
42869
42957
  return '#ba55d3'; //'#0000FF'; //'#4a86e8'; //'#00FFFF';
@@ -42881,7 +42969,7 @@ class ShowSeq {
42881
42969
  return '#00FF00'; //'#fffb00'; //'#A52A2A';
42882
42970
  }
42883
42971
  else if(currStrand == "E") { //yellow // pink
42884
- return '#F0E68C'; //'#ff9900'; //'#ffd966'; //'#FFC0CB';
42972
+ return "#F7DC6F"; //'#F0E68C'; //'#ff9900'; //'#ffd966'; //'#FFC0CB';
42885
42973
  }
42886
42974
  else if(currStrand == "F") { //orange // magenta
42887
42975
  return '#FFA500'; //'#FF00FF'; //'#ff9900'; //'#FF00FF';
@@ -42897,6 +42985,27 @@ class ShowSeq {
42897
42985
  }
42898
42986
  }
42899
42987
 
42988
+ getProtodomainColor(currStrand) { let ic = this.icn3d, me = ic.icn3dui;
42989
+ if((currStrand && currStrand.substr(0,1) == "A") || currStrand == "D") {
42990
+ return '#0000FF';
42991
+ }
42992
+ else if(currStrand == "B" || currStrand == "E") {
42993
+ return '#006400';
42994
+ }
42995
+ else if(currStrand == "C" || currStrand == "F") {
42996
+ return "#F7DC6F"; //'#F0E68C';
42997
+ }
42998
+ else if(currStrand == "C'" || (currStrand && currStrand.substr(0, 1) == "G")) {
42999
+ return '#FFA500';
43000
+ }
43001
+ else if(currStrand == "C''") { //linker
43002
+ return '#FF0000';
43003
+ }
43004
+ else {
43005
+ return me.htmlCls.GREYB;
43006
+ }
43007
+ }
43008
+
42900
43009
  insertGap(chnid, seqIndex, text, bNohtml) { let ic = this.icn3d; ic.icn3dui;
42901
43010
  let html = '';
42902
43011
  //if(me.cfg.blast_rep_id == chnid && ic.targetGapHash!== undefined && ic.targetGapHash.hasOwnProperty(seqIndex)) {
@@ -43959,7 +44068,7 @@ class LineGraph {
43959
44068
  // Node for common interaction: {id : "Q24.A.2AJF|Q24", r : "1_1_2AJF_A_24", s: "a", ...}
43960
44069
  let nodeArray1SplitCommon = [], nodeArray2SplitCommon = [], linkArraySplitCommon = [], nameHashSplitCommon = [];
43961
44070
  let nodeArray1SplitDiff = [], nodeArray2SplitDiff = [], linkArraySplitDiff = [], nameHashSplitDiff = [];
43962
- let linkedNodeCnt = {};
44071
+ let linkedNodeCnt = {}, linkedNodeInterDiff = {};
43963
44072
 
43964
44073
  for(let i = 0, il = structureArray.length; i < il; ++i) {
43965
44074
  nodeArray1Split[i] = [];
@@ -43979,7 +44088,7 @@ class LineGraph {
43979
44088
 
43980
44089
  struc2index[structureArray[i]] = i;
43981
44090
  }
43982
-
44091
+
43983
44092
  for(let i = 0, il = linkArray.length; i < il; ++i) {
43984
44093
  let link = linkArray[i];
43985
44094
  let nodeA = name2node[link.source];
@@ -44015,9 +44124,11 @@ class LineGraph {
44015
44124
 
44016
44125
  if(!linkedNodeCnt.hasOwnProperty(mappingid)) {
44017
44126
  linkedNodeCnt[mappingid] = 1;
44127
+ linkedNodeInterDiff[mappingid] = link.n;
44018
44128
  }
44019
44129
  else {
44020
44130
  ++linkedNodeCnt[mappingid];
44131
+ linkedNodeInterDiff[mappingid] -= link.n; // show difference
44021
44132
  }
44022
44133
  }
44023
44134
  }
@@ -44068,7 +44179,7 @@ class LineGraph {
44068
44179
  linkDiff.source += separatorDiff + ic.chainsMapping[chainid1][resid1];
44069
44180
  linkDiff.target += separatorDiff + ic.chainsMapping[chainid2][resid2];
44070
44181
 
44071
- if(linkedNodeCnt[mappingid] == structureArray.length) {
44182
+ if(linkedNodeCnt[mappingid] == structureArray.length && linkedNodeInterDiff[mappingid] == 0) {
44072
44183
  linkArraySplitCommon[index].push(linkCommon);
44073
44184
  }
44074
44185
  else {
@@ -44857,7 +44968,10 @@ class GetGraph {
44857
44968
  ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
44858
44969
  resid2ResidhashHbond = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44859
44970
  }
44860
- let hbondStr = this.getGraphLinks(resid2ResidhashHbond, resid2ResidhashHbond, me.htmlCls.hbondInsideColor, labelType, me.htmlCls.hbondValuehbondInsideValue);
44971
+
44972
+ //let hbondStr = this.getGraphLinks(resid2ResidhashHbond, resid2ResidhashHbond, me.htmlCls.hbondInsideColor, labelType, me.htmlCls.hbondValuehbondInsideValue);
44973
+ let hbondStr = this.getGraphLinks(resid2ResidhashHbond, resid2ResidhashHbond, me.htmlCls.hbondInsideColor, labelType, me.htmlCls.hbondInsideValue);
44974
+
44861
44975
  return hbondStr;
44862
44976
  }
44863
44977
  getIonicLinksForSet(atoms, labelType) { let ic = this.icn3d, me = ic.icn3dui;
@@ -44957,9 +45071,10 @@ class GetGraph {
44957
45071
  getGraphLinks(hash1, hash2, color, labelType, value, bCartoon2d) {var ic = this.icn3d, me = ic.icn3dui;
44958
45072
  let hbondStr = '';
44959
45073
  value =(value === undefined) ? 1 : value;
44960
- let prevLinkStr = '';
44961
- let sourceTargetHash = {};
45074
+ //let prevLinkStr = '';
45075
+ //let sourceTargetHash = {};
44962
45076
 
45077
+ let linkstr2cnt = {};
44963
45078
  for(let resid1 in hash1) {
44964
45079
  //ASN $1KQ2.A:6@ND2
44965
45080
  //or ASN $1KQ2.A:6
@@ -44990,7 +45105,7 @@ class GetGraph {
44990
45105
  resName1 = ic.resi2resirange[resName1];
44991
45106
  resName2 = ic.resi2resirange[resName2];
44992
45107
  }
44993
-
45108
+ /*
44994
45109
  if(!sourceTargetHash.hasOwnProperty(resName1 + '_' + resName2) && resName1 !== undefined && resName2 !== undefined ) {
44995
45110
  let linkStr = ', {"source": "' + resName1 + '", "target": "' + resName2 + '", "v": ' + value + ', "c": "' + color + '"}';
44996
45111
  if(linkStr != prevLinkStr) hbondStr += linkStr;
@@ -44999,8 +45114,29 @@ class GetGraph {
44999
45114
  sourceTargetHash[resName1 + '_' + resName2] = 1;
45000
45115
  sourceTargetHash[resName2 + '_' + resName1] = 1;
45001
45116
  }
45117
+ */
45118
+
45119
+ if(resName1 !== undefined && resName2 !== undefined ) {
45120
+ let linkStr = '"source": "' + resName1 + '", "target": "' + resName2 + '", "v": ' + value + ', "c": "' + color + '"';
45121
+
45122
+ //prevLinkStr = linkStr;
45123
+
45124
+ if(!linkstr2cnt.hasOwnProperty(linkStr)) {
45125
+ linkstr2cnt[linkStr] = 1;
45126
+ linkstr2cnt[linkStr] = 1;
45127
+ }
45128
+ else {
45129
+ linkstr2cnt[linkStr] += 1;
45130
+ linkstr2cnt[linkStr] += 1;
45131
+ }
45132
+ }
45002
45133
  }
45003
45134
  }
45135
+
45136
+ for(let linkStr in linkstr2cnt) {
45137
+ hbondStr += ', {' + linkStr + ', "n": ' + linkstr2cnt[linkStr] + '}';
45138
+ }
45139
+
45004
45140
  return hbondStr;
45005
45141
  }
45006
45142
  convertLabel2Resid(residLabel) {var ic = this.icn3d; ic.icn3dui;
@@ -45436,12 +45572,14 @@ class ViewInterPairs {
45436
45572
  let bondCnt;
45437
45573
 
45438
45574
  // reset
45439
- ic.hbondpnts = [];
45440
- ic.saltbridgepnts = [];
45441
- ic.contactpnts = [];
45442
- ic.halogenpnts = [];
45443
- ic.picationpnts = [];
45444
- ic.pistackingpnts = [];
45575
+ if(!bHbondCalc) {
45576
+ ic.hbondpnts = [];
45577
+ ic.saltbridgepnts = [];
45578
+ ic.contactpnts = [];
45579
+ ic.halogenpnts = [];
45580
+ ic.picationpnts = [];
45581
+ ic.pistackingpnts = [];
45582
+ }
45445
45583
 
45446
45584
  // type: view, save, forcegraph
45447
45585
  ic.bRender = false;
@@ -48603,7 +48741,7 @@ class MmcifParser {
48603
48741
  }
48604
48742
 
48605
48743
  async downloadMmcifSymmetry(mmcifid, type) { let ic = this.icn3d, me = ic.icn3dui;
48606
- // https://files.rcsb.org/header/ i snot accessible in Node.js
48744
+ // https://files.rcsb.org/header/ is not accessible in Node.js
48607
48745
  let url = (me.bNode) ? "https://files.rcsb.org/view/" + mmcifid + ".cif" : "https://files.rcsb.org/header/" + mmcifid + ".cif";
48608
48746
 
48609
48747
  //ic.bCid = undefined;
@@ -49902,7 +50040,8 @@ class PdbParser {
49902
50040
  }
49903
50041
  else {
49904
50042
  url = "https://files.rcsb.org/view/" + pdbid + ".pdb";
49905
- ic.ParserUtilsCls.setYourNote(pdbid.toUpperCase() + '(PDB) in iCn3D');
50043
+ pdbid = pdbid.toUpperCase();
50044
+ ic.ParserUtilsCls.setYourNote(pdbid + '(PDB) in iCn3D');
49906
50045
  }
49907
50046
 
49908
50047
  //ic.bCid = undefined;
@@ -55211,6 +55350,7 @@ class LoadPDB {
55211
55350
  //let chainMissingResidueArray = {}
55212
55351
 
55213
55352
  let id = (pdbid) ? pdbid : ic.defaultPdbId;
55353
+
55214
55354
  let structure = id;
55215
55355
 
55216
55356
  let prevMissingChain = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.23.5",
3
+ "version": "3.23.6",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {