icn3d 3.36.1 → 3.36.2

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
@@ -56020,9 +56020,9 @@ class MmdbParser {
56020
56020
  let color =(molid2rescount[i].color === undefined) ? '#CCCCCC' : '#' +( '000000' + molid2rescount[i].color.toString( 16 ) ).slice( - 6 );
56021
56021
  let chainName =(molid2rescount[i].chain === undefined) ? '' : molid2rescount[i].chain.trim();
56022
56022
  // remove "_" in chain name
56023
- if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
56023
+ // if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
56024
56024
  chainName = chainName.replace(/_/g, '');
56025
- }
56025
+ // }
56026
56026
 
56027
56027
  if(chainNameHash[chainName] === undefined) {
56028
56028
  chainNameHash[chainName] = 1;
@@ -56435,7 +56435,7 @@ class BcifParser {
56435
56435
 
56436
56436
  let bFull = (atomSize * 10 > ic.maxatomcnt) ? false : true;
56437
56437
 
56438
- let atom_hetatmArray, resnArray, elemArray, nameArray, chainArray, resiArray, resiOriArray, altArray, bArray, xArray, yArray, zArray, autochainArray = [];
56438
+ let atom_hetatmArray, resnArray, elemArray, nameArray, chainArray, resiArray, resiOriArray, altArray, bArray, xArray, yArray, zArray, autochainArray, modelNumArray;
56439
56439
 
56440
56440
  if(!bNoCoord) {
56441
56441
  atom_hetatmArray = atom_site.getColumn("group_PDB");
@@ -56456,6 +56456,7 @@ class BcifParser {
56456
56456
  zArray = atom_site.getColumn("Cartn_z");
56457
56457
 
56458
56458
  autochainArray = atom_site.getColumn("label_asym_id");
56459
+ modelNumArray = atom_site.getColumn("pdbx_PDB_model_num");
56459
56460
 
56460
56461
  // get the bond info
56461
56462
  let ligSeqHash = {}, prevAutochain = '';
@@ -56629,17 +56630,14 @@ class BcifParser {
56629
56630
  text += ", \"atoms\":[\n";
56630
56631
  prevResn = "";
56631
56632
  serial = 1;
56632
-
56633
- let structure = atom_site.getColumn("pdbx_PDB_model_num").getString(0);
56634
-
56635
- if(structure == "1") {
56636
- structure = bcifid;
56637
- }
56638
- else {
56639
- structure = bcifid + structure;
56640
- }
56633
+ let structure = bcifid;
56641
56634
 
56642
56635
  for (let i = 0; i < atomSize; ++i) {
56636
+ let modelNum = modelNumArray.getString(i);
56637
+ if(modelNum != "1" && modelNum != "") {
56638
+ structure = bcifid + modelNum;
56639
+ }
56640
+
56643
56641
  let atom_hetatm = atom_hetatmArray.getString(i);
56644
56642
  let resn = resnArray.getString(i);
56645
56643
  let elem = elemArray.getString(i);
@@ -56838,6 +56836,8 @@ class BcifParser {
56838
56836
  // print sequences
56839
56837
  text += ", \"sequences\":{";
56840
56838
  let bData = false;
56839
+ // need to consider different models in NMR structures
56840
+ // But this function is only used for meta data,
56841
56841
  for(let chain in sChain) {
56842
56842
  let seq;
56843
56843
  if(ligSeqHash.hasOwnProperty(chain)) {
@@ -60771,9 +60771,9 @@ class LoadAtomData {
60771
60771
  let chain = data.moleculeInfor[molid].chain.trim();
60772
60772
 
60773
60773
  // remove "_" in chain name
60774
- if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
60774
+ // if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
60775
60775
  chain = chain.replace(/_/g, '');
60776
- }
60776
+ // }
60777
60777
 
60778
60778
  let chainid = pdbidTmp + '_' + chain;
60779
60779
 
@@ -60915,9 +60915,9 @@ class LoadAtomData {
60915
60915
  atm.chain = atm.chain.trim(); //.replace(/_/g, '');
60916
60916
 
60917
60917
  // remove "_" in chain name
60918
- if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
60918
+ // if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
60919
60919
  atm.chain = atm.chain.replace(/_/g, '');
60920
- }
60920
+ // }
60921
60921
 
60922
60922
  // mmcif has pre-assigned structure in mmcifparser.cgi output
60923
60923
  if(type === 'mmdbid' || type === 'align') {
@@ -63849,13 +63849,13 @@ class LoadCIF {
63849
63849
  // if(!bMutation && !bAppend) {
63850
63850
  if(!bAppend) {
63851
63851
  ic.init();
63852
- moleculeNum = 1;
63852
+ moleculeNum = 0; //1;
63853
63853
  serial = 0;
63854
63854
  }
63855
63855
  else {
63856
63856
  ic.oriNStru = (ic.structures) ? Object.keys(ic.structures).length : 0;
63857
63857
 
63858
- moleculeNum = ic.oriNStru + 1; //Object.keys(ic.structures).length + 1;
63858
+ moleculeNum = ic.oriNStru; //ic.oriNStru + 1; //Object.keys(ic.structures).length + 1;
63859
63859
  // Concatenation of two pdbs will have several atoms for the same serial
63860
63860
  serial = (ic.atoms) ? Object.keys(ic.atoms).length : 0;
63861
63861
  }
@@ -63870,8 +63870,6 @@ class LoadCIF {
63870
63870
 
63871
63871
  let structure = id;
63872
63872
  let CSerial, prevCSerial, OSerial, prevOSerial;
63873
-
63874
- let bFirstAtom = true;
63875
63873
 
63876
63874
  let cifArray = (bText) ? bcifData.split('ENDMDL\n') : [bcifData];
63877
63875
 
@@ -64175,12 +64173,27 @@ class LoadCIF {
64175
64173
  let zArray = atom_site.getColumn("Cartn_z");
64176
64174
 
64177
64175
  let autochainArray = atom_site.getColumn("label_asym_id");
64176
+ let modelNumArray = atom_site.getColumn("pdbx_PDB_model_num");
64178
64177
 
64179
64178
  // get the bond info
64180
64179
  let ligSeqHash = {}, prevAutochain = '';
64181
64180
  let prevResn;
64182
64181
  let sChain = {};
64182
+ let prevModelNum = '';
64183
64183
  for (let i = 0; i < atomSize; ++i) {
64184
+ let modelNum = modelNumArray.getString(i);
64185
+ if(i > 0 && modelNum != prevModelNum) {
64186
+ ++moleculeNum;
64187
+
64188
+ if(modelNum == "1") {
64189
+ structure = id;
64190
+ }
64191
+ else {
64192
+ structure = id + modelNum;
64193
+ }
64194
+ }
64195
+ prevModelNum = modelNum;
64196
+
64184
64197
  let atom_hetatm = atom_hetatmArray.getString(i);
64185
64198
  let resn = resnArray.getString(i);
64186
64199
  let elem = elemArray.getString(i);
@@ -64225,11 +64238,11 @@ class LoadCIF {
64225
64238
 
64226
64239
  sChain[chain] = 1;
64227
64240
 
64228
- if(bFirstAtom) {
64229
- structure = ic.loadPDBCls.getStructureId(id, moleculeNum);
64241
+ // if(bFirstAtom) {
64242
+ // structure = ic.loadPDBCls.getStructureId(id, moleculeNum);
64230
64243
 
64231
- bFirstAtom = false;
64232
- }
64244
+ // bFirstAtom = false;
64245
+ // }
64233
64246
 
64234
64247
  // "CA" has to appear before "O". Otherwise the cartoon of secondary structure will have breaks
64235
64248
  // Concatenation of two pdbs will have several atoms for the same serial
@@ -67830,6 +67843,12 @@ class DefinedSets {
67830
67843
  let prevLabel = 'or';
67831
67844
 
67832
67845
  for(let i = 0, il = idArray.length; i < il; ++i) {
67846
+ // replace 1CD8_A_1 with 1CD8_A1
67847
+ let tmpArray = idArray[i].split('_');
67848
+ if(tmpArray.length == 3 && !isNaN(tmpArray[2])) {
67849
+ idArray[i] = tmpArray[0] + '_' + tmpArray[1] + tmpArray[2];
67850
+ }
67851
+
67833
67852
  if(idArray[i] === 'or' || idArray[i] === 'and' || idArray[i] === 'not') {
67834
67853
  prevLabel = idArray[i];
67835
67854
  continue;
@@ -69359,6 +69378,7 @@ class SelectByCommand {
69359
69378
  }
69360
69379
  else {
69361
69380
  chainStr = testStr.substr(periodPos + 1);
69381
+
69362
69382
  //replace "A_1" with "A"
69363
69383
  chainStr = chainStr.replace(/_/g, '');
69364
69384
 
@@ -69486,7 +69506,6 @@ class SelectByCommand {
69486
69506
 
69487
69507
  for(let l = 0, ll = residArray.length; l < ll; ++l) {
69488
69508
  let residueId = residArray[l];
69489
-
69490
69509
  if(i === 0) {
69491
69510
  residueHash[residueId] = 1;
69492
69511
  }
@@ -82202,7 +82221,7 @@ class iCn3DUI {
82202
82221
  //even when multiple iCn3D viewers are shown together.
82203
82222
  this.pre = this.cfg.divid + "_";
82204
82223
 
82205
- this.REVISION = '3.36.0';
82224
+ this.REVISION = '3.36.1';
82206
82225
 
82207
82226
  // In nodejs, iCn3D defines "window = {navigator: {}}"
82208
82227
  this.bNode = (Object.keys(window).length < 2) ? true : false;