icn3d 3.28.11 → 3.28.12

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
@@ -13187,9 +13187,9 @@ class Events {
13187
13187
  thisClass.setLogCmd("clear selection", true);
13188
13188
  });
13189
13189
 
13190
- me.myEventCls.onIds(["#" + me.pre + "alternate", "#" + me.pre + "mn2_alternate", "#" + me.pre + "alternate2"], "click", function(e) { let ic = me.icn3d;
13190
+ me.myEventCls.onIds(["#" + me.pre + "alternate", "#" + me.pre + "mn2_alternate", "#" + me.pre + "alternate2"], "click", async function(e) { let ic = me.icn3d;
13191
13191
  ic.bAlternate = true;
13192
- ic.alternateCls.alternateStructures();
13192
+ await ic.alternateCls.alternateStructures();
13193
13193
  ic.bAlternate = false;
13194
13194
 
13195
13195
  thisClass.setLogCmd("alternate structures", false);
@@ -16468,6 +16468,7 @@ class SetHtml {
16468
16468
  let matchedStrData = "Start of data file======\n";
16469
16469
  let posData = imageStr.indexOf(matchedStrData);
16470
16470
  ic.bInputfile =(posData == -1) ? false : true;
16471
+ ic.bInputPNGWithData = ic.bInputfile;
16471
16472
  let commandStr = (command) ? command.replace(/;/g, "\n") : '';
16472
16473
 
16473
16474
  let statefile;
@@ -33412,7 +33413,7 @@ class Alternate {
33412
33413
 
33413
33414
  // change the display atom when alternating
33414
33415
  //Show structures one by one.
33415
- alternateStructures() { let ic = this.icn3d, me = ic.icn3dui;
33416
+ async alternateStructures() { let ic = this.icn3d, me = ic.icn3dui;
33416
33417
  ic.bAlternate = true;
33417
33418
 
33418
33419
  //ic.transformCls.zoominSelection();
@@ -33510,16 +33511,24 @@ class Alternate {
33510
33511
  ic.applyMapCls.removeEmmaps();
33511
33512
  ic.applyMapCls.applyEmmapOptions();
33512
33513
 
33513
- // allow the alternation of DelPhi map
33514
+ // allow the alternation of DelPhi map
33515
+ /*
33516
+ // Option 1: recalculate =========
33517
+ ic.applyMapCls.removePhimaps();
33518
+ await ic.delphiCls.loadDelphiFile('delphi');
33519
+
33520
+ ic.applyMapCls.removeSurfaces();
33521
+ await ic.delphiCls.loadDelphiFile('delphi2');
33522
+ // ==============
33523
+ */
33524
+
33525
+ // Option 2: NO recalculate, just show separately =========
33514
33526
  ic.applyMapCls.removePhimaps();
33515
33527
  ic.applyMapCls.applyPhimapOptions();
33516
- // should recalculate the potential
33517
- //ic.loadDelphiFileBase('delphi');
33518
33528
 
33519
33529
  ic.applyMapCls.removeSurfaces();
33520
33530
  ic.applyMapCls.applyphisurfaceOptions();
33521
- // should recalculate the potential
33522
- //ic.loadDelphiFileBase('delphi2');
33531
+ // ==============
33523
33532
 
33524
33533
  // alternate the PCA axes
33525
33534
  ic.axes = [];
@@ -33536,9 +33545,9 @@ class Alternate {
33536
33545
  ic.bShowHighlight = true;
33537
33546
  }
33538
33547
 
33539
- alternateWrapper() { let ic = this.icn3d; ic.icn3dui;
33548
+ async alternateWrapper() { let ic = this.icn3d; ic.icn3dui;
33540
33549
  ic.bAlternate = true;
33541
- this.alternateStructures();
33550
+ await this.alternateStructures();
33542
33551
  ic.bAlternate = false;
33543
33552
  }
33544
33553
 
@@ -57261,7 +57270,8 @@ class SetSeqAlign {
57261
57270
 
57262
57271
  if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid1][j] === undefined) break;
57263
57272
 
57264
- let resi = this.getResiAferAlign(chainid1, bRealign, j + 1);
57273
+ //let resi = this.getResiAferAlign(chainid1, bRealign, j + 1);
57274
+ let resi = this.getResiAferAlign(chainid1, bRealign, j);
57265
57275
  // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid1, j).toLowerCase() : ic.chainsSeq[chainid1][j].name.toLowerCase();
57266
57276
  let resn = this.getResnFromResi(chainid1, resi).toLowerCase();
57267
57277
 
@@ -57282,11 +57292,11 @@ class SetSeqAlign {
57282
57292
 
57283
57293
  if(ic.chainsSeq[chainid2] === undefined || ic.chainsSeq[chainid2] === undefined) break;
57284
57294
 
57285
- let resi = this.getResiAferAlign(chainid2, bRealign, j + 1);
57295
+ //let resi = this.getResiAferAlign(chainid2, bRealign, j + 1);
57296
+ let resi = this.getResiAferAlign(chainid2, bRealign, j);
57286
57297
  // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid2, j).toLowerCase() : ic.chainsSeq[chainid2][j].name.toLowerCase();
57287
57298
  let resn = this.getResnFromResi(chainid2, resi).toLowerCase();
57288
57299
 
57289
-
57290
57300
  if(resn == '?') continue;
57291
57301
 
57292
57302
  color = me.htmlCls.GREY8;
@@ -57827,7 +57837,6 @@ class SetSeqAlign {
57827
57837
  start1Pos = start1;
57828
57838
  end1Pos = end1;
57829
57839
  }
57830
-
57831
57840
  //let range = resi2range_t[resiStart1];
57832
57841
 
57833
57842
  // if the mapping does not start from start_t, add gaps to the query seq
@@ -57851,7 +57860,7 @@ class SetSeqAlign {
57851
57860
  pos2 = result.pos2;
57852
57861
  let notAlnLen1 = pos2 - (pos1 + 1);
57853
57862
  let notAlnLen2 = start2 - (prevIndex2 + 1);
57854
-
57863
+
57855
57864
  // insert non-aligned residues in query seq
57856
57865
  this.insertNotAlignRes(chainid2, prevIndex2+1, notAlnLen2, bRealign);
57857
57866
 
@@ -62833,8 +62842,10 @@ class LoadScript {
62833
62842
  let id = loadStr.substr(loadStr.lastIndexOf(' ') + 1);
62834
62843
  if(id.length == 4) id = id.toUpperCase();
62835
62844
 
62836
- // skip loading the structure if it was loaded before
62837
- if(ic.structures && ic.structures.hasOwnProperty(id)) return;
62845
+ // skip loading the structure if
62846
+ // 1. PDB was in the iCn3D PNG Image file
62847
+ // 2. it was loaded before
62848
+ if(ic.bInputPNGWithData || (ic.structures && ic.structures.hasOwnProperty(id))) return;
62838
62849
 
62839
62850
  ic.inputid = id;
62840
62851
  if(command.indexOf('load mmtf') !== -1) {
@@ -72000,7 +72011,7 @@ class Control {
72000
72011
  ic.typetext = false;
72001
72012
  });
72002
72013
 
72003
- $(document).bind('keydown', function (e) {
72014
+ $(document).bind('keydown', async function (e) {
72004
72015
  //document.addEventListener('keydown', function (e) {
72005
72016
  if(e.shiftKey || e.keyCode === 16) {
72006
72017
  ic.bShift = true;
@@ -72138,7 +72149,7 @@ class Control {
72138
72149
 
72139
72150
  else if(e.keyCode === 65 ) { // A, alternate
72140
72151
  if(Object.keys(ic.structures).length > 1) {
72141
- ic.alternateCls.alternateWrapper();
72152
+ await ic.alternateCls.alternateWrapper();
72142
72153
  }
72143
72154
  }
72144
72155
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.28.11",
3
+ "version": "3.28.12",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {