icn3d 3.40.3 → 3.40.5

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
@@ -10822,12 +10822,17 @@ class ClickMenu {
10822
10822
  // var aaa = 1; //alert("The url is more than 4000 characters and may not work.");
10823
10823
  //}
10824
10824
  //else {
10825
- url = url.replace("icn3d/full.html?", "icn3d/full2.html?");
10825
+ // url = url.replace("icn3d/full.html?", "icn3d/full2.html?");
10826
+
10827
+ url = url.replace(/icn3d\/full[_\d\.]*\.html\?/, "icn3d/full2.html?");
10828
+
10826
10829
  url = url.replace("icn3d/?", "icn3d/full2.html?");
10830
+
10827
10831
  url += '&closepopup=1';
10828
10832
  let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
10829
10833
  window.open(url, urlTarget);
10830
- thisClass.setLogCmd('side by side | ' + url, true);
10834
+ // thisClass.setLogCmd('side by side | ' + url, true);
10835
+ thisClass.setLogCmd('side by side | ' + url, false);
10831
10836
  //}
10832
10837
  });
10833
10838
 
@@ -33249,7 +33254,6 @@ ElectronMap.prototype.fillvoxels = function(atoms, atomlist) { //(int seqinit,in
33249
33254
  //this.vpAtomID[index] =(this.dataArray[index] >= 0) ? 1 : 0; // determine whether it's positive
33250
33255
  }
33251
33256
  }
33252
-
33253
33257
  }
33254
33258
  }
33255
33259
 
