icn3d 3.37.0 → 3.37.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
@@ -11102,9 +11102,9 @@ class ClickMenu {
11102
11102
 
11103
11103
  $("#" + me.pre + "newvs2").on('submit', function() {
11104
11104
  // fill the pdbstr
11105
- let pdbstr = ic.saveFileCls.getAtomPDB(ic.hAtoms);
11105
+ let bVastSearch = true;
11106
+ let pdbstr = ic.saveFileCls.getAtomPDB(ic.hAtoms, undefined, undefined, undefined, undefined, undefined, undefined, bVastSearch);
11106
11107
  $("#" + me.pre + "pdbstr").val(pdbstr);
11107
-
11108
11108
  return true;
11109
11109
  });
11110
11110
 
@@ -14017,7 +14017,7 @@ class SetDialog {
14017
14017
  html += '<div style="width:550px;">You can define your own reference numbers in a custom file using Excel, and then export it as a CSV file. An example file is shown below with cells separated by commas.<br>';
14018
14018
  html += '<pre>refnum,11,12,,21,22,,10C,11C,20C<br>';
14019
14019
  html += '1TUP_A,100,101,,,132,,,,<br>';
14020
- html += '1TUP_B,110,111,,141,142,,,,</pre>';
14020
+ html += '1TUP_B,110,111,,141,142,,,,<br>';
14021
14021
  html += '1TUP_C,,,,,,,200,201,230</pre>';
14022
14022
  html += 'The first row defines the reference residue numbers, which could be any strings. The 1st cell could be anything. The rest cells are reference residue numbers (e.g., 11, 21, 10C, etc.) or empty cells. Each chain has a separate row. The first cell of the second row is the chain ID "1TUP_A". The rest cells are the corresponding real residue numbers for reference residue numbers in the first row. For example, the reference numbers for residues 100, 101, and 132 in the chain 1TUP_A are 11, 12, and 22, respectively. The fourth row shows another set of reference numners for the chain "1TUP_C". It could be a chain from a different structure.<br><br>';
14023
14023
  html += 'To select all residues corresponding to the reference numbers, you can simplay replace ":" with "%" in the <a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#selectb" target="_blank">Specification</a>. For example, "%12" selects the residue 101 in 1TUP_A and the residue 111 in 1TUP_B. ".A%12" has the chain "A" filter and selects the residue 101 in 1TUP_A.<br>';
@@ -19269,8 +19269,8 @@ class SetHtml {
19269
19269
  });
19270
19270
  }
19271
19271
 
19272
- // async loadPng(imageStr, command) { let me = this.icn3dui, ic = me.icn3d;
19273
- async loadPng(imageStr) { let me = this.icn3dui, ic = me.icn3d;
19272
+ async loadPng(imageStr, command, bRender) { let me = this.icn3dui, ic = me.icn3d;
19273
+ // async loadPng(imageStr) { let me = this.icn3dui, ic = me.icn3d;
19274
19274
  let matchedStr = 'Share Link: ';
19275
19275
  let pos = imageStr.indexOf(matchedStr);
19276
19276
  let matchedStrState = "Start of state file======\n";
@@ -19291,8 +19291,8 @@ class SetHtml {
19291
19291
  let posData = imageStr.indexOf(matchedStrData);
19292
19292
  ic.bInputfile =(posData == -1) ? false : true;
19293
19293
  ic.bInputPNGWithData = ic.bInputfile;
19294
- // let commandStr = (command) ? command.replace(/;/g, "\n") : '';
19295
- let commandStr = '';
19294
+ let commandStr = (command) ? command.replace(/;/g, "\n") : '';
19295
+ // let commandStr = '';
19296
19296
 
19297
19297
  // let statefile;
19298
19298
  // if(ic.bInputfile) {
@@ -19313,31 +19313,37 @@ class SetHtml {
19313
19313
  //statefile = decodeURIComponent(statefile);
19314
19314
  statefile = decodeURIComponent(statefile + "\n" + commandStr);
19315
19315
 
19316
- /*
19317
- if(type === 'pdb') {
19318
- await ic.pdbParserCls.loadPdbData(data);
19316
+ if(bRender) {
19317
+ if(type === 'pdb') {
19318
+ await ic.pdbParserCls.loadPdbData(data);
19319
19319
 
19320
- ic.commands = [];
19321
- ic.optsHistory = [];
19322
- //await ic.loadScriptCls.loadScript(statefile, true);
19323
- }
19324
- else {
19325
- if(type === 'mol2') {
19326
- await ic.mol2ParserCls.loadMol2Data(data);
19327
- }
19328
- else if(type === 'sdf') {
19329
- await ic.sdfParserCls.loadSdfData(data);
19320
+ ic.commands = [];
19321
+ ic.optsHistory = [];
19322
+ //await ic.loadScriptCls.loadScript(statefile, true);
19330
19323
  }
19331
- else if(type === 'xyz') {
19332
- await ic.xyzParserCls.loadXyzData(data);
19333
- }
19334
- else if(type === 'mmcif') {
19335
- await ic.mmcifParserCls.loadMmcifData(data);
19324
+ else {
19325
+ if(type === 'mol2') {
19326
+ await ic.mol2ParserCls.loadMol2Data(data);
19327
+ }
19328
+ else if(type === 'sdf') {
19329
+ await ic.sdfParserCls.loadSdfData(data);
19330
+ }
19331
+ else if(type === 'xyz') {
19332
+ await ic.xyzParserCls.loadXyzData(data);
19333
+ }
19334
+ else if(type === 'mmcif') {
19335
+ await ic.mmcifParserCls.loadMmcifData(data);
19336
+ }
19337
+ ic.commands = [];
19338
+ ic.optsHistory = [];
19339
+ //await ic.loadScriptCls.loadScript(statefile, true);
19336
19340
  }
19337
- ic.commands = [];
19338
- ic.optsHistory = [];
19339
- //await ic.loadScriptCls.loadScript(statefile, true);
19340
- }
19341
+
19342
+ await ic.loadScriptCls.loadScript(statefile, true);
19343
+
19344
+ // me.htmlCls.clickMenuCls.setLogCmd('load iCn3D PNG image ' + $("#" + me.pre + "pngimage").val(), false);
19345
+ }
19346
+ /*
19341
19347
  }
19342
19348
  else { // url length > 4000
19343
19349
  //var matchedStrState = "Start of state file======\n";
@@ -42102,8 +42108,6 @@ class AnnoDomain {
42102
42108
  }
42103
42109
  }
42104
42110
 
42105
- if(bNotShowDomain) continue;
42106
-
42107
42111
  // save 3D domain info for node.js script
42108
42112
  if(me.bNode) {
42109
42113
  let domainName = '3D domain ' +(index+1).toString();
@@ -42118,13 +42122,15 @@ class AnnoDomain {
42118
42122
  // 0-based
42119
42123
  let obj = {};
42120
42124
  // let resi = ic.ParserUtilsCls.getResi(chnid, j);
42121
- let resid = ic.ncbi2resid(chnid + '_' + j);
42125
+ let resid = ic.ncbi2resid[chnid + '_' + j];
42122
42126
  obj[resid] = domainName;
42123
42127
  ic.resid2domain[chnid].push(obj);
42124
42128
  }
42125
42129
  }
42126
42130
  }
42127
42131
 
42132
+ if(bNotShowDomain) continue;
42133
+
42128
42134
  let htmlTmp2 = '<div class="icn3d-seqTitle icn3d-link icn3d-blue" 3ddomain="' +(index+1).toString() + '" from="' + fromArray + '" to="' + toArray + '" shorttitle="' + title + '" index="' + index + '" setname="' + chnid + '_3d_domain_' +(index+1).toString() + '" anno="sequence" chain="' + chnid + '" title="' + fulltitle + '">' + title + ' </div>';
42129
42135
  let htmlTmp3 = '<span class="icn3d-residueNum" title="residue count">' + resCnt.toString() + ' Res</span>';
42130
42136
  html3 += htmlTmp2 + htmlTmp3 + '<br>';
@@ -49705,7 +49711,7 @@ class LineGraph {
49705
49711
  }
49706
49712
  else {
49707
49713
  ++linkedNodeCnt[mappingid];
49708
- linkedNodeInterDiff[mappingid] += link.n;
49714
+ linkedNodeInterDiff[mappingid] += link.n;
49709
49715
 
49710
49716
  linkedNodeInterDiffBool[mappingid] = (linkedNodeInterDiff[mappingid] / link.n == linkedNodeCnt[mappingid]) ? 0 : 1;
49711
49717
  }
@@ -49759,7 +49765,7 @@ class LineGraph {
49759
49765
  let linkDiff = me.hashUtilsCls.cloneHash(link);
49760
49766
  linkDiff.source += separatorDiff + ic.chainsMapping[chainid1][resid1];
49761
49767
  linkDiff.target += separatorDiff + ic.chainsMapping[chainid2][resid2];
49762
-
49768
+
49763
49769
  if(linkedNodeCnt[mappingid] == structureArray.length && (bIgRef || linkedNodeInterDiffBool[mappingid] == 0)) {
49764
49770
  linkArraySplitCommon[index].push(linkCommon);
49765
49771
  }
@@ -50452,6 +50458,7 @@ class GetGraph {
50452
50458
  nodeArray2.push(node);
50453
50459
  }
50454
50460
  }
50461
+
50455
50462
  // sort array
50456
50463
  nodeArray1.sort(function(a,b) {
50457
50464
  return thisClass.compNode(a, b);
@@ -50459,6 +50466,7 @@ class GetGraph {
50459
50466
  nodeArray2.sort(function(a,b) {
50460
50467
  return thisClass.compNode(a, b, bReverseNode);
50461
50468
  });
50469
+
50462
50470
  return {"nodeArray1": nodeArray1, "nodeArray2": nodeArray2, "name2node": name2nodeCommon};
50463
50471
  }
50464
50472
  updateGraphJson(struc, index, nodeArray1, nodeArray2, linkArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -50763,7 +50771,9 @@ class GetGraph {
50763
50771
  }
50764
50772
 
50765
50773
  for(let linkStr in linkstr2cnt) {
50766
- hbondStr += ', {' + linkStr + ', "n": ' + linkstr2cnt[linkStr] + '}';
50774
+ // do not differentiate the number of contacts
50775
+ let n = (value == me.htmlCls.contactInsideValue || value == me.htmlCls.contactValue) ? 1 : linkstr2cnt[linkStr];
50776
+ hbondStr += ', {' + linkStr + ', "n": ' + n + '}';
50767
50777
  }
50768
50778
 
50769
50779
  return hbondStr;
@@ -57603,8 +57613,7 @@ class PdbParser {
57603
57613
  await ic.mmcifParserCls.loadMmcifData(data);
57604
57614
  }
57605
57615
  else if(type === 'icn3dpng') {
57606
- // await me.htmlCls.setHtmlCls.loadPng(data, command);
57607
- await me.htmlCls.setHtmlCls.loadPng(data);
57616
+ await me.htmlCls.setHtmlCls.loadPng(data, command, true);
57608
57617
  }
57609
57618
  else if(type === 'pae') {
57610
57619
  me.htmlCls.dialogCls.openDlg('dl_alignerrormap', 'Show Predicted Aligned Error (PAE) map');
@@ -57734,7 +57743,7 @@ class PdbParser {
57734
57743
  }
57735
57744
 
57736
57745
  async execStatefile(structure, statefile) {let ic = this.icn3d, me = ic.icn3dui;
57737
- // if(!statefile) return;
57746
+ if(!statefile) return;
57738
57747
 
57739
57748
  let commandArray = statefile.trim().split('\n');
57740
57749
  commandArray = ['select $' + structure].concat(commandArray);
@@ -63090,7 +63099,8 @@ class LoadPDB {
63090
63099
  this.icn3d = icn3d;
63091
63100
  }
63092
63101
 
63093
- getStructureId(id, moleculeNum, bMutation) { let ic = this.icn3d; ic.icn3dui;
63102
+ getStructureId(id, moleculeNum, bMutation, bNMR) { let ic = this.icn3d; ic.icn3dui;
63103
+ id = (bNMR && ic.idNMR) ? ic.idNMR : id;
63094
63104
  let structure = id;
63095
63105
 
63096
63106
  if(id == ic.defaultPdbId || bMutation || ic.structures.hasOwnProperty(id)) { // bMutation: side chain prediction
@@ -63157,6 +63167,7 @@ class LoadPDB {
63157
63167
  //let chainMissingResidueArray = {}
63158
63168
 
63159
63169
  let id = (pdbid) ? pdbid : ic.defaultPdbId;
63170
+ let oriId = id;
63160
63171
 
63161
63172
  let structure = id;
63162
63173
 
@@ -63176,6 +63187,7 @@ class LoadPDB {
63176
63187
 
63177
63188
  ///id = line.substr(62, 4).trim();
63178
63189
  id = line.substr(62).trim();
63190
+ oriId = id;
63179
63191
 
63180
63192
  if(id == '') {
63181
63193
  if(bAppend) {
@@ -63187,7 +63199,7 @@ class LoadPDB {
63187
63199
  }
63188
63200
  }
63189
63201
 
63190
- structure = this.getStructureId(id, moleculeNum, bMutation);
63202
+ structure = this.getStructureId(id, moleculeNum, bMutation, bNMR);
63191
63203
 
63192
63204
  ic.molTitle = '';
63193
63205
  ic.molTitleHash = {};
@@ -63258,6 +63270,7 @@ class LoadPDB {
63258
63270
  else if (remarkType == 210) {
63259
63271
  if((line.substr(11, 32).trim() == 'EXPERIMENT TYPE') && line.substr(45).trim() == 'NMR') {
63260
63272
  bNMR = true;
63273
+ ic.idNMR = oriId;
63261
63274
  }
63262
63275
  }
63263
63276
  else if (remarkType == 350 && line.substr(13, 5) == 'BIOMT') {
@@ -63311,7 +63324,7 @@ class LoadPDB {
63311
63324
  ++moleculeNum;
63312
63325
  id = ic.defaultPdbId;
63313
63326
 
63314
- structure = this.getStructureId(id, moleculeNum, bMutation);
63327
+ structure = this.getStructureId(id, moleculeNum, bMutation, bNMR);
63315
63328
  //helices = [];
63316
63329
  //sheets = [];
63317
63330
  if(!bNMR) {
@@ -63334,7 +63347,7 @@ class LoadPDB {
63334
63347
  segId = line.substr(72, 4).trim();
63335
63348
 
63336
63349
  if(bFirstAtom) {
63337
- structure = this.getStructureId(id, moleculeNum, bMutation);
63350
+ structure = this.getStructureId(id, moleculeNum, bMutation, bNMR);
63338
63351
 
63339
63352
  bFirstAtom = false;
63340
63353
  }
@@ -63342,7 +63355,7 @@ class LoadPDB {
63342
63355
  ++moleculeNum;
63343
63356
  id = ic.defaultPdbId;
63344
63357
 
63345
- structure = this.getStructureId(id, moleculeNum, bMutation);
63358
+ structure = this.getStructureId(id, moleculeNum, bMutation, bNMR);
63346
63359
 
63347
63360
  //helices = [];
63348
63361
  //sheets = [];
@@ -78497,7 +78510,7 @@ class SaveFile {
78497
78510
  }
78498
78511
 
78499
78512
  //getAtomPDB: function(atomHash, bPqr, bPdb, bNoChem) { let ic = this.icn3d, me = ic.icn3dui;
78500
- getAtomPDB(atomHash, bPqr, bNoChem, bNoHeader, chainResi2pdb, pdbid, bMergeIntoOne) { let ic = this.icn3d, me = ic.icn3dui;
78513
+ getAtomPDB(atomHash, bPqr, bNoChem, bNoHeader, chainResi2pdb, pdbid, bMergeIntoOne, bVastSearch) { let ic = this.icn3d, me = ic.icn3dui;
78501
78514
  let pdbStr = '';
78502
78515
 
78503
78516
  // get all phosphate groups in lipids
@@ -78574,7 +78587,7 @@ class SaveFile {
78574
78587
  for(let i = 0, il = ssArray.length; i < il; ++i) {
78575
78588
  let ssObj = ssArray[i];
78576
78589
 
78577
- if(ssObj.ss != prevSs) {
78590
+ if(ssObj.ss != prevSs || ssObj.ssbegin) {
78578
78591
  // print prev
78579
78592
  stru2header[stru] += this.printPrevSecondary(bHelix, bSheet, prevRealSsObj, ssCnt);
78580
78593
 
@@ -78772,6 +78785,7 @@ class SaveFile {
78772
78785
  //line +=(atom.chain.length <= 1) ? atom.chain.padStart(1, ' ') : atom.chain.substr(0, 1);
78773
78786
  if(atom.chain.length >= 2) {
78774
78787
  let chainTmp = atom.chain.replace(/_/gi, '').substr(0, 2);
78788
+ if(bVastSearch) chainTmp = ' ' + chainTmp.substr(0,1); // VAST search only support one lettter chain ID
78775
78789
  line += chainTmp;
78776
78790
  }
78777
78791
  else if(atom.chain.length == 1) {
@@ -78850,7 +78864,9 @@ class SaveFile {
78850
78864
  }
78851
78865
  else {
78852
78866
  line += "1.00".padStart(6, ' ');
78853
- line +=(atom.b) ? parseFloat(atom.b).toFixed(2).toString().padStart(6, ' ') : ' '.padStart(6, ' ');
78867
+ // line +=(atom.b) ? parseFloat(atom.b).toFixed(2).toString().padStart(6, ' ') : ' '.padStart(6, ' ');
78868
+ let defaultBFactor = (bVastSearch) ? "1.0" : " ";
78869
+ line +=(atom.b) ? parseFloat(atom.b).toFixed(2).toString().padStart(6, ' ') : defaultBFactor.padStart(6, ' ');
78854
78870
  line += ' '.padStart(10, ' ');
78855
78871
  line += atom.elem.padStart(2, ' ');
78856
78872
  line += ' '.padStart(2, ' ');