icn3d 3.12.8 → 3.13.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
@@ -5127,7 +5127,11 @@ class UtilsCls {
5127
5127
  let dz = atom0.coord.z - atom1.coord.z;
5128
5128
  let distSq = dx*dx + dy*dy + dz*dz;
5129
5129
 
5130
- return distSq < 1.3 * r * r;
5130
+ // r(N) = 0.71, r(H) = 0.31, N-H in residues are about 1.5
5131
+ // factor = (1.5 / 1.02) * (1.5 / 1.02) = 2.16
5132
+ let factor = ((atom0.elem == 'N' && atom1.elem.substr(0,1) == 'H') || (atom1.elem == 'N' && atom0.elem.substr(0,1) == 'H')) ? 2.2 : 1.3;
5133
+
5134
+ return distSq < factor * r * r;
5131
5135
  }
5132
5136
 
5133
5137
  //Convert a three-letter residue name to a one-letter residue abbreviation, e.g., 'LYS' to 'K', or ' A' to 'A' for nucleotides.
@@ -18350,7 +18354,7 @@ class ShowInter {
18350
18354
  for(let j = 0, jl = ic.atoms[atom.serial].bonds.length; j < jl; ++j) {
18351
18355
  let serial = ic.atoms[atom.serial].bonds[j];
18352
18356
  //if(ic.atoms[serial].name === 'H') {
18353
- if(atom.elem.substr(0, 1) === 'H') {
18357
+ if(ic.atoms[serial].elem.substr(0, 1) === 'H') {
18354
18358
  ic.dAtoms[serial] = 1;
18355
18359
  ic.hAtoms[serial] = 1;
18356
18360
  }
@@ -18359,11 +18363,29 @@ class ShowInter {
18359
18363
  }
18360
18364
  }
18361
18365
  else {
18366
+ // for(let serial in ic.atoms) {
18367
+ // ic.dAtoms[serial] = 1;
18368
+ // ic.hAtoms[serial] = 1;
18369
+ // }
18370
+
18371
+ // add bonds in heavy atoms
18372
+ //for(let serial in ic.hAtoms) {
18362
18373
  for(let serial in ic.atoms) {
18363
- ic.dAtoms[serial] = 1;
18364
- ic.hAtoms[serial] = 1;
18365
- }
18374
+ let atom = ic.atoms[serial];
18375
+ //if(atom.name === 'H') {
18376
+ if(atom.elem.substr(0, 1) === 'H') {
18377
+ if(ic.atoms[serial].bonds.length > 0) {
18378
+ let otherSerial = ic.atoms[serial].bonds[0];
18379
+ ic.atoms[otherSerial].bonds.push(atom.serial);
18380
+ if(ic.atoms[otherSerial].bondOrder) ic.atoms[otherSerial].bondOrder.push(1);
18381
+ }
18382
+
18383
+ ic.dAtoms[serial] = 1;
18384
+ }
18385
+ }
18366
18386
  }
18387
+
18388
+ ic.bShowHighlight = false;
18367
18389
  }
18368
18390
 
18369
18391
  hideHydrogens() { let ic = this.icn3d; ic.icn3dui;
@@ -19844,7 +19866,7 @@ class Delphi {
19844
19866
 
19845
19867
  ic.loadPhiFrom = 'delphi';
19846
19868
 
19847
- let url = "https://www.ncbi.nlm.nih.gov/Structure/delphi/delphi.cgi";
19869
+ let url = me.htmlCls.baseUrl + "delphi/delphi.cgi";
19848
19870
  let pdbid =(me.cfg.cid) ? me.cfg.cid : Object.keys(ic.structures).toString();
19849
19871
  let dataObj = {};
19850
19872
 
@@ -20656,7 +20678,7 @@ class Symd {
20656
20678
  let thisClass = this;
20657
20679
 
20658
20680
  //var url = "https://data.rcsb.org/rest/v1/core/assembly/" + pdbid + "/1";
20659
- let url = "https://www.ncbi.nlm.nih.gov/Structure/symd/symd.cgi";
20681
+ let url = me.htmlCls.baseUrl + "symd/symd.cgi";
20660
20682
 
20661
20683
  let atomHash = me.hashUtilsCls.intHash(ic.dAtoms, ic.hAtoms);
20662
20684
 
@@ -21803,7 +21825,7 @@ class LoadPDB {
21803
21825
  }
21804
21826
 
21805
21827
  if(!(curChain === atom.chain && curResi === atom.resi)) {
21806
- // a new residue, add the residue-residue bond beides the regular bonds
21828
+ // a new residue, add the residue-residue bond besides the regular bonds
21807
21829
  this.refreshBonds(curResAtoms, prevCarbonArray[0]);
21808
21830
 
21809
21831
  prevCarbonArray.splice(0, 1); // remove the first carbon
@@ -24818,13 +24840,13 @@ class OpmParser {
24818
24840
  });
24819
24841
  }
24820
24842
 
24821
- loadOpmData(data, pdbid, bFull, type, pdbid2) { let ic = this.icn3d; ic.icn3dui;
24843
+ loadOpmData(data, pdbid, bFull, type, pdbid2) { let ic = this.icn3d, me = ic.icn3dui;
24822
24844
  let thisClass = this;
24823
24845
  let url, dataType;
24824
24846
 
24825
24847
  if(!pdbid) pdbid = 'stru';
24826
24848
 
24827
- url = "https://www.ncbi.nlm.nih.gov/Structure/mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
24849
+ url = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
24828
24850
  dataType = "jsonp";
24829
24851
 
24830
24852
  $.ajax({
@@ -25687,6 +25709,7 @@ class RealignParser {
25687
25709
 
25688
25710
  let ajaxArray = [], chainidPairArray = [];
25689
25711
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
25712
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
25690
25713
  let structArray = Object.keys(struct2domain);
25691
25714
  for(let s = 0, sl = structArray.length; s < sl; ++s) {
25692
25715
  let struct1 = structArray[s];
@@ -25702,16 +25725,32 @@ class RealignParser {
25702
25725
  for(let j = 0, jl = chainidArray2.length; j < jl; ++j) {
25703
25726
  let chainid2 = chainidArray2[j];
25704
25727
 
25705
- let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct1][chainid1]);
25706
- let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct2][chainid2]);
25707
-
25708
- let alignAjax = $.ajax({
25709
- url: urlalign,
25710
- type: 'POST',
25711
- data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
25712
- dataType: 'jsonp',
25713
- cache: true
25714
- });
25728
+ let alignAjax;
25729
+
25730
+ if(me.cfg.aligntool != 'tmalign') {
25731
+ let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct1][chainid1]);
25732
+ let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct2][chainid2]);
25733
+
25734
+ alignAjax = $.ajax({
25735
+ url: urlalign,
25736
+ type: 'POST',
25737
+ data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
25738
+ dataType: 'jsonp',
25739
+ cache: true
25740
+ });
25741
+ }
25742
+ else {
25743
+ let pdb_target = ic.saveFileCls.getAtomPDB(struct2domain[struct1][chainid1]);
25744
+ let pdb_query = ic.saveFileCls.getAtomPDB(struct2domain[struct2][chainid2]);
25745
+
25746
+ alignAjax = $.ajax({
25747
+ url: urltmalign,
25748
+ type: 'POST',
25749
+ data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
25750
+ dataType: 'jsonp',
25751
+ cache: true
25752
+ });
25753
+ }
25715
25754
 
25716
25755
  ajaxArray.push(alignAjax);
25717
25756
  chainidPairArray.push(chainid1 + ',' + chainid2); // chainid2 is target
@@ -26083,6 +26122,8 @@ class ChainalignParser {
26083
26122
  // dynamicly align pairs in ic.afChainIndexHash
26084
26123
  let ajaxArray = [], indexArray = [], struArray = [];
26085
26124
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
26125
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
26126
+ //let urltmalign = "https://test.ncbi.nlm.nih.gov/Structure/tmalign/tmalign.cgi";
26086
26127
 
26087
26128
  for(let index in ic.afChainIndexHash) {
26088
26129
  let idArray = ic.afChainIndexHash[index].split('_');
@@ -26091,17 +26132,31 @@ class ChainalignParser {
26091
26132
  mmdbid_t = idArray[2];
26092
26133
  let chain_t = idArray[3];
26093
26134
 
26094
- let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_q + '_' + chain_q]);
26095
-
26096
- let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_t + '_' + chain_t]);
26097
-
26098
- let alignAjax = $.ajax({
26099
- url: urlalign,
26100
- type: 'POST',
26101
- data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
26102
- dataType: 'jsonp',
26103
- cache: true
26104
- });
26135
+ let alignAjax;
26136
+ if(me.cfg.aligntool != 'tmalign') {
26137
+ let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_q + '_' + chain_q]);
26138
+ let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_t + '_' + chain_t]);
26139
+
26140
+ alignAjax = $.ajax({
26141
+ url: urlalign,
26142
+ type: 'POST',
26143
+ data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
26144
+ dataType: 'jsonp',
26145
+ cache: true
26146
+ });
26147
+ }
26148
+ else {
26149
+ let pdb_query = ic.saveFileCls.getAtomPDB(ic.chains[mmdbid_q + '_' + chain_q]);
26150
+ let pdb_target= ic.saveFileCls.getAtomPDB(ic.chains[mmdbid_t + '_' + chain_t]);
26151
+
26152
+ alignAjax = $.ajax({
26153
+ url: urltmalign,
26154
+ type: 'POST',
26155
+ data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
26156
+ dataType: 'jsonp',
26157
+ cache: true
26158
+ });
26159
+ }
26105
26160
 
