icn3d 3.45.5 → 3.45.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.js CHANGED
@@ -58415,11 +58415,13 @@ class ClickMenu {
58415
58415
  });
58416
58416
 
58417
58417
  me.myEventCls.onIds("#" + me.pre + "mn6_cameraPers", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
58418
+ ic.bChangeCamera = true;
58418
58419
  ic.setOptionCls.setOption('camera', 'perspective');
58419
58420
  thisClass.setLogCmd('set camera perspective', true);
58420
58421
  });
58421
58422
 
58422
58423
  me.myEventCls.onIds("#" + me.pre + "mn6_cameraOrth", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
58424
+ ic.bChangeCamera = true;
58423
58425
  ic.setOptionCls.setOption('camera', 'orthographic');
58424
58426
  thisClass.setLogCmd('set camera orthographic', true);
58425
58427
  });
@@ -63779,7 +63781,7 @@ class Events {
63779
63781
  me.myEventCls.onIds(["#" + me.pre + "show_2ddgm", "#" + me.pre + "mn2_2ddgm"], "click", async function(e) { let ic = me.icn3d;
63780
63782
  me.htmlCls.dialogCls.openDlg('dl_2ddgm', '2D Diagram');
63781
63783
  await ic.viewInterPairsCls.retrieveInteractionData();
63782
- thisClass.setLogCmd("view interactions", true);
63784
+ thisClass.setLogCmd("view 2d diagram", true);
63783
63785
  });
63784
63786
 
63785
63787
  me.myEventCls.onIds("#" + me.pre + "mn2_2ddepiction", "click", async function(e) { let ic = me.icn3d;
@@ -74153,11 +74155,13 @@ class Scene {
74153
74155
 
74154
74156
  ic.fogCls.setFog();
74155
74157
 
74156
- ic.cameraCls.setCamera();
74157
- // set the ratio for view point, which was set in ic.transformCls.resetOrientation_base
74158
- if(!ic.container.whratio) {
74159
- ic.container.whratio = me.htmlCls.WIDTH / me.htmlCls.HEIGHT;
74160
- ic.cam.aspect = ic.container.whratio;
74158
+ if(!ic.cam || ic.bChangeCamera) {
74159
+ ic.cameraCls.setCamera();
74160
+ // set the ratio for view point, which was set in ic.transformCls.resetOrientation_base
74161
+ if(!ic.container.whratio) {
74162
+ ic.container.whratio = me.htmlCls.WIDTH / me.htmlCls.HEIGHT;
74163
+ ic.cam.aspect = ic.container.whratio;
74164
+ }
74161
74165
  }
74162
74166
 
74163
74167
  if(ic.opts['slab'] === 'yes') ic.cameraCls.setSlab();
@@ -86361,7 +86365,7 @@ class Alternate {
86361
86365
  }
86362
86366
 
86363
86367
  ic.bShowHighlight = false;
86364
- // ic.opts['rotationcenter'] = 'highlight center';
86368
+ ic.opts['rotationcenter'] = 'highlight center';
86365
86369
  }
86366
86370
 
86367
86371
  // also alternating the surfaces
@@ -104163,7 +104167,7 @@ class ChainalignParser {
104163
104167
  targetOrQuery = 'query';
104164
104168
  bAppend = true;
104165
104169
  }
104166
-
104170
+ console.log("### i " + i + " structArray[i] " + structArray[i]);
104167
104171
  //if(structArray[i].length > 4) {
104168
104172
  if(isNaN(structArray[i]) && structArray[i].length > 5) { // PDB ID plus postfix could be 5
104169
104173
  //let bNoDssp = true;
@@ -104181,8 +104185,8 @@ class ChainalignParser {
104181
104185
  // hAtoms = me.hashUtilsCls.unionHash(hAtoms, hAtomsTmp);
104182
104186
  }
104183
104187
 
104184
- let structArrayAll = Object.keys(ic.structures);
104185
-
104188
+ let structArrayAll = structArray; //Object.keys(ic.structures);
104189
+ console.log("### ic.chains: " + JSON.stringify(ic.chains) + " ic.structures " + JSON.stringify(ic.structures));
104186
104190
  ic.opts['color'] = (structArrayAll.length > 1) ? 'structure' : ((structArrayAll[0].length > 5) ? 'confidence' : 'chain');
104187
104191
 
104188
104192
  // add color for all structures
@@ -116047,7 +116051,7 @@ class ApplyCommand {
116047
116051
  ic.selectionCls.selectAll();
116048
116052
  //ic.hlObjectsCls.addHlObjects();
116049
116053
  }
116050
- else if(command == 'show all') {
116054
+ else if(command == 'show all' || command == 'view all') {
116051
116055
  ic.selectionCls.showAll();
116052
116056
  }
116053
116057
  else if(command == 'select complement') {
@@ -116427,7 +116431,7 @@ class ApplyCommand {
116427
116431
  ic.applyCenterCls.centerSelection();
116428
116432
  ic.drawCls.draw();
116429
116433
  }
116430
- else if(command == 'show selection') {
116434
+ else if(command == 'show selection' || command == 'view selection') {
116431
116435
  ic.selectionCls.showSelection();
116432
116436
  }
116433
116437
  else if(command == 'hide selection') {
@@ -116470,12 +116474,12 @@ class ApplyCommand {
116470
116474
  else if(command == 'delete selected sets') {
116471
116475
  ic.definedSetsCls.deleteSelectedSets();
116472
116476
  }
116473
- else if(command == 'view interactions') {
116477
+ else if(command == 'view interactions' || command == 'view 2d diagram') {
116474
116478
  if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined) {
116475
116479
  ic.ParserUtilsCls.set2DDiagrams(ic.inputid);
116476
116480
  }
116477
116481
  }
116478
- else if(command == 'show annotations all chains') {
116482
+ else if(command == 'show annotations all chains' || command == 'view annotations all chains') {
116479
116483
  ic.annotationCls.showAnnoAllChains();
116480
116484
  }
116481
116485
 
@@ -116537,7 +116541,7 @@ class ApplyCommand {
116537
116541
  else if(command == 'clear symd symmetry') {
116538
116542
  ic.symdArray = [];
116539
116543
  }
116540
- else if(command == 'show axis') {
116544
+ else if(command == 'show axis' || command == 'view axis') {
116541
116545
  ic.bAxisOnly = true;
116542
116546
  }
116543
116547
 
@@ -116985,7 +116989,7 @@ class ApplyCommand {
116985
116989
  }
116986
116990
  }
116987
116991
  else if(commandOri.indexOf('display interaction 3d') == 0
116988
- || commandOri.indexOf('view interaction pairs') == 0
116992
+ || commandOri.indexOf('view interaction pairs') == 0 || commandOri.indexOf('show interaction pairs') == 0
116989
116993
  || commandOri.indexOf('save1 interaction pairs') == 0
116990
116994
  || commandOri.indexOf('save2 interaction pairs') == 0
116991
116995
  || commandOri.indexOf('line graph interaction pairs') == 0
@@ -117036,7 +117040,7 @@ class ApplyCommand {
117036
117040
  if(commandOri.indexOf('display interaction 3d') == 0) {
117037
117041
  type = '3d';
117038
117042
  }
117039
- else if(commandOri.indexOf('view interaction pairs') == 0) {
117043
+ else if(commandOri.indexOf('view interaction pairs') == 0 || commandOri.indexOf('show interaction pairs') == 0) {
117040
117044
  type = 'view';
117041
117045
  }
117042
117046
  else if(commandOri.indexOf('save1 interaction pairs') == 0) {
@@ -117396,7 +117400,7 @@ class ApplyCommand {
117396
117400
  let dataStr = paraArray[1].replace(/\\n/g, '\n');
117397
117401
  await ic.refnumCls.parseCustomRefFile(dataStr);
117398
117402
  }
117399
- else if(command.indexOf('show ref number') == 0) {
117403
+ else if(command.indexOf('show ref number') == 0 || command.indexOf('view ref number') == 0) {
117400
117404
  ic.bShownRefnum = true;
117401
117405
  }
117402
117406
  else if(command.indexOf('hide ref number') == 0) {
@@ -117652,7 +117656,7 @@ class ApplyCommand {
117652
117656
  else if(cmd.indexOf('set annotation clinvar') == 0) return seqAnnoStr + ': "ClinVar" checkbox';
117653
117657
  else if(cmd.indexOf('set annotation snp') == 0) return seqAnnoStr + ': "SNP" checkbox';
117654
117658
  else if(cmd.indexOf('set annotation 3ddomain') == 0) return seqAnnoStr + ': "3D Domains" checkbox';
117655
- else if(cmd.indexOf('view interactions') == 0) return 'Windows > View 2D Diagram';
117659
+ else if(cmd.indexOf('view interactions') == 0 || cmd.indexOf('view 2d diagram') == 0) return 'Windows > View 2D Diagram';
117656
117660
  else if(cmd.indexOf('symmetry') == 0) return 'Analysis > Symmetry';
117657
117661
  else if(cmd.indexOf('realign on seq align') == 0) return 'File > Realign Selection > on Sequence Alignment';
117658
117662
  else if(cmd.indexOf('realign') == 0) return 'File > Realign Selection > Residue by Residue';
@@ -117744,7 +117748,7 @@ class ApplyCommand {
117744
117748
  else if(cmd == 'clear all') return 'Select > Clear Selection';
117745
117749
  else if(cmd == 'defined sets') return 'Windows > Defined Sets';
117746
117750
  else if(cmd == 'delete selected sets') return 'Windows > Defined Sets: "Delete Selected Sets" button';
117747
- else if(cmd == 'view interactions') return 'Windows > View Interactions';
117751
+ else if(cmd == 'view interactions' || cmd == 'view 2d diagram') return 'Windows > View Interactions';
117748
117752
  else if(cmd == 'show annotations all chains') return seqAnnoStr + ': "Show All Chains" button';
117749
117753
  else if(cmd == 'save color') return 'Color > Save Color';
117750
117754
  else if(cmd == 'apply saved color') return 'Color > Apply Saved Color';
@@ -119015,7 +119019,7 @@ class LoadScript {
119015
119019
 
119016
119020
  await ic.annotationCls.setAnnoTabAll();
119017
119021
  }
119018
- else if(command.indexOf('view interactions') == 0 && me.cfg.align !== undefined) { // the command may have "|||{"factor"...
119022
+ else if((command.indexOf('view interactions') == 0 || command.indexOf('view 2d diagram') == 0) && me.cfg.align !== undefined) { // the command may have "|||{"factor"...
119019
119023
  await thisClass.applyCommandViewinteraction(strArray[0].trim());
119020
119024
  }
119021
119025
  else if(command.indexOf('view 2d depiction') == 0) { // the command may have "|||{"factor"...
@@ -119226,7 +119230,7 @@ class LoadScript {
119226
119230
  thisClass.applyCommand3ddomain(lastCommand);
119227
119231
  await ic.annotationCls.setAnnoTabAll();
119228
119232
  }
119229
- else if(lastCommand.indexOf('view interactions') == 0 && me.cfg.align !== undefined) {
119233
+ else if((lastCommand.indexOf('view interactions') == 0 || lastCommand.indexOf('view 2d diagram') == 0) && me.cfg.align !== undefined) {
119230
119234
  await thisClass.applyCommandViewinteraction(lastCommand);
119231
119235
  }
119232
119236
  else if(lastCommand.indexOf('view 2d depiction') == 0) {
@@ -119687,7 +119691,7 @@ class LoadScript {
119687
119691
 
119688
119692
  if(commandTransformation.length == 2 && commandTransformation[1].substr(0,1) == '{') ic.bTransformation = true;
119689
119693
 
119690
- ic.transformCls.resetOrientation_base(commandTransformation);
119694
+ // ic.transformCls.resetOrientation_base(commandTransformation);
119691
119695
 
119692
119696
  ic.selectionCls.oneStructurePerWindow();
119693
119697
 
@@ -119753,8 +119757,12 @@ class LoadScript {
119753
119757
  $("#ncbi_logo").hide();
119754
119758
  }
119755
119759
 
119760
+ ic.transformCls.resetOrientation_base(commandTransformation);
119761
+
119756
119762
  // an extra render to remove artifacts in transparent surface
119757
- if(ic.bTransparentSurface && ic.bRender) ic.drawCls.render();
119763
+ // if(ic.bTransparentSurface && ic.bRender) ic.drawCls.render();
119764
+ ic.drawCls.applyTransformation(ic._zoomFactor, ic.mouseChange, ic.quaternion);
119765
+ ic.drawCls.render();
119758
119766
 
119759
119767
  if(me.cfg.imageonly) ic.saveFileCls.saveFile(undefined, 'png', undefined, true);
119760
119768
 
@@ -132253,7 +132261,7 @@ class iCn3D {
132253
132261
 
132254
132262
  this.transparentRenderOrder = false; // false: regular transparency; true: expensive renderOrder for each face
132255
132263
 
132256
- this.AFUniprotVersion = 'v4';
132264
+ this.AFUniprotVersion = 'v6';
132257
132265
  this.defaultPdbId = 'stru';
132258
132266
 
132259
132267
  if(!this.icn3dui.bNode) {
@@ -132842,7 +132850,7 @@ class iCn3DUI {
132842
132850
  //even when multiple iCn3D viewers are shown together.
132843
132851
  this.pre = this.cfg.divid + "_";
132844
132852
 
132845
- this.REVISION = '3.45.3';
132853
+ this.REVISION = '3.45.4';
132846
132854
 
132847
132855
  // In nodejs, iCn3D defines "window = {navigator: {}}", and added window = {navigator: {}, "__THREE__":"177"}
132848
132856
  this.bNode = (Object.keys(window).length < 3) ? true : false;