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.js CHANGED
@@ -12286,9 +12286,9 @@ class Events {
12286
12286
  thisClass.setLogCmd("clear selection", true);
12287
12287
  });
12288
12288
 
12289
- me.myEventCls.onIds(["#" + me.pre + "alternate", "#" + me.pre + "mn2_alternate", "#" + me.pre + "alternate2"], "click", function(e) { let ic = me.icn3d;
12289
+ me.myEventCls.onIds(["#" + me.pre + "alternate", "#" + me.pre + "mn2_alternate", "#" + me.pre + "alternate2"], "click", async function(e) { let ic = me.icn3d;
12290
12290
  ic.bAlternate = true;
12291
- ic.alternateCls.alternateStructures();
12291
+ await ic.alternateCls.alternateStructures();
12292
12292
  ic.bAlternate = false;
12293
12293
 
12294
12294
  thisClass.setLogCmd("alternate structures", false);
@@ -15567,6 +15567,7 @@ class SetHtml {
15567
15567
  let matchedStrData = "Start of data file======\n";
15568
15568
  let posData = imageStr.indexOf(matchedStrData);
15569
15569
  ic.bInputfile =(posData == -1) ? false : true;
15570
+ ic.bInputPNGWithData = ic.bInputfile;
15570
15571
  let commandStr = (command) ? command.replace(/;/g, "\n") : '';
15571
15572
 
15572
15573
  let statefile;
@@ -32511,7 +32512,7 @@ class Alternate {
32511
32512
 
32512
32513
  // change the display atom when alternating
32513
32514
  //Show structures one by one.
32514
- alternateStructures() { let ic = this.icn3d, me = ic.icn3dui;
32515
+ async alternateStructures() { let ic = this.icn3d, me = ic.icn3dui;
32515
32516
  ic.bAlternate = true;
32516
32517
 
32517
32518
  //ic.transformCls.zoominSelection();
@@ -32609,16 +32610,24 @@ class Alternate {
32609
32610
  ic.applyMapCls.removeEmmaps();
32610
32611
  ic.applyMapCls.applyEmmapOptions();
32611
32612
 
32612
- // allow the alternation of DelPhi map
32613
+ // allow the alternation of DelPhi map
32614
+ /*
32615
+ // Option 1: recalculate =========
32616
+ ic.applyMapCls.removePhimaps();
32617
+ await ic.delphiCls.loadDelphiFile('delphi');
32618
+
32619
+ ic.applyMapCls.removeSurfaces();
32620
+ await ic.delphiCls.loadDelphiFile('delphi2');
32621
+ // ==============
32622
+ */
32623
+
32624
+ // Option 2: NO recalculate, just show separately =========
32613
32625
  ic.applyMapCls.removePhimaps();
32614
32626
  ic.applyMapCls.applyPhimapOptions();
32615
- // should recalculate the potential
32616
- //ic.loadDelphiFileBase('delphi');
32617
32627
 
32618
32628
  ic.applyMapCls.removeSurfaces();
32619
32629
  ic.applyMapCls.applyphisurfaceOptions();
32620
- // should recalculate the potential
32621
- //ic.loadDelphiFileBase('delphi2');
32630
+ // ==============
32622
32631
 
32623
32632
  // alternate the PCA axes
32624
32633
  ic.axes = [];
@@ -32635,9 +32644,9 @@ class Alternate {
32635
32644
  ic.bShowHighlight = true;
32636
32645
  }
32637
32646
 
32638
- alternateWrapper() { let ic = this.icn3d; ic.icn3dui;
32647
+ async alternateWrapper() { let ic = this.icn3d; ic.icn3dui;
32639
32648
  ic.bAlternate = true;
32640
- this.alternateStructures();
32649
+ await this.alternateStructures();
32641
32650
  ic.bAlternate = false;
32642
32651
  }
32643
32652
 
@@ -56360,7 +56369,8 @@ class SetSeqAlign {
56360
56369
 
56361
56370
  if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid1][j] === undefined) break;
56362
56371
 
56363
- let resi = this.getResiAferAlign(chainid1, bRealign, j + 1);
56372
+ //let resi = this.getResiAferAlign(chainid1, bRealign, j + 1);
56373
+ let resi = this.getResiAferAlign(chainid1, bRealign, j);
56364
56374
  // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid1, j).toLowerCase() : ic.chainsSeq[chainid1][j].name.toLowerCase();
56365
56375
  let resn = this.getResnFromResi(chainid1, resi).toLowerCase();
56366
56376
 
@@ -56381,11 +56391,11 @@ class SetSeqAlign {
56381
56391
 
56382
56392
  if(ic.chainsSeq[chainid2] === undefined || ic.chainsSeq[chainid2] === undefined) break;
56383
56393
 
56384
- let resi = this.getResiAferAlign(chainid2, bRealign, j + 1);
56394
+ //let resi = this.getResiAferAlign(chainid2, bRealign, j + 1);
56395
+ let resi = this.getResiAferAlign(chainid2, bRealign, j);
56385
56396
  // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid2, j).toLowerCase() : ic.chainsSeq[chainid2][j].name.toLowerCase();
56386
56397
  let resn = this.getResnFromResi(chainid2, resi).toLowerCase();
56387
56398
 
56388
-
56389
56399
  if(resn == '?') continue;
56390
56400
 
56391
56401
  color = me.htmlCls.GREY8;
@@ -56926,7 +56936,6 @@ class SetSeqAlign {
56926
56936
  start1Pos = start1;
56927
56937
  end1Pos = end1;
56928
56938
  }
56929
-
56930
56939
  //let range = resi2range_t[resiStart1];
56931
56940
 
56932
56941
  // if the mapping does not start from start_t, add gaps to the query seq
@@ -56950,7 +56959,7 @@ class SetSeqAlign {
56950
56959
  pos2 = result.pos2;
56951
56960
  let notAlnLen1 = pos2 - (pos1 + 1);
56952
56961
  let notAlnLen2 = start2 - (prevIndex2 + 1);
56953
-
56962
+
56954
56963
  // insert non-aligned residues in query seq
56955
56964
  this.insertNotAlignRes(chainid2, prevIndex2+1, notAlnLen2, bRealign);
56956
56965
 
@@ -61932,8 +61941,10 @@ class LoadScript {
61932
61941
  let id = loadStr.substr(loadStr.lastIndexOf(' ') + 1);
61933
61942
  if(id.length == 4) id = id.toUpperCase();
61934
61943
 
61935
- // skip loading the structure if it was loaded before
61936
- if(ic.structures && ic.structures.hasOwnProperty(id)) return;
61944
+ // skip loading the structure if
61945
+ // 1. PDB was in the iCn3D PNG Image file
61946
+ // 2. it was loaded before
61947
+ if(ic.bInputPNGWithData || (ic.structures && ic.structures.hasOwnProperty(id))) return;
61937
61948
 
61938
61949
  ic.inputid = id;
61939
61950
  if(command.indexOf('load mmtf') !== -1) {
@@ -71099,7 +71110,7 @@ class Control {
71099
71110
  ic.typetext = false;
71100
71111
  });
71101
71112
 
71102
- $(document).bind('keydown', function (e) {
71113
+ $(document).bind('keydown', async function (e) {
71103
71114
  //document.addEventListener('keydown', function (e) {
71104
71115
  if(e.shiftKey || e.keyCode === 16) {
71105
71116
  ic.bShift = true;
@@ -71237,7 +71248,7 @@ class Control {
71237
71248
 
71238
71249
  else if(e.keyCode === 65 ) { // A, alternate
71239
71250
  if(Object.keys(ic.structures).length > 1) {
71240
- ic.alternateCls.alternateWrapper();
71251
+ await ic.alternateCls.alternateWrapper();
71241
71252
  }
71242
71253
  }
71243
71254