26106
26161
  ajaxArray.push(alignAjax);
26107
26162
  indexArray.push(index - 1);
@@ -26233,6 +26288,9 @@ class ChainalignParser {
26233
26288
  // set trans and rotation matrix
26234
26289
  ic.t_trans_add = [];
26235
26290
  ic.q_trans_sub = [];
26291
+
26292
+ if(me.cfg.aligntool == 'tmalign') ic.q_trans_add = [];
26293
+
26236
26294
  ic.q_rotation = [];
26237
26295
  ic.qt_start_end = [];
26238
26296
 
@@ -26377,30 +26435,37 @@ class ChainalignParser {
26377
26435
  for(let i = 0, il = chainidArray.length; i < il; ++i) {
26378
26436
  for(let serial in ic.chains[chainidArray[i]]) {
26379
26437
  let atm = ic.atoms[serial];
26380
- //atm.coord = new THREE.Vector3(atm.coord[0], atm.coord[1], atm.coord[2]);
26381
- if(ic.q_rotation !== undefined && ic.t_trans_add.length > 0 && !me.cfg.resnum && !me.cfg.resdef) {
26438
+ //if(ic.q_rotation !== undefined && ic.t_trans_add.length > 0 && !me.cfg.resnum && !me.cfg.resdef) {
26439
+ if(ic.q_rotation !== undefined && !me.cfg.resnum && !me.cfg.resdef) {
26382
26440
  atm = this.transformAtom(atm, index, alignType);
26383
26441
  }
26384
26442
  }
26385
26443
  }
26386
-
26387
-
26388
26444
  }
26389
26445
 
26390
- transformAtom(atm, index, alignType) { let ic = this.icn3d; ic.icn3dui;
26446
+ transformAtom(atm, index, alignType) { let ic = this.icn3d, me = ic.icn3dui;
26391
26447
  if(alignType === 'target') ;
26392
26448
  else if(alignType === 'query') {
26393
- atm.coord.x -= ic.q_trans_sub[index].x;
26394
- atm.coord.y -= ic.q_trans_sub[index].y;
26395
- atm.coord.z -= ic.q_trans_sub[index].z;
26449
+ if(me.cfg.aligntool != 'tmalign') {
26450
+ atm.coord.x -= ic.q_trans_sub[index].x;
26451
+ atm.coord.y -= ic.q_trans_sub[index].y;
26452
+ atm.coord.z -= ic.q_trans_sub[index].z;
26453
+ }
26396
26454
 
26397
26455
  let x = atm.coord.x * ic.q_rotation[index].x1 + atm.coord.y * ic.q_rotation[index].y1 + atm.coord.z * ic.q_rotation[index].z1;
26398
26456
  let y = atm.coord.x * ic.q_rotation[index].x2 + atm.coord.y * ic.q_rotation[index].y2 + atm.coord.z * ic.q_rotation[index].z2;
26399
26457
  let z = atm.coord.x * ic.q_rotation[index].x3 + atm.coord.y * ic.q_rotation[index].y3 + atm.coord.z * ic.q_rotation[index].z3;
26400
26458
 
26401
- x -= ic.t_trans_add[index].x;
26402
- y -= ic.t_trans_add[index].y;
26403
- z -= ic.t_trans_add[index].z;
26459
+ if(me.cfg.aligntool != 'tmalign') {
26460
+ x -= ic.t_trans_add[index].x;
26461
+ y -= ic.t_trans_add[index].y;
26462
+ z -= ic.t_trans_add[index].z;
26463
+ }
26464
+ else {
26465
+ x += ic.q_trans_add[index].x;
26466
+ y += ic.q_trans_add[index].y;
26467
+ z += ic.q_trans_add[index].z;
26468
+ }
26404
26469
 
26405
26470
  atm.coord.x = x;
26406
26471
  atm.coord.y = y;
@@ -26585,7 +26650,8 @@ class ChainalignParser {
26585
26650
  let chainalignFinal = ic.mmdbid_q + "_" + ic.chain_q + "," + ic.mmdbid_t + "_" + ic.chain_t;
26586
26651
  let domainalign = (domainArray.length > 0) ? domainArray[index] + "," + domainArray[0] : undefined;
26587
26652
 
26588
- if(ic.mmdbid_t.length == 4 && ic.mmdbid_q.length == 4) {
26653
+ // TM-align (me.cfg.aligntool == 'tmalign') needs to input PDB
26654
+ if(me.cfg.aligntool != 'tmalign' && ic.mmdbid_t.length == 4 && ic.mmdbid_q.length == 4) {
26589
26655
  let urlalign;
26590
26656
 
26591
26657
  if(domainArray.length > 0) {
@@ -26619,7 +26685,8 @@ class ChainalignParser {
26619
26685
  thisClass.parseChainAlignData(dataArray, alignArray, ic.mmdbid_t, ic.chain_t);
26620
26686
  })
26621
26687
  .fail(function() {
26622
- alert("These chains can not be aligned by VAST server. You can specify the residue range and try it again...");
26688
+ let serverName = (me.cfg.aligntool == 'tmalign') ? 'TM-align' : 'VAST';
26689
+ alert("These chains can not be aligned by " + serverName + ". You can specify the residue range and try it again...");
26623
26690
  // thisClass.parseChainAlignData(arguments, alignArray, ic.mmdbid_t, ic.chain_t);
26624
26691
  });
26625
26692
  }
@@ -26637,6 +26704,9 @@ class ChainalignParser {
26637
26704
 
26638
26705
  ic.t_trans_add = [];
26639
26706
  ic.q_trans_sub = [];
26707
+
26708
+ if(me.cfg.aligntool == 'tmalign') ic.q_trans_add = [];
26709
+
26640
26710
  ic.q_rotation = [];
26641
26711
  ic.qt_start_end = [];
26642
26712
 
@@ -26682,6 +26752,9 @@ class ChainalignParser {
26682
26752
  // need to pass C-alpha coords and get transformation matrix from backend
26683
26753
  ic.t_trans_add[index-1] = {"x":0, "y":0, "z":0};
26684
26754
  ic.q_trans_sub[index-1] = {"x":0, "y":0, "z":0};
26755
+
26756
+ if(me.cfg.aligntool == 'tmalign') ic.q_trans_add[index-1] = {"x":0, "y":0, "z":0};
26757
+
26685
26758
  ic.q_rotation[index-1] = {"x1":1, "y1":0, "z1":0, "x2":0, "y2":1, "z2":0, "x3":0, "y3":0, "z3":1};
26686
26759
  ic.qt_start_end[index-1] = undefined;
26687
26760
  }
@@ -26704,7 +26777,8 @@ class ChainalignParser {
26704
26777
  processAlign(align, index, queryData, bEqualMmdbid, bEqualChain, bNoAlert) { let ic = this.icn3d, me = ic.icn3dui;
26705
26778
  let bAligned = false;
26706
26779
  if((!align || align.length == 0) && !bNoAlert) {
26707
- alert("These chains can not be aligned by VAST server.");
26780
+ let serverName = (me.cfg.aligntool == 'tmalign') ? 'TM-align' : 'VAST';
26781
+ alert("These chains can not be aligned by " + serverName + ".");
26708
26782
  return bAligned;
26709
26783
  }
26710
26784
 
@@ -26737,13 +26811,20 @@ class ChainalignParser {
26737
26811
  */
26738
26812
  ic.t_trans_add[index] = align[0].t_trans_add;
26739
26813
  ic.q_trans_sub[index] = align[0].q_trans_sub;
26814
+
26815
+ if(me.cfg.aligntool == 'tmalign') ic.q_trans_add[index] = align[0].q_trans_add;
26816
+
26740
26817
  ic.q_rotation[index] = align[0].q_rotation;
26741
26818
  ic.qt_start_end[index] = align[0].segs;
26742
26819
 
26743
26820
  let rmsd = align[0].super_rmsd;
26744
26821
 
26745
- me.htmlCls.clickMenuCls.setLogCmd("RMSD of alignment: " + rmsd.toPrecision(4), false);
26746
- $("#" + ic.pre + "realignrmsd").val(rmsd.toPrecision(4));
26822
+ let logStr = "alignment RMSD: " + rmsd.toPrecision(4);
26823
+ if(me.cfg.aligntool == 'tmalign') logStr += "; TM-score: " + align[0].score.toPrecision(4);
26824
+ me.htmlCls.clickMenuCls.setLogCmd(logStr, false);
26825
+ let html = "<br><b>Alignment RMSD</b>: " + rmsd.toPrecision(4) + " &#8491;<br>";
26826
+ if(me.cfg.aligntool == 'tmalign') html += "<b>TM-score</b>: " + align[0].score.toPrecision(4) + "<br><br>";
26827
+ $("#" + ic.pre + "dl_rmsd").html(html);
26747
26828
  if(!me.cfg.bSidebyside) me.htmlCls.dialogCls.openDlg('dl_rmsd', 'RMSD of alignment');
26748
26829
 
26749
26830
  bAligned = true;
@@ -28629,6 +28710,24 @@ class LoadScript {
28629
28710
 
28630
28711
  return;
28631
28712
  }
28713
+ else if(ic.commands[i].trim().indexOf('realign on tmalign') == 0) {
28714
+ let strArray = ic.commands[i].split("|||");
28715
+ let command = strArray[0].trim();
28716
+
28717
+ let paraArray = command.split(' | ');
28718
+ if(paraArray.length == 2) {
28719
+ let nameArray = paraArray[1].split(',');
28720
+ ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
28721
+ }
28722
+
28723
+ me.cfg.aligntool = 'tmalign';
28724
+
28725
+ $.when(thisClass.applyCommandRealignByStruct(command)).then(function() {
28726
+ thisClass.execCommandsBase(i + 1, end, steps);
28727
+ });
28728
+
28729
+ return;
28730
+ }
28632
28731
  else if(ic.commands[i].trim().indexOf('graph interaction pairs') == 0) {
28633
28732
  let strArray = ic.commands[i].split("|||");
28634
28733
  let command = strArray[0].trim();
@@ -28817,6 +28916,17 @@ class LoadScript {
28817
28916
  }
28818
28917
  thisClass.applyCommandRealignByStruct(lastCommand);
28819
28918
  }
28919
+ else if(lastCommand.indexOf('realign on tmalign') == 0) {
28920
+ let paraArray = lastCommand.split(' | ');
28921
+ if(paraArray.length == 2) {
28922
+ let nameArray = paraArray[1].split(',');
28923
+ ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
28924
+ }
28925
+
28926
+ me.cfg.aligntool = 'tmalign';
28927
+
28928
+ thisClass.applyCommandRealignByStruct(lastCommand);
28929
+ }
28820
28930
  else if(lastCommand.indexOf('graph interaction pairs') == 0) {
28821
28931
  thisClass.applyCommandGraphinteraction(lastCommand);
28822
28932
  }
@@ -28948,14 +29058,20 @@ class LoadScript {
28948
29058
  ic.alignParserCls.downloadAlignment(id);
28949
29059
  }
28950
29060
  else if(command.indexOf('load chainalignment') !== -1) {
28951
- //load chainalignment [id] | resnum [resnum] | parameters [inpara]
29061
+ //load chainalignment [id] | resnum [resnum] | resdef [resnum] | aligntool [aligntool] | parameters [inpara]
28952
29062
  let urlArray = command.split(" | ");
28953
- if(urlArray[1].indexOf('resnum') != -1) {
28954
- me.cfg.resnum = urlArray[1].substr(urlArray[1].indexOf('resnum') + 7);
29063
+ if(urlArray.length > 1 && urlArray[1].indexOf('resnum') != -1) {
29064
+ me.cfg.resnum = urlArray[1].substr(urlArray[1].indexOf('resnum') + 7);
29065
+ }
29066
+ if(urlArray.length > 2 && urlArray[2].indexOf('resdef') != -1) {
29067
+ me.cfg.resdef = urlArray[2].substr(urlArray[1].indexOf('resdef') + 7);
29068
+ }
29069
+ if(urlArray.length > 3 && urlArray[3].indexOf('aligntool') != -1) {
29070
+ me.cfg.aligntool = urlArray[3].substr(urlArray[1].indexOf('aligntool') + 10);
28955
29071
  }
28956
29072
 
28957
29073
  me.cfg.chainalign = id;
28958
- ic.chainalignParserCls.downloadChainalignment(id, me.cfg.resnum);
29074
+ ic.chainalignParserCls.downloadChainalignment(id, me.cfg.resnum, me.cfg.resdef);
28959
29075
  }
28960
29076
  else if(command.indexOf('load url') !== -1) {
28961
29077
  let typeStr = load_parameters[1]; // type pdb
@@ -29547,7 +29663,7 @@ class ResizeCanvas {
29547
29663
  //let itemArray = ['dl_selectannotations', 'dl_alignment', 'dl_2ddgm', 'dl_definedsets', 'dl_graph',
29548
29664
  // 'dl_linegraph', 'dl_scatterplot', 'dl_contactmap', 'dl_allinteraction', 'dl_copyurl',
29549
29665
  // 'dl_symmetry', 'dl_symd', 'dl_rmsd', 'dl_legend', 'dl_disttable'];
29550
- let itemArray = ['dl_2ddgm', 'dl_2dctn', 'dl_alignment', 'dl_sequence2', 'dl_definedsets', 'dl_setsmenu', 'dl_command', 'dl_setoperations', 'dl_vast', 'dl_foldseek', 'dl_mmtfid', 'dl_pdbid', 'dl_afid', 'dl_opmid', 'dl_pdbfile', 'dl_pdbfile_app', 'dl_rescolorfile', 'dl_customcolor', 'dl_align', 'dl_alignaf', 'dl_chainalign', 'dl_mutation', 'dl_mol2file', 'dl_sdffile', 'dl_xyzfile', 'dl_afmapfile', 'dl_urlfile', 'dl_mmciffile', 'dl_mmcifid', 'dl_mmdbid', 'dl_mmdbafid', 'dl_blast_rep_id', 'dl_yournote', 'dl_gi', 'dl_uniprotid', 'dl_cid', 'dl_pngimage', 'dl_state', 'dl_fixedversion', 'dl_selection', 'dl_dsn6', 'dl_dsn6url', 'dl_clr', 'dl_symmetry', 'dl_symd', 'dl_contact', 'dl_hbonds', 'dl_realign', 'dl_realignbystruct', 'dl_allinteraction', 'dl_interactionsorted', 'dl_linegraph', 'dl_linegraphcolor', 'dl_scatterplot', 'dl_scatterplotcolor', 'dl_contactmap', 'dl_alignerrormap', 'dl_elecmap2fofc', 'dl_elecmapfofc', 'dl_emmap', 'dl_aroundsphere', 'dl_adjustmem', 'dl_selectplane', 'dl_addlabel', 'dl_addlabelselection', 'dl_labelColor', 'dl_distance', 'dl_stabilizer', 'dl_disttwosets', 'dl_distmanysets', 'dl_stabilizer_rm', 'dl_thickness', 'dl_thickness2', 'dl_addtrack', 'dl_addtrack_tabs', 'dl_saveselection', 'dl_copyurl', 'dl_selectannotations', 'dl_annotations_tabs', 'dl_anno_view_tabs', 'dl_annotations', 'dl_graph', 'dl_svgcolor', 'dl_area', 'dl_colorbyarea', 'dl_rmsd', 'dl_buriedarea', 'dl_propbypercentout', 'dl_propbybfactor', 'dl_legend', 'dl_disttable'];
29666
+ let itemArray = ['dl_2ddgm', 'dl_2dctn', 'dl_alignment', 'dl_sequence2', 'dl_definedsets', 'dl_setsmenu', 'dl_command', 'dl_setoperations', 'dl_vast', 'dl_foldseek', 'dl_mmtfid', 'dl_pdbid', 'dl_afid', 'dl_opmid', 'dl_pdbfile', 'dl_pdbfile_app', 'dl_rescolorfile', 'dl_customcolor', 'dl_align', 'dl_alignaf', 'dl_chainalign', 'dl_chainalign2', 'dl_chainalign3', 'dl_mutation', 'dl_mol2file', 'dl_sdffile', 'dl_xyzfile', 'dl_afmapfile', 'dl_urlfile', 'dl_mmciffile', 'dl_mmcifid', 'dl_mmdbid', 'dl_mmdbafid', 'dl_blast_rep_id', 'dl_yournote', 'dl_gi', 'dl_uniprotid', 'dl_cid', 'dl_pngimage', 'dl_state', 'dl_fixedversion', 'dl_selection', 'dl_dsn6', 'dl_dsn6url', 'dl_clr', 'dl_symmetry', 'dl_symd', 'dl_contact', 'dl_hbonds', 'dl_realign', 'dl_realignbystruct', 'dl_allinteraction', 'dl_interactionsorted', 'dl_linegraph', 'dl_linegraphcolor', 'dl_scatterplot', 'dl_scatterplotcolor', 'dl_contactmap', 'dl_alignerrormap', 'dl_elecmap2fofc', 'dl_elecmapfofc', 'dl_emmap', 'dl_aroundsphere', 'dl_adjustmem', 'dl_selectplane', 'dl_addlabel', 'dl_addlabelselection', 'dl_labelColor', 'dl_distance', 'dl_stabilizer', 'dl_disttwosets', 'dl_distmanysets', 'dl_stabilizer_rm', 'dl_thickness', 'dl_thickness2', 'dl_addtrack', 'dl_addtrack_tabs', 'dl_saveselection', 'dl_copyurl', 'dl_selectannotations', 'dl_annotations_tabs', 'dl_anno_view_tabs', 'dl_annotations', 'dl_graph', 'dl_svgcolor', 'dl_area', 'dl_colorbyarea', 'dl_rmsd', 'dl_buriedarea', 'dl_propbypercentout', 'dl_propbybfactor', 'dl_legend', 'dl_disttable'];
29551
29667
 
29552
29668
  for(let i in itemArray) {
29553
29669
  let item = itemArray[i];
@@ -32584,7 +32700,7 @@ class AnnoCddSite {
32584
32700
  let chnidArray = Object.keys(ic.protein_chainid);
32585
32701
  // show conserved domains and binding sites
32586
32702
  // live search
32587
- let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + chnidBaseArray;
32703
+ let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + chnidBaseArray;
32588
32704
  // precalculated
32589
32705
  //let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + chnidBaseArray;
32590
32706
  // live search for AlphaFold structures
@@ -32630,7 +32746,7 @@ class AnnoCddSite {
32630
32746
 
32631
32747
  //url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + ic.giSeq[chnidArray[0]].join('');
32632
32748
  // live searchE
32633
- url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + seq;
32749
+ url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + seq;
32634
32750
  // precalculated
32635
32751
  //url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + seq;
32636
32752
 
@@ -36412,11 +36528,15 @@ class SetSeqAlign {
36412
36528
  // start and end of MSA
36413
36529
  let start_t = 9999, end_t = -1;
36414
36530
 
36531
+ let baseResi = ic.chainsSeq[chainid1][0].resi - 1;
36532
+
36415
36533
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
36416
36534
  let chainIndex = index - 1;
36535
+ if(!ic.qt_start_end[chainIndex]) continue;
36536
+
36417
36537
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
36418
36538
  let start1, end1;
36419
- if(bRealign) { // realresidue numbers are stored
36539
+ if(bRealign) { // real residue numbers are stored
36420
36540
  start1 = ic.qt_start_end[chainIndex][i].t_start;
36421
36541
  end1 = ic.qt_start_end[chainIndex][i].t_end;
36422
36542
  }
@@ -36424,9 +36544,9 @@ class SetSeqAlign {
36424
36544
  start1 = ic.qt_start_end[chainIndex][i].t_start - 1;
36425
36545
  end1 = ic.qt_start_end[chainIndex][i].t_end - 1;
36426
36546
  }
36427
-
36428
36547
  for(let j = start1; j <= end1; ++j) {
36429
- let resi = this.getResi(chainidArray[0], j, bRealign);
36548
+ let resiPos = j - baseResi;
36549
+ let resi = this.getResi(chainidArray[0], resiPos, bRealign);
36430
36550
  resi2range_t[resi] = 1;
36431
36551
  if(j < start_t) start_t = j;
36432
36552
  if(j > end_t) end_t = j;
@@ -36434,6 +36554,9 @@ class SetSeqAlign {
36434
36554
  }
36435
36555
  }
36436
36556
 
36557
+ // TM-align should use "start1 = ic.qt_start_end[chainIndex][i].t_start - 1", but the rest are the same as ""bRealign"
36558
+ if(me.cfg.aligntool == 'tmalign') bRealign = true; // real residue numbers are stored
36559
+
36437
36560
  let resi2rangeArray = Object.keys(resi2range_t);
36438
36561
  resi2rangeArray.sort(function(a, b) {
36439
36562
  return parseInt(a) - parseInt(b);
@@ -36480,7 +36603,7 @@ class SetSeqAlign {
36480
36603
  for(let j = 0, jl = ic.chainsSeq[chainid1].length; j < jl; ++j) {
36481
36604
  let resi = ic.chainsSeq[chainid1][j].resi;
36482
36605
 
36483
- if((j < start_t || j > end_t) ) {
36606
+ if((j + baseResi < start_t || j + baseResi > end_t) ) {
36484
36607
  continue;
36485
36608
  }
36486
36609
 
@@ -37099,7 +37222,7 @@ class ParserUtils {
37099
37222
 
37100
37223
  if(rmsd) {
37101
37224
  me.htmlCls.clickMenuCls.setLogCmd("realignment RMSD: " + rmsd.toPrecision(4), false);
37102
- $("#" + ic.pre + "realignrmsd").val(rmsd.toPrecision(4));
37225
+ $("#" + ic.pre + "dl_rmsd").html("<br><b>Realignment RMSD</b>: " + rmsd.toPrecision(4) + " &#8491;<br><br>");
37103
37226
  if(!me.cfg.bSidebyside) me.htmlCls.dialogCls.openDlg('dl_rmsd', 'Realignment RMSD');
37104
37227
  }
37105
37228
 
@@ -37469,7 +37592,7 @@ class ParserUtils {
37469
37592
  let rmsd = ic.rmsd_supr.rmsd;
37470
37593
 
37471
37594
  me.htmlCls.clickMenuCls.setLogCmd("RMSD of alignment to OPM: " + rmsd.toPrecision(4), false);
37472
- $("#" + ic.pre + "realignrmsd").val(rmsd.toPrecision(4));
37595
+ $("#" + ic.pre + "dl_rmsd").html("<br><b>RMSD of alignment to OPM</b>: " + rmsd.toPrecision(4) + " &#8491;<br><br>");
37473
37596
  if(!me.cfg.bSidebyside) me.htmlCls.dialogCls.openDlg('dl_rmsd', 'RMSD of alignment to OPM');
37474
37597
 
37475
37598
  let dxymaxsq = 0;
@@ -37718,7 +37841,7 @@ class ParserUtils {
37718
37841
  if(me.cfg.showanno) {
37719
37842
  let cmd = "view annotations";
37720
37843
  me.htmlCls.clickMenuCls.setLogCmd(cmd, true);
37721
- ic.showAnnoCls.showAnnotations();
37844
+ ic.showAnnoCls.showAnnotations();
37722
37845
  }
37723
37846
  if(me.cfg.closepopup) {
37724
37847
  ic.resizeCanvasCls.closeDialogs();
@@ -38724,9 +38847,11 @@ class ShowAnno {
38724
38847
  }
38725
38848
 
38726
38849
  let nucleotide_chainid = {}, chemical_chainid = {}, chemical_set = {};
38727
- ic.protein_chainid = {};
38850
+ //ic.protein_chainid = {};
38728
38851
 
38729
38852
  if(ic.bAnnoShown === undefined || !ic.bAnnoShown || ic.bResetAnno) { // ic.bResetAnno when loading another structure
38853
+ ic.protein_chainid = {};
38854
+
38730
38855
  let chainArray = Object.keys(ic.chains);
38731
38856
 
38732
38857
  if(ic.giSeq === undefined) ic.giSeq = {};
@@ -38767,6 +38892,7 @@ class ShowAnno {
38767
38892
  chainidBase = chainArray[i];
38768
38893
  }
38769
38894
  //if(me.cfg.mmdbid !== undefined) { // protein and chemicals/ions are in different chains
38895
+
38770
38896
  if(ic.proteins.hasOwnProperty(atom.serial) && ic.chainsSeq[chainArray[i]].length > 1) {
38771
38897
  ic.protein_chainid[chainArray[i]] = chainidBase;
38772
38898
  }
@@ -39036,7 +39162,7 @@ class ShowAnno {
39036
39162
  return;
39037
39163
  }
39038
39164
  thisClass.enableHlSeq();
39039
- console.log( "No data were found for the protein " + chnidBaseArray + "..." );
39165
+ if(!me.bNode) console.log( "No data were found for the protein " + chnidBaseArray + "..." );
39040
39166
  for(let chnid in ic.protein_chainid) {
39041
39167
  let chnidBase = ic.protein_chainid[chnid];
39042
39168
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
@@ -39162,7 +39288,7 @@ class ShowAnno {
39162
39288
  }
39163
39289
  }
39164
39290
  else {
39165
- console.log( "No data were found for the protein " + chnid + "..." );
39291
+ if(!me.bNode) console.log( "No data were found for the protein " + chnid + "..." );
39166
39292
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
39167
39293
  }
39168
39294
  if(me.cfg.blast_rep_id != chnid) {
@@ -40555,11 +40681,11 @@ class AnnoSnpClinVar {
40555
40681
  if(ic.deferredClinvar !== undefined) ic.deferredClinvar.resolve();
40556
40682
  }
40557
40683
  }
40558
- showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
40684
+ showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
40559
40685
  let thisClass = this;
40560
40686
  //var url = "https://www.ncbi.nlm.nih.gov/projects/SNP/beVarSearch_mt.cgi?appname=iCn3D&format=bed&report=pdb2bed&acc=" + chnidBase;
40561
40687
  //var url = "https://www.ncbi.nlm.nih.gov/Structure/icn3d/clinvar.txt";
40562
- let url = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
40688
+ let url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
40563
40689
  if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
40564
40690
  url += "&gene=" + ic.chainsGene[chnid].geneSymbol;
40565
40691
  }
@@ -40594,7 +40720,7 @@ class AnnoSnpClinVar {
40594
40720
  });
40595
40721
  }
40596
40722
 
40597
- showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
40723
+ showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
40598
40724
  let thisClass = this;
40599
40725
  if(gi !== undefined) {
40600
40726
  /*
@@ -40613,7 +40739,7 @@ class AnnoSnpClinVar {
40613
40739
  } //if(data3 != "") {
40614
40740
  else {
40615
40741
  */
40616
- let url4 = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
40742
+ let url4 = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
40617
40743
  if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
40618
40744
  url4 += "&gene=" + ic.chainsGene[chnid].geneSymbol;
40619
40745
  }
@@ -45419,7 +45545,8 @@ class VRButton {
45419
45545
  button.style.display = '';
45420
45546
 
45421
45547
  button.style.cursor = 'pointer';
45422
- button.style.left = 'calc(50% - 50px)';
45548
+ //button.style.left = 'calc(50% - 50px)';
45549
+ button.style.left = 'calc(33% - 50px)';
45423
45550
  button.style.width = '100px';
45424
45551
 
45425
45552
  button.textContent = 'ENTER VR';
@@ -45473,7 +45600,7 @@ class VRButton {
45473
45600
  button.style.display = '';
45474
45601
 
45475
45602
  button.style.cursor = 'auto';
45476
- button.style.left = 'calc(50% - 75px)';
45603
+ button.style.left = 'calc(33% - 75px)'; //'calc(50% - 75px)';
45477
45604
  button.style.width = '150px';
45478
45605
 
45479
45606
  button.onmouseenter = null;
@@ -45666,7 +45793,8 @@ class ARButton {
45666
45793
  button.style.display = '';
45667
45794
 
45668
45795
  button.style.cursor = 'pointer';
45669
- button.style.left = 'calc(50% - 50px)';
45796
+ //button.style.left = 'calc(50% - 50px)';
45797
+ button.style.left = 'calc(66% - 50px)';
45670
45798
  button.style.width = '100px';
45671
45799
 
45672
45800
  button.textContent = 'START AR';
@@ -45714,7 +45842,7 @@ class ARButton {
45714
45842
  button.style.display = '';
45715
45843
 
45716
45844
  button.style.cursor = 'auto';
45717
- button.style.left = 'calc(50% - 75px)';
45845
+ button.style.left = 'calc(66% - 50px)'; //'calc(50% - 75px)';
45718
45846
  button.style.width = '150px';
45719
45847
 
45720
45848
  button.onmouseenter = null;
@@ -45811,7 +45939,7 @@ class ARButton {
45811
45939
 
45812
45940
  }
45813
45941
 
45814
- message.style.left = 'calc(50% - 90px)';
45942
+ message.style.left = 'calc(66% - 90px)'; //'calc(50% - 90px)';
45815
45943
  message.style.width = '180px';
45816
45944
  message.style.textDecoration = 'none';
45817
45945
 
@@ -54193,9 +54321,17 @@ class ClickMenu {
54193
54321
  // },
54194
54322
  // clkMn1_chainalign: function() {
54195
54323
  me.myEventCls.onIds("#" + me.pre + "mn1_chainalign", "click", function(e) { me.icn3d;
54196
- me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains of 3D structures');
54324
+ me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains by structure alignment');
54197
54325
  });
54198
54326
 
54327
+ me.myEventCls.onIds("#" + me.pre + "mn1_chainalign2", "click", function(e) { me.icn3d;
54328
+ me.htmlCls.dialogCls.openDlg('dl_chainalign2', 'Align multiple chains by sequence alignment');
54329
+ });
54330
+
54331
+ me.myEventCls.onIds("#" + me.pre + "mn1_chainalign3", "click", function(e) { me.icn3d;
54332
+ me.htmlCls.dialogCls.openDlg('dl_chainalign3', 'Align multiple chains residue by residue');
54333
+ });
54334
+
54199
54335
  me.myEventCls.onIds("#" + me.pre + "mn1_mutation", "click", function(e) { me.icn3d;
54200
54336
  me.htmlCls.dialogCls.openDlg('dl_mutation', 'Show the mutations in 3D');
54201
54337
  });
@@ -54374,6 +54510,12 @@ class ClickMenu {
54374
54510
  thisClass.setLogCmd("export pqr", true);
54375
54511
  });
54376
54512
 
54513
+ me.myEventCls.onIds(["#" + me.pre + "delphipdbh", "#" + me.pre + "phipqr", "#" + me.pre + "phiurlpqr"], "click", function(e) { me.icn3d;
54514
+ let bPdb = true;
54515
+ me.htmlCls.setHtmlCls.exportPqr(bPdb);
54516
+ thisClass.setLogCmd("export pdbh", false);
54517
+ });
54518
+
54377
54519
  // clkMn1_exportStl: function() {
54378
54520
  me.myEventCls.onIds("#" + me.pre + "mn1_exportStl", "click", function(e) { let ic = me.icn3d;
54379
54521
  thisClass.setLogCmd("export stl file", false);
@@ -56539,10 +56681,10 @@ class SetMenu {
56539
56681
  return "<div style='margin:3px 0px 0px 10px;'><button style='-webkit-appearance:" + buttonStyle + "; height:36px;" + bkgdColor + "' id='" + me.pre + id + "'><span style='white-space:nowrap;" + color + "' class='icn3d-commandTitle' title='" + title + "'>" + text + "</span></button></div>";
56540
56682
  }
56541
56683
 
56542
- setIcon(iconType, id, title, iconStyle, url, bText) { let me = this.icn3dui;
56684
+ setIcon(iconType, id, title, iconStyle, url, bText, bHighlight) { let me = this.icn3dui;
56543
56685
  if(me.bNode) return '';
56544
56686
 
56545
- let color = 'color:#1c94c4; ';
56687
+ let color = (bHighlight) ? 'color:#f8b84e; ' : 'color:#1c94c4; ';
56546
56688
  let bkgdColor = ' background-color:#EEE; ';
56547
56689
  let cssCursor = (iconType == 'text') ? '' : 'cursor:pointer;';
56548
56690
 
@@ -56589,7 +56731,7 @@ class SetMenu {
56589
56731
  // View menu
56590
56732
  html += tdStrBorder + this.setIcon(iconType, 'show_selected', 'View Selection', 'eye') + "</td>";
56591
56733
  html += tdStr + this.setIcon(iconType, 'tool_selectedcenter', 'Zoom in Selection', 'search-plus') + "</td>";
56592
- html += tdStr + this.setIcon(iconType, 'alternate', "Alternate the Structures by keying the letter 'a'", 'a', undefined, true) + "</td>";
56734
+ html += tdStr + this.setIcon(iconType, 'alternate', "Alternate the Structures by keying the letter 'a'", 'a', undefined, true, true) + "</td>";
56593
56735
  html += tdStr + this.setIcon(iconType, 'tool_resetOrientation', 'Reset Orientation', 'undo-alt') + "</td>";
56594
56736
 
56595
56737
  // Style menu
@@ -56788,22 +56930,31 @@ class SetMenu {
56788
56930
  html += "</li>";
56789
56931
  html += "<li><span>Align</span>";
56790
56932
  html += "<ul>";
56791
- html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
56792
- //html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Structure to Structure ' + me.htmlCls.wifiStr);
56933
+
56934
+ html += "<li><span>Multiple Chains</span>";
56935
+ html += "<ul>";
56936
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign', 'by Structure Alignment ' + me.htmlCls.wifiStr);
56937
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign2', 'by Sequence Alignment ' + me.htmlCls.wifiStr);
56938
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign3', 'Residue by Residue');
56939
+ html += "</ul>";
56940
+ html += "</li>";
56941
+
56793
56942
  html += "<li><span>Structure to Structure</span>";
56794
56943
  html += "<ul>";
56795
56944
  html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Two PDB Structures ' + me.htmlCls.wifiStr);
56796
56945
  html += me.htmlCls.setHtmlCls.getLink('mn1_alignaf', 'Two AlphaFold Structures ' + me.htmlCls.wifiStr);
56797
56946
  html += "</ul>";
56798
56947
 
56799
- html += me.htmlCls.setHtmlCls.getLink('mn1_chainalign', 'Multiple Chains ' + me.htmlCls.wifiStr);
56948
+ html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
56800
56949
 
56801
56950
  html += "</ul>";
56802
56951
  html += "</li>";
56803
56952
 
56804
56953
  html += "<li id='" + me.pre + "mn2_realignWrap'><span>Realign Selection</span>";
56805
56954
  html += "<ul>";
56806
- html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignonstruct', 'by Structure Alignment ' + me.htmlCls.wifiStr, true);
56955
+
56956
+ html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignonstruct', 'by Structure Alignment ' + me.htmlCls.wifiStr);
56957
+
56807
56958
  html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignonseqalign', 'by Sequence Alignment ' + me.htmlCls.wifiStr);
56808
56959
  html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignresbyres', 'Residue by Residue');
56809
56960
  html += "</ul>";
@@ -56870,6 +57021,7 @@ class SetMenu {
56870
57021
  */
56871
57022
 
56872
57023
  html += me.htmlCls.setHtmlCls.getLink('mn1_exportPdbRes', 'PDB');
57024
+ html += me.htmlCls.setHtmlCls.getLink('delphipdbh', 'PDB with Hydrogens');
56873
57025
 
56874
57026
  if(me.cfg.cid === undefined) {
56875
57027
  html += me.htmlCls.setHtmlCls.getLink('mn1_exportSecondary', 'Secondary Structure');
@@ -58587,10 +58739,10 @@ class Dialog {
58587
58739
  height = 500;
58588
58740
  }
58589
58741
  else if(id === me.pre + 'dl_rmsd') {
58590
- position ={ my: "right top", at: "right top", of: "#" + me.pre + "canvas", collision: "none" };
58742
+ position ={ my: "left bottom", at: "left+20 bottom-20", of: "#" + me.pre + "canvas", collision: "none" };
58591
58743
  }
58592
58744
  else if(id === me.pre + 'dl_legend') {
58593
- position ={ my: "right top", at: "right-20 top+60", of: "#" + me.pre + "canvas", collision: "none" };
58745
+ position ={ my: "left bottom", at: "left+20 bottom-20", of: "#" + me.pre + "canvas", collision: "none" };
58594
58746
  }
58595
58747
  else if(id === me.pre + 'dl_symd') {
58596
58748
  position ={ my: "left top", at: "right-200 bottom-200", of: "#" + me.pre + "canvas", collision: "none" };
@@ -58900,29 +59052,43 @@ class SetDialog {
58900
59052
 
58901
59053
  html += me.htmlCls.divStr + "dl_alignaf' class='" + dialogClass + "'>";
58902
59054
  html += "Enter two <a href='https://alphafold.ebi.ac.uk/' target='_blank'>AlphaFold Uniprot</a> IDs: <br/><br/>ID1: " + me.htmlCls.inputTextStr + "id='" + me.pre + "alignafid1' value='P41327' size=8>" + me.htmlCls.space3 + me.htmlCls.space3 + "ID2: " + me.htmlCls.inputTextStr + "id='" + me.pre + "alignafid2' value='P41331' size=8><br/><br/>";
58903
- html += me.htmlCls.buttonStr + "reload_alignaf'>Align</button>";
59055
+ html += me.htmlCls.buttonStr + "reload_alignaf_tmalign'>Align with TM-align</button>" + me.htmlCls.buttonStr + "reload_alignaf' style='margin-left:30px'>Align with VAST</button>";
58904
59056
  html += "</div>";
58905
59057
 
58906
59058
  html += me.htmlCls.divStr + "dl_chainalign' class='" + dialogClass + "'>";
58907
- /*
58908
- html += "Enter the PDB chain IDs in the form of pdbid_chain(e.g., 1HHO_A, case sensitive): <br/><br/>ID1: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignid1' value='1HHO_A' size=8>" + me.htmlCls.space3 + me.htmlCls.space3 + "ID2: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignid2' value='4N7N_A' size=8><br/><br/>";
58909
- html += me.htmlCls.buttonStr + "reload_chainalign'>Align</button><br/><br/>";
58910
- html += "<div style='width:450px'>(Note: To align chains in custom PDB files, you could concatenate PDB files in a single PDB file with the separation line \"ENDMDL\". Then load it in \"Open File > PDB File\" in the \"File\" menu and click \"View Sequences & Annotations\" in the \"Window\" menu. Finally select two chains in the sequence window and click \"Realign Selection\" in the \"File\" menu.)</div>";
58911
- html += "</div>";
58912
- */
58913
59059
  html += "<div style='width:550px'>";
58914
59060
  html += "All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID (e.g., P69905 for AlphaFold structures).<br/><br/>";
58915
59061
  html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
58916
- html += "<b>Optional 1</b>, full chains are used for structure alignment<br/><br/>";
58917
- html += "<b>Optional 2</b>, sequence alignment (followed by structure alignemnt) based on residue numbers in the First/Master chain: <br>" + me.htmlCls.inputTextStr + "id='" + me.pre + "resalignids' placeholder='1,5,10-50' size=50><br/><br/>";
58918
- html += "<b>Optional 3</b>, predefined alignment with the first chain as the master. The rest chains are aligned to the master chain. Each alignment is defined as \" | \"-separated residue lists in one line. \"10-50\" means a range of residues from 10 to 50.<br><textarea id='" + me.pre + "predefinedres' rows='5' style='width: 100%; height: " +(me.htmlCls.LOG_HEIGHT) + "px; padding: 0px; border: 0px;' placeholder='1,5,10-50 | 1,5,10-50 \n2,6,11-51 | 1,5,10-50'></textarea><br/><br/>";
58919
- html += me.htmlCls.buttonStr + "reload_chainalign_asym'>Align Asymmetric Unit</button>" + me.htmlCls.buttonStr + "reload_chainalign' style='margin-left:30px'>Align Biological Unit</button><br/><br/>";
59062
+ html += me.htmlCls.buttonStr + "reload_chainalign_tmalign'><b>Align with TM-align</b></button>" + me.htmlCls.buttonStr + "reload_chainalign_asym' style='margin-left:30px'><b>Align with VAST</b></button><br/><br/>";
59063
+
59064
+ html += "(Note: To align chains in custom PDB files, you could load them in \"File > Open File > PDB Files (appendable)\" and click \"Analysis > Defined Sets\". Finally select multiple chains in Defined Sets and click \"File > Realign Selection\".)<br><br>";
59065
+ html += "</div></div>";
59066
+
59067
+ html += me.htmlCls.divStr + "dl_chainalign2' class='" + dialogClass + "'>";
59068
+ html += "<div style='width:550px'>";
59069
+ html += "All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID (e.g., P69905 for AlphaFold structures).<br/><br/>";
59070
+ html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids2' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
59071
+
59072
+ html += "The sequence alignment (followed by structure alignemnt) is based on residue numbers in the First/Master chain: <br>" + me.htmlCls.inputTextStr + "id='" + me.pre + "resalignids' value='1,5,10-50' size=50><br/>";
59073
+ html += me.htmlCls.buttonStr + "reload_chainalign_asym2' style='margin-top:3px;'><b>Align by Sequence Alignment</b></button><br/><br/>";
59074
+
59075
+ html += "(Note: To align chains in custom PDB files, you could load them in \"File > Open File > PDB Files (appendable)\" and click \"Analysis > Defined Sets\". Finally select multiple chains in Defined Sets and click \"File > Realign Selection\".)<br><br>";
59076
+ html += "</div></div>";
59077
+
59078
+ html += me.htmlCls.divStr + "dl_chainalign3' class='" + dialogClass + "'>";
59079
+ html += "<div style='width:550px'>";
59080
+ html += "All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID (e.g., P69905 for AlphaFold structures).<br/><br/>";
59081
+ html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids3' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
59082
+
59083
+ html += "Each alignment is defined as \" | \"-separated residue lists in one line. \"10-50\" means a range of residues from 10 to 50.<br><textarea id='" + me.pre + "predefinedres' rows='5' style='width: 100%; height: " +(me.htmlCls.LOG_HEIGHT) + "px; padding: 0px; border: 0px;'>1,5,10-50 | 1,5,10-50 \n2,6,11-51 | 1,5,10-50</textarea><br/>";
59084
+ html += me.htmlCls.buttonStr + "reload_chainalign_asym3'><b>Align Residue by Residue</b></button><br/><br/>";
59085
+
58920
59086
  html += "(Note: To align chains in custom PDB files, you could load them in \"File > Open File > PDB Files (appendable)\" and click \"Analysis > Defined Sets\". Finally select multiple chains in Defined Sets and click \"File > Realign Selection\".)<br><br>";
58921
59087
  html += "</div></div>";
58922
59088
 
58923
59089
  html += me.htmlCls.divStr + "dl_mutation' class='" + dialogClass + "'>";
58924
59090
  html += "<div style='width:500px'>";
58925
- html += 'Please specify the mutations with a comma separated mutation list. Each mutation can be specified as "[PDB ID]_[Chain ID]_[Residue Number]_[One Letter Mutatnt Residue]". E.g., the mutation of N501Y in the E chain of PDB 6M0J can be specified as "6M0J_E_501_Y". <br/><br/>';
59091
+ html += 'Please specify the mutations with a comma separated mutation list. Each mutation can be specified as "[PDB ID or AlphaFold UniProt ID]_[Chain ID]_[Residue Number]_[One Letter Mutatnt Residue]". E.g., the mutation of N501Y in the E chain of PDB 6M0J can be specified as "6M0J_E_501_Y". For AlphaFold structures, the "Chain ID" is "A".<br/><br/>';
58926
59092
  html += "<div style='display:inline-block; width:110px'>Mutations: </div>" + me.htmlCls.inputTextStr + "id='" + me.pre + "mutationids' value='6M0J_E_484_K,6M0J_E_501_Y,6M0J_E_417_N' size=50><br/><br/>";
58927
59093
 
58928
59094
  html += "<b>Data Source</b>: <select id='" + me.pre + "idsource'>";
@@ -59262,7 +59428,7 @@ class SetDialog {
59262
59428
  html += "<div style='text-indent:1.1em'><select id='" + me.pre + "atomsCustomRealignByStruct' multiple size='5' style='min-width:130px;'>";
59263
59429
  html += "</select></div>";
59264
59430
 
59265
- html += "<div>2. " + me.htmlCls.buttonStr + "applyRealignByStruct'>Realign by Structure</button></div><br>";
59431
+ html += "<div>2. " + me.htmlCls.buttonStr + "applyRealignByStruct_tmalign'>Realign with TM-align</button>" + me.htmlCls.buttonStr + "applyRealignByStruct' style='margin-left:30px'>Realign with VAST</button></div><br>";
59266
59432
  html += "</div>";
59267
59433
 
59268
59434
 
@@ -59720,7 +59886,7 @@ class SetDialog {
59720
59886
  html += "</div>";
59721
59887
 
59722
59888
  html += me.htmlCls.divStr + "dl_rmsd' class='" + dialogClass + "'>";
59723
- html += "<br><b>Alignment RMSD</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "realignrmsd' value='35' size='10'>&#8491;<br><br>";
59889
+
59724
59890
  html += "</div>";
59725
59891
 
59726
59892
  html += me.htmlCls.divStr + "dl_buriedarea' class='" + dialogClass + "'>";
@@ -59906,7 +60072,7 @@ class Events {
59906
60072
 
59907
60073
  saveHtml(id) { let me = this.icn3dui, ic = me.icn3d;
59908
60074
  let html = '';
59909
- html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/lib/jquery-ui-1.12.1.min.css">\n';
60075
+ html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/lib/jquery-ui-1.13.2.min.css">\n';
59910
60076
  html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/icn3d_full_ui.css">\n';
59911
60077
  html += $("#" + id).html();
59912
60078
  let idArray = id.split('_');
@@ -60072,6 +60238,8 @@ class Events {
60072
60238
  // },
60073
60239
  // clickRealignonseqalign: function() {
60074
60240
  me.myEventCls.onIds("#" + me.pre + "mn2_realignonseqalign", "click", function(e) { let ic = me.icn3d;
60241
+ if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
60242
+
60075
60243
  if(Object.keys(ic.structures).length < 2) {
60076
60244
  alert("At least two structuresare required for alignment...");
60077
60245
  return;
@@ -60087,15 +60255,14 @@ class Events {
60087
60255
  if($("#" + me.pre + "atomsCustomRealign").length) {
60088
60256
  $("#" + me.pre + "atomsCustomRealign").html(definedAtomsHtml);
60089
60257
  }
60090
- //if($("#" + me.pre + "atomsCustomRealign2").length) {
60091
- // $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
60092
- //}
60093
- if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
60258
+
60094
60259
  $("#" + me.pre + "atomsCustomRealign").resizable();
60095
60260
  //$("#" + me.pre + "atomsCustomRealign2").resizable();
60096
60261
  });
60097
60262
 
60098
60263
  me.myEventCls.onIds("#" + me.pre + "mn2_realignonstruct", "click", function(e) { let ic = me.icn3d;
60264
+ if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
60265
+
60099
60266
  if(Object.keys(ic.structures).length < 2) {
60100
60267
  alert("At least two structuresare required for alignment...");
60101
60268
  return;
@@ -60110,10 +60277,7 @@ class Events {
60110
60277
  if($("#" + me.pre + "atomsCustomRealignByStruct").length) {
60111
60278
  $("#" + me.pre + "atomsCustomRealignByStruct").html(definedAtomsHtml);
60112
60279
  }
60113
- //if($("#" + me.pre + "atomsCustomRealign2").length) {
60114
- // $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
60115
- //}
60116
- if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
60280
+
60117
60281
  $("#" + me.pre + "atomsCustomRealignByStruct").resizable();
60118
60282
  //$("#" + me.pre + "atomsCustomRealign2").resizable();
60119
60283
  });
@@ -60163,6 +60327,25 @@ class Events {
60163
60327
  me.htmlCls.clickMenuCls.setLogCmd("realign on structure align", true);
60164
60328
  }
60165
60329
  });
60330
+
60331
+ me.myEventCls.onIds("#" + me.pre + "applyRealignByStruct_tmalign", "click", function(e) { let ic = me.icn3d;
60332
+ e.preventDefault();
60333
+ if(!me.cfg.notebook) dialog.dialog( "close" );
60334
+ let nameArray = $("#" + me.pre + "atomsCustomRealignByStruct").val();
60335
+ if(nameArray.length > 0) {
60336
+ ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
60337
+ }
60338
+
60339
+ me.cfg.aligntool = 'tmalign';
60340
+
60341
+ ic.realignParserCls.realignOnStructAlign();
60342
+ if(nameArray.length > 0) {
60343
+ me.htmlCls.clickMenuCls.setLogCmd("realign on tmalign | " + nameArray, true);
60344
+ }
60345
+ else {
60346
+ me.htmlCls.clickMenuCls.setLogCmd("realign on tmalign", true);
60347
+ }
60348
+ });
60166
60349
  // },
60167
60350
 
60168
60351
  me.myEventCls.onIds("#" + me.pre + "applyColorSpectrumBySets", "click", function(e) { let ic = me.icn3d;
@@ -60386,19 +60569,28 @@ class Events {
60386
60569
  window.open(hostUrl + '?align=' + alignment + '&showalignseq=1&atype=0&bu=1', '_blank');
60387
60570
  });
60388
60571
 
60389
- me.myEventCls.onIds("#" + me.pre + "reload_alignaf", "click", function(e) { me.icn3d;
60572
+ me.myEventCls.onIds("#" + me.pre + "reload_alignaf", "click", function(e) { me.icn3d;
60390
60573
  e.preventDefault();
60391
60574
  if(!me.cfg.notebook) dialog.dialog( "close" );
60392
60575
  let alignment = $("#" + me.pre + "alignafid1").val() + "_A," + $("#" + me.pre + "alignafid2").val() + "_A";
60393
60576
  me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment + " | residues | resdef ", false);
60394
60577
  window.open(hostUrl + '?chainalign=' + alignment + '&resnum=&resdef=&showalignseq=1', '_blank');
60395
60578
  });
60579
+
60580
+ me.myEventCls.onIds("#" + me.pre + "reload_alignaf_tmalign", "click", function(e) { me.icn3d;
60581
+ e.preventDefault();
60582
+ if(!me.cfg.notebook) dialog.dialog( "close" );
60583
+ let alignment = $("#" + me.pre + "alignafid1").val() + "_A," + $("#" + me.pre + "alignafid2").val() + "_A";
60584
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment + " | residues | resdef | align tmalign", false);
60585
+ window.open(hostUrl + '?chainalign=' + alignment + '&aligntool=tmalign&resnum=&resdef=&showalignseq=1', '_blank');
60586
+ });
60396
60587
  // },
60397
60588
  // clickReload_chainalign: function() {
60398
- me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { me.icn3d;
60589
+ /*
60590
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { let ic = me.icn3d;
60399
60591
  e.preventDefault();
60400
60592
  if(!me.cfg.notebook) dialog.dialog( "close" );
60401
- // let alignment = $("#" + me.pre + "chainalignid1").val() + "," + $("#" + me.pre + "chainalignid2").val();
60593
+
60402
60594
  let alignment = $("#" + me.pre + "chainalignids").val();
60403
60595
  let idArray = alignment.split(',');
60404
60596
  let alignment_final = '';
@@ -60408,21 +60600,20 @@ class Events {
60408
60600
  }
60409
60601
  let resalign = $("#" + me.pre + "resalignids").val();
60410
60602
  let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
60411
-
60412
60603
  if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
60413
60604
  alert("Please make sure the number of chains and the lines of predefined residues are the same...");
60414
60605
  return;
60415
60606
  }
60416
60607
 
60417
60608
  me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " | residues " + resalign + " | resdef " + predefinedres, false);
60418
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?chainalign=' + alignment + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1', '_blank');
60419
60609
  window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1', '_blank');
60420
60610
  });
60611
+ */
60421
60612
 
60422
60613
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym", "click", function(e) { me.icn3d;
60423
60614
  e.preventDefault();
60424
60615
  if(!me.cfg.notebook) dialog.dialog( "close" );
60425
- // let alignment = $("#" + me.pre + "chainalignid1").val() + "," + $("#" + me.pre + "chainalignid2").val();
60616
+
60426
60617
  let alignment = $("#" + me.pre + "chainalignids").val();
60427
60618
  let idArray = alignment.split(',');
60428
60619
  let alignment_final = '';
@@ -60430,18 +60621,66 @@ class Events {
60430
60621
  alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
60431
60622
  if(i < il - 1) alignment_final += ',';
60432
60623
  }
60433
- let resalign = $("#" + me.pre + "resalignids").val();
60434
- let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
60435
- if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
60436
- alert("Please make sure the number of chains and the lines of predefined residues are the same...");
60437
- return;
60438
- }
60439
60624
 
60440
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues " + resalign + " | resdef " + predefinedres, false);
60441
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?chainalign=' + alignment + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1&bu=0', '_blank');
60442
- window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1&bu=0', '_blank');
60625
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef ", false);
60626
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=&resdef=&showalignseq=1&bu=0', '_blank');
60443
60627
  });
60444
60628
 
60629
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym2", "click", function(e) { me.icn3d;
60630
+ e.preventDefault();
60631
+ if(!me.cfg.notebook) dialog.dialog( "close" );
60632
+
60633
+ let alignment = $("#" + me.pre + "chainalignids2").val();
60634
+ let idArray = alignment.split(',');
60635
+ let alignment_final = '';
60636
+ for(let i = 0, il = idArray.length; i < il; ++i) {
60637
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
60638
+ if(i < il - 1) alignment_final += ',';
60639
+ }
60640
+ let resalign = $("#" + me.pre + "resalignids").val();
60641
+
60642
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues " + resalign + " | resdef ", false);
60643
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=&showalignseq=1&bu=0', '_blank');
60644
+ });
60645
+
60646
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym3", "click", function(e) { me.icn3d;
60647
+ e.preventDefault();
60648
+ if(!me.cfg.notebook) dialog.dialog( "close" );
60649
+
60650
+ let alignment = $("#" + me.pre + "chainalignids3").val();
60651
+ let idArray = alignment.split(',');
60652
+ let alignment_final = '';
60653
+ for(let i = 0, il = idArray.length; i < il; ++i) {
60654
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
60655
+ if(i < il - 1) alignment_final += ',';
60656
+ }
60657
+
60658
+ let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
60659
+ if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
60660
+ alert("Please make sure the number of chains and the lines of predefined residues are the same...");
60661
+ return;
60662
+ }
60663
+
60664
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef " + predefinedres, false);
60665
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=&resdef=' + predefinedres + '&showalignseq=1&bu=0', '_blank');
60666
+ });
60667
+
60668
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_tmalign", "click", function(e) { me.icn3d;
60669
+ e.preventDefault();
60670
+ if(!me.cfg.notebook) dialog.dialog( "close" );
60671
+
60672
+ let alignment = $("#" + me.pre + "chainalignids").val();
60673
+ let idArray = alignment.split(',');
60674
+ let alignment_final = '';
60675
+ for(let i = 0, il = idArray.length; i < il; ++i) {
60676
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
60677
+ if(i < il - 1) alignment_final += ',';
60678
+ }
60679
+
60680
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef | align tmalign", false);
60681
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&aligntool=tmalign&resnum=&resdef=&showalignseq=1&bu=0', '_blank');
60682
+ });
60683
+
60445
60684
  me.myEventCls.onIds("#" + me.pre + "reload_mutation_3d", "click", function(e) { me.icn3d;
60446
60685
  e.preventDefault();
60447
60686
  if(!me.cfg.notebook) dialog.dialog( "close" );
@@ -61546,6 +61785,27 @@ class Events {
61546
61785
  let color = $("#" + me.pre + "colorcustom").val();
61547
61786
  picker.set('#' + color).enter();
61548
61787
  });
61788
+
61789
+ let picker2 = new CP(document.querySelector("#" + me.pre + "labelcolorall"));
61790
+ picker2.on("change", function(color) {
61791
+ this.target.value = color;
61792
+ });
61793
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "input", function() {
61794
+ let color = $("#" + me.pre + "labelcolorall").val();
61795
+ picker2.set('#' + color).enter();
61796
+ });
61797
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "keyup", function() {
61798
+ let color = $("#" + me.pre + "labelcolorall").val();
61799
+ picker2.set('#' + color).enter();
61800
+ });
61801
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "paste", function() {
61802
+ let color = $("#" + me.pre + "labelcolorall").val();
61803
+ picker2.set('#' + color).enter();
61804
+ });
61805
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "cut", function() {
61806
+ let color = $("#" + me.pre + "labelcolorall").val();
61807
+ picker2.set('#' + color).enter();
61808
+ });
61549
61809
  // },
61550
61810
  // clickApplypick_stabilizer_rm: function() {
61551
61811
  me.myEventCls.onIds("#" + me.pre + "applypick_stabilizer_rm", "click", function(e) { let ic = me.icn3d;
@@ -62820,7 +63080,7 @@ class SetHtml {
62820
63080
  return html;
62821
63081
  }
62822
63082
 
62823
- exportPqr() { let me = this.icn3dui, ic = me.icn3d;
63083
+ exportPqr(bPdb) { let me = this.icn3dui, ic = me.icn3d;
62824
63084
  let ionHash = {};
62825
63085
  let atomHash = {};
62826
63086
  /*
@@ -62852,13 +63112,15 @@ class SetHtml {
62852
63112
  }
62853
63113
  }
62854
63114
 
63115
+ let fileExt = (bPdb) ? 'pdb' : 'pqr';
62855
63116
  if(me.cfg.cid) {
62856
63117
  let pqrStr = '';
62857
63118
  /// pqrStr += ic.saveFileCls.getPDBHeader();
62858
- pqrStr += ic.saveFileCls.getAtomPDB(atomHash, true) + ic.saveFileCls.getAtomPDB(ionHash, true);
63119
+ let bPqr = (bPdb) ? false : true;
63120
+ pqrStr += ic.saveFileCls.getAtomPDB(atomHash, bPqr) + ic.saveFileCls.getAtomPDB(ionHash, bPqr);
62859
63121
 
62860
63122
  let file_pref =(ic.inputid) ? ic.inputid : "custom";
62861
- ic.saveFileCls.saveFile(file_pref + '_icn3d.pqr', 'text', [pqrStr]);
63123
+ ic.saveFileCls.saveFile(file_pref + '_icn3d.' + fileExt, 'text', [pqrStr]);
62862
63124
  }
62863
63125
  else {
62864
63126
  let bCalphaOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms));
@@ -62894,8 +63156,40 @@ class SetHtml {
62894
63156
  success: function(data) {
62895
63157
  let pqrStr = data;
62896
63158
 
63159
+ if(bPdb) {
63160
+ let lineArray = pqrStr.split('\n');
63161
+
63162
+ let pdbStr = '';
63163
+ for(let i = 0, il = lineArray.length; i < il; ++i) {
63164
+ let line = lineArray[i];
63165
+ if(line.substr(0, 6) == 'ATOM ' || line.substr(0, 6) == 'HETATM') {
63166
+ let atomName = line.substr(12, 4).trim();
63167
+ let elem;
63168
+ if(line.substr(0, 6) == 'ATOM ') {
63169
+ elem = atomName.substr(0, 1);
63170
+ }
63171
+ else {
63172
+ let twochar = atomName.substr(0, 2);
63173
+ if(me.parasCls.vdwRadii.hasOwnProperty(twochar)) {
63174
+ elem = twochar;
63175
+ }
63176
+ else {
63177
+ elem = atomName.substr(0, 1);
63178
+ }
63179
+ }
63180
+
63181
+ pdbStr += line.substr(0, 54) + ' ' + elem.padStart(2, ' ') + '\n';
63182
+ }
63183
+ else {
63184
+ pdbStr += line + '\n';
63185
+ }
63186
+ }
63187
+
63188
+ pqrStr = pdbStr;
63189
+ }
63190
+
62897
63191
  let file_pref =(ic.inputid) ? ic.inputid : "custom";
62898
- ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.pqr', 'text', [pqrStr]);
63192
+ ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.' + fileExt, 'text', [pqrStr]);
62899
63193
  },
62900
63194
  error : function(xhr, textStatus, errorThrown ) {
62901
63195
  this.tryCount++;
@@ -63260,7 +63554,8 @@ class Html {
63260
63554
  this.simulation = undefined;
63261
63555
 
63262
63556
  //this.baseUrl = "https://structure.ncbi.nlm.nih.gov/";
63263
- this.baseUrl = "https://www.ncbi.nlm.nih.gov/Structure/";
63557
+ this.baseUrl = (window && window.location && window.location.hostname == 'structure.ncbi.nlm.nih.gov')
63558
+ ? "https://structure.ncbi.nlm.nih.gov/Structure/" : "https://www.ncbi.nlm.nih.gov/Structure/";
63264
63559
  this.divStr = "<div id='" + this.icn3dui.pre;
63265
63560
  this.divNowrapStr = "<div style='white-space:nowrap'>";
63266
63561
  this.spanNowrapStr = "<span style='white-space:nowrap'>";
@@ -66748,7 +67043,7 @@ class iCn3DUI {
66748
67043
  //even when multiple iCn3D viewers are shown together.
66749
67044
  this.pre = this.cfg.divid + "_";
66750
67045
 
66751
- this.REVISION = '3.12.8';
67046
+ this.REVISION = '3.13.2';
66752
67047
 
66753
67048
  // In nodejs, iCn3D defines "window = {navigator: {}}"
66754
67049
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -67158,7 +67453,7 @@ iCn3DUI.prototype.show3DStructure = function(pdbStr) { let me = this;
67158
67453
 
67159
67454
  ic.bChainAlign = true;
67160
67455
  ic.inputid = me.cfg.chainalign;
67161
- ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + me.cfg.resdef + ' | parameters ' + me.cfg.inpara;
67456
+ ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + me.cfg.resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara;
67162
67457
  me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
67163
67458
  ic.chainalignParserCls.downloadChainalignment(me.cfg.chainalign, me.cfg.resnum, me.cfg.resdef);
67164
67459
  }