@@ -59641,12 +59645,15 @@ class DensityCifParser {
59641
59645
  let thisClass = this;
59642
59646
 
59643
59647
  let url;
59644
- let detail = (me.utilsCls.isMobile() || me.cfg.notebook) ? 0 : 4; //4;
59648
+ let detail = (me.utilsCls.isMobile() || me.cfg.notebook) ? 2 : 4; //0 : 4;
59645
59649
 
59646
59650
  //https://www.ebi.ac.uk/pdbe/densities/doc.html
59647
59651
  if(type == '2fofc' || type == 'fofc') {
59648
- detail = 0;
59649
- url = "https://www.ebi.ac.uk/pdbe/densities/x-ray/" + pdbid.toLowerCase() + "/cell?detail=" + detail;
59652
+ //detail = 0;
59653
+
59654
+ // url = "https://www.ebi.ac.uk/pdbe/densities/x-ray/" + pdbid.toLowerCase() + "/cell?detail=" + detail;
59655
+ let min_max = ic.contactCls.getExtent(ic.atoms);
59656
+ url = "https://www.ebi.ac.uk/pdbe/volume-server/x-ray/" + pdbid.toLowerCase() + "/box/" + min_max[0][0] + "," + min_max[0][1] + "," + min_max[0][2] + "/" + min_max[1][0] + "," + min_max[1][1] + "," + min_max[1][2] + "?detail=" + detail;
59650
59657
  }
59651
59658
  else if(type == 'em') {
59652
59659
  url = "https://www.ebi.ac.uk/pdbe/densities/emd/" + emd.toLowerCase() + "/cell?detail=" + detail;
@@ -59719,6 +59726,33 @@ class DensityCifParser {
59719
59726
  // return sigma;
59720
59727
  }
59721
59728
 
59729
+ setMatrix(density) { let ic = this.icn3d; ic.icn3dui;
59730
+ let sampleCount = density.box.sampleCount;
59731
+ let header = {xExtent: sampleCount[0], yExtent: sampleCount[1], zExtent: sampleCount[2], mean: density.valuesInfo.mean, sigma: density.valuesInfo.sigma, max: density.valuesInfo.max, min: density.valuesInfo.min};
59732
+ for(let i = 0; i < density.data.length; ++i) {
59733
+ density.data[i];
59734
+ }
59735
+
59736
+ let origin = density.box.origin;
59737
+ let dimensions = density.box.dimensions;
59738
+ let basis = density.spacegroup.basis;
59739
+ let scale = new THREE.Matrix4().makeScale(
59740
+ dimensions[0] / (sampleCount[0] ),
59741
+ dimensions[1] / (sampleCount[1] ),
59742
+ dimensions[2] / (sampleCount[2] ));
59743
+ let translate = new THREE.Matrix4().makeTranslation(origin[0], origin[1], origin[2]);
59744
+ let fromFrac = new THREE.Matrix4().set(
59745
+ basis.x[0], basis.y[0], basis.z[0], 0.0,
59746
+ 0.0, basis.y[1], basis.z[1], 0.0,
59747
+ 0.0, 0.0, basis.z[2], 0.0,
59748
+ 0.0, 0.0, 0.0, 1.0);
59749
+
59750
+ //var toFrac = new LiteMol.Visualization.THREE.Matrix4().getInverse(fromFrac);
59751
+ let matrix = fromFrac.multiply(translate).multiply(scale);
59752
+
59753
+ return {matrix: matrix, header: header};
59754
+ }
59755
+
59722
59756
  parseChannels(densitydata, type, sigma) { let ic = this.icn3d; ic.icn3dui;
59723
59757
  let cif = this.BinaryParse(densitydata);
59724
59758
 
@@ -59728,92 +59762,35 @@ class DensityCifParser {
59728
59762
 
59729
59763
  // '2fofc'
59730
59764
  let density = twoDensity;
59731
- let sampleCount = density.box.sampleCount;
59732
- let header = {xExtent: sampleCount[0], yExtent: sampleCount[1], zExtent: sampleCount[2], mean: density.valuesInfo.mean, sigma: density.valuesInfo.sigma};
59733
- ic.mapData.header2 = header;
59734
-
59735
- ic.mapData.data2 = density.data;
59736
- for(let i = 0; i < density.data.length; ++i) {
59737
- density.data[i];
59738
- }
59739
-
59740
- let origin = density.box.origin;
59741
- let dimensions = density.box.dimensions;
59742
- let basis = density.spacegroup.basis;
59743
- let scale = new THREE.Matrix4().makeScale(
59744
- dimensions[0] / (sampleCount[0] ),
59745
- dimensions[1] / (sampleCount[1] ),
59746
- dimensions[2] / (sampleCount[2] ));
59747
- let translate = new THREE.Matrix4().makeTranslation(origin[0], origin[1], origin[2]);
59748
- let fromFrac = new THREE.Matrix4().set(
59749
- basis.x[0], basis.y[0], basis.z[0], 0.0,
59750
- 0.0, basis.y[1], basis.z[1], 0.0,
59751
- 0.0, 0.0, basis.z[2], 0.0,
59752
- 0.0, 0.0, 0.0, 1.0);
59753
-
59754
- //var toFrac = new LiteMol.Visualization.THREE.Matrix4().getInverse(fromFrac);
59755
- let matrix = fromFrac.multiply(translate).multiply(scale);
59765
+ let result = this.setMatrix(density);
59756
59766
 
59757
- ic.mapData.matrix2 = matrix;
59767
+ ic.mapData.matrix2 = result.matrix;
59768
+ ic.mapData.header2 = result.header;
59758
59769
 
59770
+ ic.mapData.data2 = density.data;
59759
59771
  ic.mapData.type2 = type;
59760
59772
  ic.mapData.sigma2 = sigma;
59761
59773
 
59762
59774
  // 'fofc'
59763
59775
  density = oneDensity;
59764
- sampleCount = density.box.sampleCount;
59765
- header = {xExtent: sampleCount[0], yExtent: sampleCount[1], zExtent: sampleCount[2], mean: density.valuesInfo.mean, sigma: density.valuesInfo.sigma};
59766
- ic.mapData.header = header;
59776
+ result = this.setMatrix(density);
59767
59777
 
59768
- ic.mapData.data = density.data;
59769
-
59770
- origin = density.box.origin;
59771
- dimensions = density.box.dimensions;
59772
- basis = density.spacegroup.basis;
59773
-
59774
- scale = new THREE.Matrix4().makeScale(
59775
- dimensions[0] / (sampleCount[0] ),
59776
- dimensions[1] / (sampleCount[1] ),
59777
- dimensions[2] / (sampleCount[2] ));
59778
- translate = new THREE.Matrix4().makeTranslation(origin[0], origin[1], origin[2]);
59779
- fromFrac = new THREE.Matrix4().set(
59780
- basis.x[0], basis.y[0], basis.z[0], 0.0,
59781
- 0.0, basis.y[1], basis.z[1], 0.0,
59782
- 0.0, 0.0, basis.z[2], 0.0,
59783
- 0.0, 0.0, 0.0, 1.0);
59784
- //var toFrac = new LiteMol.Visualization.THREE.Matrix4().getInverse(fromFrac);
59785
- matrix = fromFrac.multiply(translate).multiply(scale);
59786
- ic.mapData.matrix = matrix;
59778
+ ic.mapData.matrix = result.matrix;
59779
+ ic.mapData.header = result.header;
59787
59780
 
59781
+ ic.mapData.data = density.data;
59788
59782
  ic.mapData.type = type;
59789
59783
  ic.mapData.sigma = sigma;
59790
59784
  }
59791
59785
  else if(type == 'em') {
59792
59786
  let density = this.getChannel(cif, 'EM');
59793
59787
 
59794
- let sampleCount = density.box.sampleCount;
59795
- let header = {xExtent: sampleCount[0], yExtent: sampleCount[1], zExtent: sampleCount[2], max: density.valuesInfo.max, min: density.valuesInfo.min};
59796
- ic.mapData.headerEm = header;
59797
-
59798
- ic.mapData.dataEm = density.data;
59788
+ let result = this.setMatrix(density);
59799
59789
 
59800
- let origin = density.box.origin;
59801
- let dimensions = density.box.dimensions;
59802
- let basis = density.spacegroup.basis;
59803
- let scale = new THREE.Matrix4().makeScale(
59804
- dimensions[0] / (sampleCount[0] ),
59805
- dimensions[1] / (sampleCount[1] ),
59806
- dimensions[2] / (sampleCount[2] ));
59807
- let translate = new THREE.Matrix4().makeTranslation(origin[0], origin[1], origin[2]);
59808
- let fromFrac = new THREE.Matrix4().set(
59809
- basis.x[0], basis.y[0], basis.z[0], 0.0,
59810
- 0.0, basis.y[1], basis.z[1], 0.0,
59811
- 0.0, 0.0, basis.z[2], 0.0,
59812
- 0.0, 0.0, 0.0, 1.0);
59813
- //var toFrac = new LiteMol.Visualization.THREE.Matrix4().getInverse(fromFrac);
59814
- let matrix = fromFrac.multiply(translate).multiply(scale);
59815
- ic.mapData.matrixEm = matrix;
59790
+ ic.mapData.matrixEm = result.matrix;
59791
+ ic.mapData.headerEm = result.header;
59816
59792
 
59793
+ ic.mapData.dataEm = density.data;
59817
59794
  ic.mapData.typeEm = type;
59818
59795
  ic.mapData.sigmaEm = sigma;
59819
59796
  }
@@ -72563,7 +72540,7 @@ class Dssp {
72563
72540
  // assign Ig types
72564
72541
  ic.ref2igtype = {};
72565
72542
 
72566
- ic.ref2igtype['ASF1A_2iijA_human'] = 'IgE';
72543
+ ic.ref2igtype['ASF1A_2iijA_human'] = 'IgFN3-like';
72567
72544
  ic.ref2igtype['B2Microglobulin_7phrL_human_C1'] = 'IgC1';
72568
72545
  ic.ref2igtype['BArrestin1_4jqiA_rat_n1'] = 'IgFN3-like';
72569
72546
  ic.ref2igtype['BTLA_2aw2A_human_Iset'] = 'IgI';
@@ -72598,7 +72575,7 @@ class Dssp {
72598
72575
  ic.ref2igtype['LAG3_7tzgD_human_V-n1'] = 'IgV';
72599
72576
  ic.ref2igtype['LaminAC_1ifrA_human'] = 'Lamin';
72600
72577
  ic.ref2igtype['MHCIa_7phrH_human_C1'] = 'IgC1';
72601
- ic.ref2igtype['MPT63_1lmiA_bacteria'] = 'IgE';
72578
+ ic.ref2igtype['MPT63_1lmiA_bacteria'] = 'IgFN3-like';
72602
72579
  ic.ref2igtype['NaCaExchanger_2fwuA_dog_n2'] = 'IgFN3-like';
72603
72580
  ic.ref2igtype['NaKATPaseTransporterBeta_2zxeB_spurdogshark'] = 'IgE';
72604
72581
  ic.ref2igtype['ORF7a_1xakA_virus'] = 'ORF';
@@ -72611,7 +72588,7 @@ class Dssp {
72611
72588
  ic.ref2igtype['Siglec3_5j0bB_human_C1-n2'] = 'IgC1';
72612
72589
  ic.ref2igtype['TCRa_6jxrm_human_C1-n2'] = 'IgC1';
72613
72590
  ic.ref2igtype['TCRa_6jxrm_human_V-n1'] = 'IgV';
72614
- ic.ref2igtype['TEAD1_3kysC_human'] = 'IgE';
72591
+ ic.ref2igtype['TEAD1_3kysC_human'] = 'IgFN3-like';
72615
72592
  ic.ref2igtype['TP34_2o6cA_bacteria'] = 'IgE';
72616
72593
  ic.ref2igtype['TP47_1o75A_bacteria'] = 'IgE';
72617
72594
  ic.ref2igtype['Titin_4uowM_human_Iset-n152'] = 'IgI';
@@ -79006,6 +78983,8 @@ class SaveFile {
79006
78983
  for(let i = 0, il = residueArray.length; i < il; ++i) {
79007
78984
  let resid = residueArray[i];
79008
78985
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
78986
+ if(!atom) continue;
78987
+
79009
78988
  let chainid = atom.structure + '_' + atom.chain;
79010
78989
  let resnAbbr = me.utilsCls.residueName2Abbr(atom.resn);
79011
78990
  let resName = resnAbbr + atom.resi;
@@ -82986,7 +82965,7 @@ class iCn3DUI {
82986
82965
  //even when multiple iCn3D viewers are shown together.
82987
82966
  this.pre = this.cfg.divid + "_";
82988
82967
 
82989
- this.REVISION = '3.40.3';
82968
+ this.REVISION = '3.40.5';
82990
82969
 
82991
82970
  // In nodejs, iCn3D defines "window = {navigator: {}}"
82992
82971
  this.bNode = (Object.keys(window).length < 2) ? true : false;