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.module.js CHANGED
@@ -56921,9 +56921,9 @@ class MmdbParser {
56921
56921
  let color =(molid2rescount[i].color === undefined) ? '#CCCCCC' : '#' +( '000000' + molid2rescount[i].color.toString( 16 ) ).slice( - 6 );
56922
56922
  let chainName =(molid2rescount[i].chain === undefined) ? '' : molid2rescount[i].chain.trim();
56923
56923
  // remove "_" in chain name
56924
- if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
56924
+ // if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
56925
56925
  chainName = chainName.replace(/_/g, '');
56926
- }
56926
+ // }
56927
56927
 
56928
56928
  if(chainNameHash[chainName] === undefined) {
56929
56929
  chainNameHash[chainName] = 1;
@@ -57336,7 +57336,7 @@ class BcifParser {
57336
57336
 
57337
57337
  let bFull = (atomSize * 10 > ic.maxatomcnt) ? false : true;
57338
57338
 
57339
- let atom_hetatmArray, resnArray, elemArray, nameArray, chainArray, resiArray, resiOriArray, altArray, bArray, xArray, yArray, zArray, autochainArray = [];
57339
+ let atom_hetatmArray, resnArray, elemArray, nameArray, chainArray, resiArray, resiOriArray, altArray, bArray, xArray, yArray, zArray, autochainArray, modelNumArray;
57340
57340
 
57341
57341
  if(!bNoCoord) {
57342
57342
  atom_hetatmArray = atom_site.getColumn("group_PDB");
@@ -57357,6 +57357,7 @@ class BcifParser {
57357
57357
  zArray = atom_site.getColumn("Cartn_z");
57358
57358
 
57359
57359
  autochainArray = atom_site.getColumn("label_asym_id");
57360
+ modelNumArray = atom_site.getColumn("pdbx_PDB_model_num");
57360
57361
 
57361
57362
  // get the bond info
57362
57363
  let ligSeqHash = {}, prevAutochain = '';
@@ -57530,17 +57531,14 @@ class BcifParser {
57530
57531
  text += ", \"atoms\":[\n";
57531
57532
  prevResn = "";
57532
57533
  serial = 1;
57533
-
57534
- let structure = atom_site.getColumn("pdbx_PDB_model_num").getString(0);
57535
-
57536
- if(structure == "1") {
57537
- structure = bcifid;
57538
- }
57539
- else {
57540
- structure = bcifid + structure;
57541
- }
57534
+ let structure = bcifid;
57542
57535
 
57543
57536
  for (let i = 0; i < atomSize; ++i) {
57537
+ let modelNum = modelNumArray.getString(i);
57538
+ if(modelNum != "1" && modelNum != "") {
57539
+ structure = bcifid + modelNum;
57540
+ }
57541
+
57544
57542
  let atom_hetatm = atom_hetatmArray.getString(i);
57545
57543
  let resn = resnArray.getString(i);
57546
57544
  let elem = elemArray.getString(i);
@@ -57739,6 +57737,8 @@ class BcifParser {
57739
57737
  // print sequences
57740
57738
  text += ", \"sequences\":{";
57741
57739
  let bData = false;
57740
+ // need to consider different models in NMR structures
57741
+ // But this function is only used for meta data,
57742
57742
  for(let chain in sChain) {
57743
57743
  let seq;
57744
57744
  if(ligSeqHash.hasOwnProperty(chain)) {
@@ -61672,9 +61672,9 @@ class LoadAtomData {
61672
61672
  let chain = data.moleculeInfor[molid].chain.trim();
61673
61673
 
61674
61674
  // remove "_" in chain name
61675
- if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
61675
+ // if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
61676
61676
  chain = chain.replace(/_/g, '');
61677
- }
61677
+ // }
61678
61678
 
61679
61679
  let chainid = pdbidTmp + '_' + chain;
61680
61680
 
@@ -61816,9 +61816,9 @@ class LoadAtomData {
61816
61816
  atm.chain = atm.chain.trim(); //.replace(/_/g, '');
61817
61817
 
61818
61818
  // remove "_" in chain name
61819
- if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
61819
+ // if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
61820
61820
  atm.chain = atm.chain.replace(/_/g, '');
61821
- }
61821
+ // }
61822
61822
 
61823
61823
  // mmcif has pre-assigned structure in mmcifparser.cgi output
61824
61824
  if(type === 'mmdbid' || type === 'align') {
@@ -64750,13 +64750,13 @@ class LoadCIF {
64750
64750
  // if(!bMutation && !bAppend) {
64751
64751
  if(!bAppend) {
64752
64752
  ic.init();
64753
- moleculeNum = 1;
64753
+ moleculeNum = 0; //1;
64754
64754
  serial = 0;
64755
64755
  }
64756
64756
  else {
64757
64757
  ic.oriNStru = (ic.structures) ? Object.keys(ic.structures).length : 0;
64758
64758
 
64759
- moleculeNum = ic.oriNStru + 1; //Object.keys(ic.structures).length + 1;
64759
+ moleculeNum = ic.oriNStru; //ic.oriNStru + 1; //Object.keys(ic.structures).length + 1;
64760
64760
  // Concatenation of two pdbs will have several atoms for the same serial
64761
64761
  serial = (ic.atoms) ? Object.keys(ic.atoms).length : 0;
64762
64762
  }
@@ -64771,8 +64771,6 @@ class LoadCIF {
64771
64771
 
64772
64772
  let structure = id;
64773
64773
  let CSerial, prevCSerial, OSerial, prevOSerial;
64774
-
64775
- let bFirstAtom = true;
64776
64774
 
64777
64775
  let cifArray = (bText) ? bcifData.split('ENDMDL\n') : [bcifData];
64778
64776
 
@@ -65076,12 +65074,27 @@ class LoadCIF {
65076
65074
  let zArray = atom_site.getColumn("Cartn_z");
65077
65075
 
65078
65076
  let autochainArray = atom_site.getColumn("label_asym_id");
65077
+ let modelNumArray = atom_site.getColumn("pdbx_PDB_model_num");
65079
65078
 
65080
65079
  // get the bond info
65081
65080
  let ligSeqHash = {}, prevAutochain = '';
65082
65081
  let prevResn;
65083
65082
  let sChain = {};
65083
+ let prevModelNum = '';
65084
65084
  for (let i = 0; i < atomSize; ++i) {
65085
+ let modelNum = modelNumArray.getString(i);
65086
+ if(i > 0 && modelNum != prevModelNum) {
65087
+ ++moleculeNum;
65088
+
65089
+ if(modelNum == "1") {
65090
+ structure = id;
65091
+ }
65092
+ else {
65093
+ structure = id + modelNum;
65094
+ }
65095
+ }
65096
+ prevModelNum = modelNum;
65097
+
65085
65098
  let atom_hetatm = atom_hetatmArray.getString(i);
65086
65099
  let resn = resnArray.getString(i);
65087
65100
  let elem = elemArray.getString(i);
@@ -65126,11 +65139,11 @@ class LoadCIF {
65126
65139
 
65127
65140
  sChain[chain] = 1;
65128
65141
 
65129
- if(bFirstAtom) {
65130
- structure = ic.loadPDBCls.getStructureId(id, moleculeNum);
65142
+ // if(bFirstAtom) {
65143
+ // structure = ic.loadPDBCls.getStructureId(id, moleculeNum);
65131
65144
 
65132
- bFirstAtom = false;
65133
- }
65145
+ // bFirstAtom = false;
65146
+ // }
65134
65147
 
65135
65148
  // "CA" has to appear before "O". Otherwise the cartoon of secondary structure will have breaks
65136
65149
  // Concatenation of two pdbs will have several atoms for the same serial
@@ -68731,6 +68744,12 @@ class DefinedSets {
68731
68744
  let prevLabel = 'or';
68732
68745
 
68733
68746
  for(let i = 0, il = idArray.length; i < il; ++i) {
68747
+ // replace 1CD8_A_1 with 1CD8_A1
68748
+ let tmpArray = idArray[i].split('_');
68749
+ if(tmpArray.length == 3 && !isNaN(tmpArray[2])) {
68750
+ idArray[i] = tmpArray[0] + '_' + tmpArray[1] + tmpArray[2];
68751
+ }
68752
+
68734
68753
  if(idArray[i] === 'or' || idArray[i] === 'and' || idArray[i] === 'not') {
68735
68754
  prevLabel = idArray[i];
68736
68755
  continue;
@@ -70260,6 +70279,7 @@ class SelectByCommand {
70260
70279
  }
70261
70280
  else {
70262
70281
  chainStr = testStr.substr(periodPos + 1);
70282
+
70263
70283
  //replace "A_1" with "A"
70264
70284
  chainStr = chainStr.replace(/_/g, '');
70265
70285
 
@@ -70387,7 +70407,6 @@ class SelectByCommand {
70387
70407
 
70388
70408
  for(let l = 0, ll = residArray.length; l < ll; ++l) {
70389
70409
  let residueId = residArray[l];
70390
-
70391
70410
  if(i === 0) {
70392
70411
  residueHash[residueId] = 1;
70393
70412
  }
@@ -83103,7 +83122,7 @@ class iCn3DUI {
83103
83122
  //even when multiple iCn3D viewers are shown together.
83104
83123
  this.pre = this.cfg.divid + "_";
83105
83124
 
83106
- this.REVISION = '3.36.0';
83125
+ this.REVISION = '3.36.1';
83107
83126
 
83108
83127
  // In nodejs, iCn3D defines "window = {navigator: {}}"
83109
83128
  this.bNode = (Object.keys(window).length < 2) ? true : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.36.1",
3
+ "version": "3.36.2",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {