icn3d 3.34.0 → 3.34.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
@@ -15453,7 +15453,7 @@ class SetDialog {
15453
15453
  html += me.htmlCls.divStr + "dl_ligplotcolor' style='inline-block;'>";
15454
15454
 
15455
15455
  // html += "The real interaction distances are not in scale, and are about twice the distances of dashed line segments.<br>Some \"Contact\" lines are only shown partially to simplify the view.<br>";
15456
- html += "<b>Color Legend</b>: <br>";
15456
+ html += "Color legend for interactions (dashed lines): <br>";
15457
15457
 
15458
15458
  html += me.htmlCls.setHtmlCls.setColorHints();
15459
15459
 
@@ -16515,8 +16515,8 @@ class Events {
16515
16515
  hostUrl = (pos == -1) ? hostUrl : hostUrl.substr(0, pos);
16516
16516
 
16517
16517
  // some URLs from VAST search are like https://www.ncbi.nlm.nih.gov/Structure/vast/icn3d/
16518
- if(hostUrl == 'https://www.ncbi.nlm.nih.gov/Structure/vast/icn3d/') {
16519
- hostUrl = 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/';
16518
+ if(hostUrl.indexOf('/vast/icn3d/')) {
16519
+ hostUrl = hostUrl.replace(/\/vast\/icn3d\//g, '/icn3d/');
16520
16520
  }
16521
16521
 
16522
16522
  ic.definedSetsCls.clickCustomAtoms();
@@ -39495,15 +39495,16 @@ class SetColor {
39495
39495
  atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
39496
39496
 
39497
39497
  for (let i in atoms) {
39498
- let atom = ic.atoms[i];
39499
- if(!atom.het) ++cnt;
39498
+ ic.atoms[i];
39499
+ // if(!atom.het) ++cnt;
39500
+ ++cnt;
39500
39501
  }
39501
39502
 
39502
39503
  let lastTerSerialInv = (cnt > 1) ? 1 / (cnt - 1) : 1;
39503
39504
  for (let i in atoms) {
39504
39505
  let atom = ic.atoms[i];
39505
- //atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(2 / 3 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
39506
- atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
39506
+ // atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
39507
+ atom.color = me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
39507
39508
 
39508
39509
  ic.atomPrevColors[i] = atom.color;
39509
39510
  }
@@ -39517,14 +39518,16 @@ class SetColor {
39517
39518
  atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
39518
39519
 
39519
39520
  for (let i in atoms) {
39520
- let atom = ic.atoms[i];
39521
- if(!atom.het) ++cnt;
39521
+ ic.atoms[i];
39522
+ // if(!atom.het) ++cnt;
39523
+ ++cnt;
39522
39524
  }
39523
39525
 
39524
39526
  let lastTerSerialInv = (cnt > 1) ? 1 / (cnt - 1) : 1;
39525
39527
  for (let i in atoms) {
39526
39528
  let atom = ic.atoms[i];
39527
- atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
39529
+ // atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
39530
+ atom.color = me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
39528
39531
 
39529
39532
  ic.atomPrevColors[i] = atom.color;
39530
39533
  }
@@ -50613,7 +50616,8 @@ class LineGraph {
50613
50616
  if(pos1 === undefined || pos2 === undefined) continue;
50614
50617
  let linestrokewidth;
50615
50618
  if(link.v == me.htmlCls.contactValue) {
50616
- linestrokewidth = (link.n == 1) ? 1 : 3;
50619
+ // linestrokewidth = (link.n == 1) ? 1 : 3;
50620
+ linestrokewidth = 1;
50617
50621
  } else {
50618
50622
  linestrokewidth = (link.n == 1) ? 2 : 4;
50619
50623
  }
@@ -50741,7 +50745,8 @@ class LineGraph {
50741
50745
 
50742
50746
  let linestrokewidth;
50743
50747
  if(link.v == me.htmlCls.contactValue) {
50744
- linestrokewidth = (link.n == 1) ? 1 : 3;
50748
+ // linestrokewidth = (link.n == 1) ? 1 : 3;
50749
+ linestrokewidth = 1;
50745
50750
  } else {
50746
50751
  linestrokewidth = (link.n == 1) ? 2 : 4;
50747
50752
  }
@@ -51211,6 +51216,7 @@ class GetGraph {
51211
51216
  interStr += this.getContactLinks(ssAtomsArray[i], ssAtomsArray[j], labelType, true, bCartoon2d);
51212
51217
  }
51213
51218
  }
51219
+
51214
51220
  return interStr;
51215
51221
  }
51216
51222
  getContactLinks(atomlistTarget, otherAtoms, labelType, bInternal, bCartoon2d) { let ic = this.icn3d, me = ic.icn3dui;
@@ -51253,7 +51259,14 @@ class GetGraph {
51253
51259
  for(let resid1 in hash1) {
51254
51260
  //ASN $1KQ2.A:6@ND2
51255
51261
  //or ASN $1KQ2.A:6
51256
- resid1 = resid1.trim();
51262
+ // or ASN $1KQ2.A:6@ND2 2006
51263
+ let resid1Ori = resid1.trim();
51264
+
51265
+ let idArray1 = resid1Ori.split(' ');
51266
+ if(idArray1.length == 3) {
51267
+ resid1 = idArray1[0] + ' ' + idArray1[1];
51268
+ }
51269
+
51257
51270
  let pos1a = resid1.indexOf(' ');
51258
51271
  let pos1b = resid1.indexOf(':');
51259
51272
  let posTmp1 = resid1.indexOf('@');
@@ -51263,8 +51276,14 @@ class GetGraph {
51263
51276
  let resName1 = me.utilsCls.residueName2Abbr(resid1.substr(0, pos1a)) + resid1.substr(pos1b + 1, pos1c - pos1b - 1);
51264
51277
  if(labelType == 'chain' || labelType == 'structure') resName1 += '.' + resid1.substr(pos1d + 1, pos1b - pos1d - 1);
51265
51278
  if(labelType == 'structure') resName1 += '.' + resid1.substr(pos1e + 1, pos1d - pos1e - 1);
51266
- for(let resid2 in hash2[resid1]) {
51267
- resid2 = resid2.trim();
51279
+ for(let resid2 in hash2[resid1Ori]) {
51280
+ let resid2Ori = resid2.trim();
51281
+
51282
+ let idArray2 = resid2Ori.split(' ');
51283
+ if(idArray2.length == 3) {
51284
+ resid2 = idArray2[0] + ' ' + idArray2[1];
51285
+ }
51286
+
51268
51287
  let pos2a = resid2.indexOf(' ');
51269
51288
  let pos2b = resid2.indexOf(':');
51270
51289
  let posTmp2 = resid2.indexOf('@');
@@ -51280,16 +51299,6 @@ class GetGraph {
51280
51299
  resName1 = ic.resi2resirange[resName1];
51281
51300
  resName2 = ic.resi2resirange[resName2];
51282
51301
  }
51283
- /*
51284
- if(!sourceTargetHash.hasOwnProperty(resName1 + '_' + resName2) && resName1 !== undefined && resName2 !== undefined ) {
51285
- let linkStr = ', {"source": "' + resName1 + '", "target": "' + resName2 + '", "v": ' + value + ', "c": "' + color + '"}';
51286
- if(linkStr != prevLinkStr) hbondStr += linkStr;
51287
- prevLinkStr = linkStr;
51288
-
51289
- sourceTargetHash[resName1 + '_' + resName2] = 1;
51290
- sourceTargetHash[resName2 + '_' + resName1] = 1;
51291
- }
51292
- */
51293
51302
 
51294
51303
  if(resName1 !== undefined && resName2 !== undefined ) {
51295
51304
  let linkStr = '"source": "' + resName1 + '", "target": "' + resName2 + '", "v": ' + value + ', "c": "' + color + '"';
@@ -53853,16 +53862,17 @@ class ChainalignParser {
53853
53862
  // calculate secondary structures with applyCommandDssp
53854
53863
  //$.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
53855
53864
  await ic.pdbParserCls.applyCommandDssp(true);
53856
-
53865
+ //!!!
53866
+ /*
53857
53867
  // original version =============
53858
53868
  // align PDB chains
53859
53869
  for(let index in ic.pdbChainIndexHash) {
53860
53870
  //ic.pdbChainIndexHash[index] = mmdbid_q_tmp + "_" + ic.chain_q + "_" + ic.mmdbid_t + "_" + ic.chain_t;
53861
53871
  let idArray = ic.pdbChainIndexHash[index].split('_');
53862
53872
  mmdbid_q = idArray[0];
53863
- idArray[1];
53873
+ let chain_q = idArray[1];
53864
53874
  mmdbid_t = idArray[2];
53865
- idArray[3];
53875
+ let chain_t = idArray[3];
53866
53876
 
53867
53877
  thisClass.transformStructure(mmdbid_q, index-1, 'query');
53868
53878
  }
@@ -53872,7 +53882,7 @@ class ChainalignParser {
53872
53882
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
53873
53883
  let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
53874
53884
 
53875
- let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(' | ') : [];
53885
+ let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(',') : [];
53876
53886
 
53877
53887
  for(let index in ic.afChainIndexHash) {
53878
53888
  let idArray = ic.afChainIndexHash[index].split('_');
@@ -53884,25 +53894,26 @@ class ChainalignParser {
53884
53894
  let chain_t = idArray[3];
53885
53895
  let chainid_t = mmdbid_t + '_' + chain_t;
53886
53896
 
53887
- let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t).hAtoms : ic.chains[chainid_t];
53888
- let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q).hAtoms : ic.chains[chainid_q];
53897
+ // let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t, true).hAtoms : ic.chains[chainid_t];
53898
+ // let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q, true).hAtoms : ic.chains[chainid_q];
53899
+ let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[0]], chainid_t, true).hAtoms : ic.chains[chainid_t];
53900
+ let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[index]], chainid_q, true).hAtoms : ic.chains[chainid_q];
53889
53901
  // end of original version =============
53890
-
53891
- /*
53902
+ */
53903
+
53892
53904
  // new version to be done for VASTsrv ==============
53893
53905
  // dynamically align pairs in all chainids
53894
53906
  let ajaxArray = [], indexArray = [], struArray = [];
53895
53907
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
53896
53908
  let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
53897
53909
 
53898
- let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(' | ') : [];
53910
+ let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(',') : [];
53899
53911
 
53900
53912
  // dynamically align pairs in all chainids
53901
- let atomSet_t = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainidArray[0]).hAtoms : ic.chains[chainidArray[0]];
53913
+ let atomSet_t = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[0]], chainidArray[0], true).hAtoms : ic.chains[chainidArray[0]];
53902
53914
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
53903
- let atomSet_q = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainidArray[index]).hAtoms : ic.chains[chainidArray[index]];
53915
+ let atomSet_q = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[index]], chainidArray[index], true).hAtoms : ic.chains[chainidArray[index]];
53904
53916
  // end of new version to be done for VASTsrv ==============
53905
- */
53906
53917
 
53907
53918
  let alignAjax;
53908
53919
  if(me.cfg.aligntool != 'tmalign') {
@@ -54130,10 +54141,11 @@ class ChainalignParser {
54130
54141
 
54131
54142
  // chainid1 is target
54132
54143
  aligType = 'target';
54133
- this.transformStructure(target, index, aligType);
54144
+ let bForce = true;
54145
+ this.transformStructure(target, index, aligType, bForce);
54134
54146
 
54135
54147
  aligType = 'query';
54136
- this.transformStructure(query, index, aligType);
54148
+ this.transformStructure(query, index, aligType, bForce);
54137
54149
 
54138
54150
  allChainidHash[chainidArray[0]] = 1;
54139
54151
  allChainidHash[chainidArray[1]] = 1;
@@ -54811,8 +54823,12 @@ class ChainalignParser {
54811
54823
 
54812
54824
  if(bQuery && me.cfg.matchedchains) {
54813
54825
  // $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
54814
- let bRealign = true, bPredefined = true;
54815
- await ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
54826
+ // let bRealign = true, bPredefined = true;
54827
+ // await ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
54828
+
54829
+ ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(ic.chainidArray);
54830
+ await ic.realignParserCls.realignOnStructAlign();
54831
+
54816
54832
  // reset annotations
54817
54833
  $("#" + ic.pre + "dl_annotations").html("");
54818
54834
  ic.bAnnoShown = false;
@@ -59383,7 +59399,7 @@ class RealignParser {
59383
59399
  }
59384
59400
  }
59385
59401
 
59386
- getSeqCoorResid(resiArray, chainid) { let ic = this.icn3d, me = ic.icn3dui;
59402
+ getSeqCoorResid(resiArray, chainid, bNCBI) { let ic = this.icn3d, me = ic.icn3dui;
59387
59403
  let seq = '', coorArray = [], residArray = [];
59388
59404
  let hAtoms = {};
59389
59405
 
@@ -59391,15 +59407,7 @@ class RealignParser {
59391
59407
  if(resiArray[j].indexOf('-') != -1) {
59392
59408
  let startEnd = resiArray[j].split('-');
59393
59409
  for(let k = parseInt(startEnd[0]); k <= parseInt(startEnd[1]); ++k) {
59394
- // from VAST neighbor page, use NCBI residue number
59395
- //if(me.cfg.usepdbnum === false) k += base - 1;
59396
-
59397
- //let seqIndex = k - base;
59398
- let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
59399
- // if(ic.bNCBI) {
59400
- // let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
59401
- // if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
59402
- // }
59410
+ let seqIndex = (bNCBI) ? k : ic.setSeqAlignCls.getPosFromResi(chainid, k);
59403
59411
 
59404
59412
  // don't align solvent or chemicals
59405
59413
  if(!ic.chainsSeq[chainid] || !ic.chainsSeq[chainid][seqIndex] || me.parasCls.b62ResArray.indexOf(ic.chainsSeq[chainid][seqIndex].name.toUpperCase()) == -1) continue;
@@ -59411,20 +59419,14 @@ class RealignParser {
59411
59419
  residArray.push(chainid + '_' + k);
59412
59420
  }
59413
59421
  }
59422
+ else if(resiArray[j] == 0) { // 0 means the whole chain
59423
+ let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.chains[chainid]);
59424
+ residArray = Object.keys(residueHash);
59425
+ }
59414
59426
  else { // one residue
59415
-
59416
- //let k = parseInt(resiArray[j]);
59417
59427
  let k = resiArray[j];
59418
- // from VAST neighbor page, use NCBI residue number
59419
- //if(me.cfg.usepdbnum === false) k += base - 1;
59420
59428
 
59421
- //let seqIndex = k - base;
59422
- let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
59423
-
59424
- // if(ic.bNCBI) {
59425
- // let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
59426
- // if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
59427
- // }
59429
+ let seqIndex = (bNCBI) ? k : ic.setSeqAlignCls.getPosFromResi(chainid, k);
59428
59430
 
59429
59431
  if(!ic.chainsSeq[chainid][seqIndex]) continue;
59430
59432
 
@@ -69425,9 +69427,10 @@ class LoadScript {
69425
69427
 
69426
69428
  if(command.indexOf('load') !== -1) { // 'load pdb [pdbid]'
69427
69429
  let load_parameters = command.split(' | ');
69428
-
69429
69430
  let loadStr = load_parameters[0];
69430
- if(load_parameters.length > 1) {
69431
+
69432
+ // do not reset me.cfg.inpara from "command=..." part if it was not empty
69433
+ if(load_parameters.length > 1 && !me.cfg.inpara) {
69431
69434
  let firstSpacePos = load_parameters[load_parameters.length - 1].indexOf(' ');
69432
69435
  me.cfg.inpara = load_parameters[load_parameters.length - 1].substr(firstSpacePos + 1);
69433
69436
  if(me.cfg.inpara === 'undefined') {
@@ -82805,7 +82808,7 @@ class iCn3DUI {
82805
82808
  //even when multiple iCn3D viewers are shown together.
82806
82809
  this.pre = this.cfg.divid + "_";
82807
82810
 
82808
- this.REVISION = '3.34.0';
82811
+ this.REVISION = '3.34.1';
82809
82812
 
82810
82813
  // In nodejs, iCn3D defines "window = {navigator: {}}"
82811
82814
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -82995,7 +82998,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
82995
82998
  await ic.realignParserCls.realignChainOnSeqAlign(undefined, chainidArray, bRealign, bPredefined);
82996
82999
  }
82997
83000
  }
82998
- else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
83001
+ // else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
83002
+ else if(me.cfg.matchedchains !== undefined) {
82999
83003
  let stru_t = Object.keys(ic.structures)[0];
83000
83004
 
83001
83005
  let chain_t = stru_t + '_' + me.cfg.masterchain;
@@ -83023,7 +83027,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
83023
83027
  ic.chainidArray = [chain_t].concat(chainidArray);
83024
83028
  ic.chainidArray = ic.chainalignParserCls.addPostfixForChainids(ic.chainidArray);
83025
83029
 
83026
- me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
83030
+ // me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
83027
83031
 
83028
83032
  ic.loadCmd = 'vast_search_chainid ' + ic.chainidArray;
83029
83033
  me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
@@ -83249,7 +83253,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
83249
83253
  ic.bChainAlign = true;
83250
83254
  ic.inputid = me.cfg.chainalign;
83251
83255
  let resrangeStr = (me.cfg.resrange) ? ' | resrange ' + me.cfg.resrange : '';
83252
- ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + me.cfg.resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara + resrangeStr;
83256
+ let resdef = (me.cfg.resdef) ? me.cfg.resdef : '';
83257
+ ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara + resrangeStr;
83253
83258
  me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
83254
83259
  await ic.chainalignParserCls.downloadChainalignment(me.cfg.chainalign);
83255
83260
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.34.0",
3
+ "version": "3.34.2",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {