icn3d 3.12.9 → 3.13.0

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
@@ -24787,6 +24787,7 @@ class RealignParser {
24787
24787
 
24788
24788
  let ajaxArray = [], chainidPairArray = [];
24789
24789
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
24790
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
24790
24791
  let structArray = Object.keys(struct2domain);
24791
24792
  for(let s = 0, sl = structArray.length; s < sl; ++s) {
24792
24793
  let struct1 = structArray[s];
@@ -24802,16 +24803,32 @@ class RealignParser {
24802
24803
  for(let j = 0, jl = chainidArray2.length; j < jl; ++j) {
24803
24804
  let chainid2 = chainidArray2[j];
24804
24805
 
24805
- let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct1][chainid1]);
24806
- let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct2][chainid2]);
24807
-
24808
- let alignAjax = $.ajax({
24809
- url: urlalign,
24810
- type: 'POST',
24811
- data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
24812
- dataType: 'jsonp',
24813
- cache: true
24814
- });
24806
+ let alignAjax;
24807
+
24808
+ if(me.cfg.aligntool != 'tmalign') {
24809
+ let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct1][chainid1]);
24810
+ let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct2][chainid2]);
24811
+
24812
+ alignAjax = $.ajax({
24813
+ url: urlalign,
24814
+ type: 'POST',
24815
+ data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
24816
+ dataType: 'jsonp',
24817
+ cache: true
24818
+ });
24819
+ }
24820
+ else {
24821
+ let pdb_target = ic.saveFileCls.getAtomPDB(struct2domain[struct1][chainid1]);
24822
+ let pdb_query = ic.saveFileCls.getAtomPDB(struct2domain[struct2][chainid2]);
24823
+
24824
+ alignAjax = $.ajax({
24825
+ url: urltmalign,
24826
+ type: 'POST',
24827
+ data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
24828
+ dataType: 'jsonp',
24829
+ cache: true
24830
+ });
24831
+ }
24815
24832
 
24816
24833
  ajaxArray.push(alignAjax);
24817
24834
  chainidPairArray.push(chainid1 + ',' + chainid2); // chainid2 is target
@@ -25183,6 +25200,7 @@ class ChainalignParser {
25183
25200
  // dynamicly align pairs in ic.afChainIndexHash
25184
25201
  let ajaxArray = [], indexArray = [], struArray = [];
25185
25202
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
25203
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
25186
25204
 
25187
25205
  for(let index in ic.afChainIndexHash) {
25188
25206
  let idArray = ic.afChainIndexHash[index].split('_');
@@ -25191,17 +25209,31 @@ class ChainalignParser {
25191
25209
  mmdbid_t = idArray[2];
25192
25210
  let chain_t = idArray[3];
25193
25211
 
25194
- let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_q + '_' + chain_q]);
25195
-
25196
- let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_t + '_' + chain_t]);
25197
-
25198
- let alignAjax = $.ajax({
25199
- url: urlalign,
25200
- type: 'POST',
25201
- data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
25202
- dataType: 'jsonp',
25203
- cache: true
25204
- });
25212
+ let alignAjax;
25213
+ if(me.cfg.aligntool != 'tmalign') {
25214
+ let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_q + '_' + chain_q]);
25215
+ let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_t + '_' + chain_t]);
25216
+
25217
+ alignAjax = $.ajax({
25218
+ url: urlalign,
25219
+ type: 'POST',
25220
+ data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
25221
+ dataType: 'jsonp',
25222
+ cache: true
25223
+ });
25224
+ }
25225
+ else {
25226
+ let pdb_query = ic.saveFileCls.getAtomPDB(ic.chains[mmdbid_q + '_' + chain_q]);
25227
+ let pdb_target= ic.saveFileCls.getAtomPDB(ic.chains[mmdbid_t + '_' + chain_t]);
25228
+
25229
+ alignAjax = $.ajax({
25230
+ url: urltmalign,
25231
+ type: 'POST',
25232
+ data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
25233
+ dataType: 'jsonp',
25234
+ cache: true
25235
+ });
25236
+ }
25205
25237
 
25206
25238
  ajaxArray.push(alignAjax);
25207
25239
  indexArray.push(index - 1);
@@ -25333,6 +25365,9 @@ class ChainalignParser {
25333
25365
  // set trans and rotation matrix
25334
25366
  ic.t_trans_add = [];
25335
25367
  ic.q_trans_sub = [];
25368
+
25369
+ if(me.cfg.aligntool == 'tmalign') ic.q_trans_add = [];
25370
+
25336
25371
  ic.q_rotation = [];
25337
25372
  ic.qt_start_end = [];
25338
25373
 
@@ -25477,30 +25512,37 @@ class ChainalignParser {
25477
25512
  for(let i = 0, il = chainidArray.length; i < il; ++i) {
25478
25513
  for(let serial in ic.chains[chainidArray[i]]) {
25479
25514
  let atm = ic.atoms[serial];
25480
- //atm.coord = new THREE.Vector3(atm.coord[0], atm.coord[1], atm.coord[2]);
25481
- if(ic.q_rotation !== undefined && ic.t_trans_add.length > 0 && !me.cfg.resnum && !me.cfg.resdef) {
25515
+ //if(ic.q_rotation !== undefined && ic.t_trans_add.length > 0 && !me.cfg.resnum && !me.cfg.resdef) {
25516
+ if(ic.q_rotation !== undefined && !me.cfg.resnum && !me.cfg.resdef) {
25482
25517
  atm = this.transformAtom(atm, index, alignType);
25483
25518
  }
25484
25519
  }
25485
25520
  }
25486
-
25487
-
25488
25521
  }
25489
25522
 
25490
- transformAtom(atm, index, alignType) { let ic = this.icn3d; ic.icn3dui;
25523
+ transformAtom(atm, index, alignType) { let ic = this.icn3d, me = ic.icn3dui;
25491
25524
  if(alignType === 'target') ;
25492
25525
  else if(alignType === 'query') {
25493
- atm.coord.x -= ic.q_trans_sub[index].x;
25494
- atm.coord.y -= ic.q_trans_sub[index].y;
25495
- atm.coord.z -= ic.q_trans_sub[index].z;
25526
+ if(me.cfg.aligntool != 'tmalign') {
25527
+ atm.coord.x -= ic.q_trans_sub[index].x;
25528
+ atm.coord.y -= ic.q_trans_sub[index].y;
25529
+ atm.coord.z -= ic.q_trans_sub[index].z;
25530
+ }
25496
25531
 
25497
25532
  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;
25498
25533
  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;
25499
25534
  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;
25500
25535
 
25501
- x -= ic.t_trans_add[index].x;
25502
- y -= ic.t_trans_add[index].y;
25503
- z -= ic.t_trans_add[index].z;
25536
+ if(me.cfg.aligntool != 'tmalign') {
25537
+ x -= ic.t_trans_add[index].x;
25538
+ y -= ic.t_trans_add[index].y;
25539
+ z -= ic.t_trans_add[index].z;
25540
+ }
25541
+ else {
25542
+ x += ic.q_trans_add[index].x;
25543
+ y += ic.q_trans_add[index].y;
25544
+ z += ic.q_trans_add[index].z;
25545
+ }
25504
25546
 
25505
25547
  atm.coord.x = x;
25506
25548
  atm.coord.y = y;
@@ -25685,7 +25727,8 @@ class ChainalignParser {
25685
25727
  let chainalignFinal = ic.mmdbid_q + "_" + ic.chain_q + "," + ic.mmdbid_t + "_" + ic.chain_t;
25686
25728
  let domainalign = (domainArray.length > 0) ? domainArray[index] + "," + domainArray[0] : undefined;
25687
25729
 
25688
- if(ic.mmdbid_t.length == 4 && ic.mmdbid_q.length == 4) {
25730
+ // TM-align (me.cfg.aligntool == 'tmalign') needs to input PDB
25731
+ if(me.cfg.aligntool != 'tmalign' && ic.mmdbid_t.length == 4 && ic.mmdbid_q.length == 4) {
25689
25732
  let urlalign;
25690
25733
 
25691
25734
  if(domainArray.length > 0) {
@@ -25719,7 +25762,8 @@ class ChainalignParser {
25719
25762
  thisClass.parseChainAlignData(dataArray, alignArray, ic.mmdbid_t, ic.chain_t);
25720
25763
  })
25721
25764
  .fail(function() {
25722
- var aaa = 1; //alert("These chains can not be aligned by VAST server. You can specify the residue range and try it again...");
25765
+ let serverName = (me.cfg.aligntool == 'tmalign') ? 'TM-align' : 'VAST';
25766
+ var aaa = 1; //alert("These chains can not be aligned by " + serverName + ". You can specify the residue range and try it again...");
25723
25767
  // thisClass.parseChainAlignData(arguments, alignArray, ic.mmdbid_t, ic.chain_t);
25724
25768
  });
25725
25769
  }
@@ -25737,6 +25781,9 @@ class ChainalignParser {
25737
25781
 
25738
25782
  ic.t_trans_add = [];
25739
25783
  ic.q_trans_sub = [];
25784
+
25785
+ if(me.cfg.aligntool == 'tmalign') ic.q_trans_add = [];
25786
+
25740
25787
  ic.q_rotation = [];
25741
25788
  ic.qt_start_end = [];
25742
25789
 
@@ -25782,6 +25829,9 @@ class ChainalignParser {
25782
25829
  // need to pass C-alpha coords and get transformation matrix from backend
25783
25830
  ic.t_trans_add[index-1] = {"x":0, "y":0, "z":0};
25784
25831
  ic.q_trans_sub[index-1] = {"x":0, "y":0, "z":0};
25832
+
25833
+ if(me.cfg.aligntool == 'tmalign') ic.q_trans_add[index-1] = {"x":0, "y":0, "z":0};
25834
+
25785
25835
  ic.q_rotation[index-1] = {"x1":1, "y1":0, "z1":0, "x2":0, "y2":1, "z2":0, "x3":0, "y3":0, "z3":1};
25786
25836
  ic.qt_start_end[index-1] = undefined;
25787
25837
  }
@@ -25804,7 +25854,8 @@ class ChainalignParser {
25804
25854
  processAlign(align, index, queryData, bEqualMmdbid, bEqualChain, bNoAlert) { let ic = this.icn3d, me = ic.icn3dui;
25805
25855
  let bAligned = false;
25806
25856
  if((!align || align.length == 0) && !bNoAlert) {
25807
- var aaa = 1; //alert("These chains can not be aligned by VAST server.");
25857
+ let serverName = (me.cfg.aligntool == 'tmalign') ? 'TM-align' : 'VAST';
25858
+ var aaa = 1; //alert("These chains can not be aligned by " + serverName + ".");
25808
25859
  return bAligned;
25809
25860
  }
25810
25861
 
@@ -25837,13 +25888,20 @@ class ChainalignParser {
25837
25888
  */
25838
25889
  ic.t_trans_add[index] = align[0].t_trans_add;
25839
25890
  ic.q_trans_sub[index] = align[0].q_trans_sub;
25891
+
25892
+ if(me.cfg.aligntool == 'tmalign') ic.q_trans_add[index] = align[0].q_trans_add;
25893
+
25840
25894
  ic.q_rotation[index] = align[0].q_rotation;
25841
25895
  ic.qt_start_end[index] = align[0].segs;
25842
25896
 
25843
25897
  let rmsd = align[0].super_rmsd;
25844
25898
 
25845
- me.htmlCls.clickMenuCls.setLogCmd("RMSD of alignment: " + rmsd.toPrecision(4), false);
25846
- $("#" + ic.pre + "realignrmsd").val(rmsd.toPrecision(4));
25899
+ let logStr = "alignment RMSD: " + rmsd.toPrecision(4);
25900
+ if(me.cfg.aligntool == 'tmalign') logStr += "; TM-score: " + align[0].score.toPrecision(4);
25901
+ me.htmlCls.clickMenuCls.setLogCmd(logStr, false);
25902
+ let html = "<br><b>Alignment RMSD</b>: " + rmsd.toPrecision(4) + " &#8491;<br>";
25903
+ if(me.cfg.aligntool == 'tmalign') html += "<b>TM-score</b>: " + align[0].score.toPrecision(4) + "<br><br>";
25904
+ $("#" + ic.pre + "dl_rmsd").html(html);
25847
25905
  if(!me.cfg.bSidebyside) me.htmlCls.dialogCls.openDlg('dl_rmsd', 'RMSD of alignment');
25848
25906
 
25849
25907
  bAligned = true;
@@ -27729,6 +27787,24 @@ class LoadScript {
27729
27787
 
27730
27788
  return;
27731
27789
  }
27790
+ else if(ic.commands[i].trim().indexOf('realign on tmalign') == 0) {
27791
+ let strArray = ic.commands[i].split("|||");
27792
+ let command = strArray[0].trim();
27793
+
27794
+ let paraArray = command.split(' | ');
27795
+ if(paraArray.length == 2) {
27796
+ let nameArray = paraArray[1].split(',');
27797
+ ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
27798
+ }
27799
+
27800
+ me.cfg.aligntool = 'tmalign';
27801
+
27802
+ $.when(thisClass.applyCommandRealignByStruct(command)).then(function() {
27803
+ thisClass.execCommandsBase(i + 1, end, steps);
27804
+ });
27805
+
27806
+ return;
27807
+ }
27732
27808
  else if(ic.commands[i].trim().indexOf('graph interaction pairs') == 0) {
27733
27809
  let strArray = ic.commands[i].split("|||");
27734
27810
  let command = strArray[0].trim();
@@ -27917,6 +27993,17 @@ class LoadScript {
27917
27993
  }
27918
27994
  thisClass.applyCommandRealignByStruct(lastCommand);
27919
27995
  }
27996
+ else if(lastCommand.indexOf('realign on tmalign') == 0) {
27997
+ let paraArray = lastCommand.split(' | ');
27998
+ if(paraArray.length == 2) {
27999
+ let nameArray = paraArray[1].split(',');
28000
+ ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
28001
+ }
28002
+
28003
+ me.cfg.aligntool = 'tmalign';
28004
+
28005
+ thisClass.applyCommandRealignByStruct(lastCommand);
28006
+ }
27920
28007
  else if(lastCommand.indexOf('graph interaction pairs') == 0) {
27921
28008
  thisClass.applyCommandGraphinteraction(lastCommand);
27922
28009
  }
@@ -28048,14 +28135,20 @@ class LoadScript {
28048
28135
  ic.alignParserCls.downloadAlignment(id);
28049
28136
  }
28050
28137
  else if(command.indexOf('load chainalignment') !== -1) {
28051
- //load chainalignment [id] | resnum [resnum] | parameters [inpara]
28138
+ //load chainalignment [id] | resnum [resnum] | resdef [resnum] | aligntool [aligntool] | parameters [inpara]
28052
28139
  let urlArray = command.split(" | ");
28053
- if(urlArray[1].indexOf('resnum') != -1) {
28054
- me.cfg.resnum = urlArray[1].substr(urlArray[1].indexOf('resnum') + 7);
28140
+ if(urlArray.length > 1 && urlArray[1].indexOf('resnum') != -1) {
28141
+ me.cfg.resnum = urlArray[1].substr(urlArray[1].indexOf('resnum') + 7);
28142
+ }
28143
+ if(urlArray.length > 2 && urlArray[2].indexOf('resdef') != -1) {
28144
+ me.cfg.resdef = urlArray[2].substr(urlArray[1].indexOf('resdef') + 7);
28145
+ }
28146
+ if(urlArray.length > 3 && urlArray[3].indexOf('aligntool') != -1) {
28147
+ me.cfg.aligntool = urlArray[3].substr(urlArray[1].indexOf('aligntool') + 10);
28055
28148
  }
28056
28149
 
28057
28150
  me.cfg.chainalign = id;
28058
- ic.chainalignParserCls.downloadChainalignment(id, me.cfg.resnum);
28151
+ ic.chainalignParserCls.downloadChainalignment(id, me.cfg.resnum, me.cfg.resdef);
28059
28152
  }
28060
28153
  else if(command.indexOf('load url') !== -1) {
28061
28154
  let typeStr = load_parameters[1]; // type pdb
@@ -36199,7 +36292,7 @@ class ParserUtils {
36199
36292
 
36200
36293
  if(rmsd) {
36201
36294
  me.htmlCls.clickMenuCls.setLogCmd("realignment RMSD: " + rmsd.toPrecision(4), false);
36202
- $("#" + ic.pre + "realignrmsd").val(rmsd.toPrecision(4));
36295
+ $("#" + ic.pre + "dl_rmsd").html("<br><b>Realignment RMSD</b>: " + rmsd.toPrecision(4) + " &#8491;<br><br>");
36203
36296
  if(!me.cfg.bSidebyside) me.htmlCls.dialogCls.openDlg('dl_rmsd', 'Realignment RMSD');
36204
36297
  }
36205
36298
 
@@ -36569,7 +36662,7 @@ class ParserUtils {
36569
36662
  let rmsd = ic.rmsd_supr.rmsd;
36570
36663
 
36571
36664
  me.htmlCls.clickMenuCls.setLogCmd("RMSD of alignment to OPM: " + rmsd.toPrecision(4), false);
36572
- $("#" + ic.pre + "realignrmsd").val(rmsd.toPrecision(4));
36665
+ $("#" + ic.pre + "dl_rmsd").html("<br><b>RMSD of alignment to OPM</b>: " + rmsd.toPrecision(4) + " &#8491;<br><br>");
36573
36666
  if(!me.cfg.bSidebyside) me.htmlCls.dialogCls.openDlg('dl_rmsd', 'RMSD of alignment to OPM');
36574
36667
 
36575
36668
  let dxymaxsq = 0;
@@ -55639,10 +55732,10 @@ class SetMenu {
55639
55732
  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>";
55640
55733
  }
55641
55734
 
55642
- setIcon(iconType, id, title, iconStyle, url, bText) { let me = this.icn3dui;
55735
+ setIcon(iconType, id, title, iconStyle, url, bText, bHighlight) { let me = this.icn3dui;
55643
55736
  if(me.bNode) return '';
55644
55737
 
55645
- let color = 'color:#1c94c4; ';
55738
+ let color = (bHighlight) ? 'color:#f8b84e; ' : 'color:#1c94c4; ';
55646
55739
  let bkgdColor = ' background-color:#EEE; ';
55647
55740
  let cssCursor = (iconType == 'text') ? '' : 'cursor:pointer;';
55648
55741
 
@@ -55689,7 +55782,7 @@ class SetMenu {
55689
55782
  // View menu
55690
55783
  html += tdStrBorder + this.setIcon(iconType, 'show_selected', 'View Selection', 'eye') + "</td>";
55691
55784
  html += tdStr + this.setIcon(iconType, 'tool_selectedcenter', 'Zoom in Selection', 'search-plus') + "</td>";
55692
- html += tdStr + this.setIcon(iconType, 'alternate', "Alternate the Structures by keying the letter 'a'", 'a', undefined, true) + "</td>";
55785
+ html += tdStr + this.setIcon(iconType, 'alternate', "Alternate the Structures by keying the letter 'a'", 'a', undefined, true, true) + "</td>";
55693
55786
  html += tdStr + this.setIcon(iconType, 'tool_resetOrientation', 'Reset Orientation', 'undo-alt') + "</td>";
55694
55787
 
55695
55788
  // Style menu
@@ -55903,7 +55996,9 @@ class SetMenu {
55903
55996
 
55904
55997
  html += "<li id='" + me.pre + "mn2_realignWrap'><span>Realign Selection</span>";
55905
55998
  html += "<ul>";
55906
- html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignonstruct', 'by Structure Alignment ' + me.htmlCls.wifiStr, true);
55999
+
56000
+ html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignonstruct', 'by Structure Alignment ' + me.htmlCls.wifiStr);
56001
+
55907
56002
  html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignonseqalign', 'by Sequence Alignment ' + me.htmlCls.wifiStr);
55908
56003
  html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignresbyres', 'Residue by Residue');
55909
56004
  html += "</ul>";
@@ -57687,10 +57782,10 @@ class Dialog {
57687
57782
  height = 500;
57688
57783
  }
57689
57784
  else if(id === me.pre + 'dl_rmsd') {
57690
- position ={ my: "right top", at: "right top", of: "#" + me.pre + "canvas", collision: "none" };
57785
+ position ={ my: "left bottom", at: "left+20 bottom-20", of: "#" + me.pre + "canvas", collision: "none" };
57691
57786
  }
57692
57787
  else if(id === me.pre + 'dl_legend') {
57693
- position ={ my: "right top", at: "right-20 top+60", of: "#" + me.pre + "canvas", collision: "none" };
57788
+ position ={ my: "left bottom", at: "left+20 bottom-20", of: "#" + me.pre + "canvas", collision: "none" };
57694
57789
  }
57695
57790
  else if(id === me.pre + 'dl_symd') {
57696
57791
  position ={ my: "left top", at: "right-200 bottom-200", of: "#" + me.pre + "canvas", collision: "none" };
@@ -58000,23 +58095,19 @@ class SetDialog {
58000
58095
 
58001
58096
  html += me.htmlCls.divStr + "dl_alignaf' class='" + dialogClass + "'>";
58002
58097
  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/>";
58003
- html += me.htmlCls.buttonStr + "reload_alignaf'>Align</button>";
58098
+ 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>";
58004
58099
  html += "</div>";
58005
58100
 
58006
58101
  html += me.htmlCls.divStr + "dl_chainalign' class='" + dialogClass + "'>";
58007
- /*
58008
- 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/>";
58009
- html += me.htmlCls.buttonStr + "reload_chainalign'>Align</button><br/><br/>";
58010
- 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>";
58011
- html += "</div>";
58012
- */
58013
58102
  html += "<div style='width:550px'>";
58014
58103
  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/>";
58015
58104
  html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
58016
58105
  html += "<b>Optional 1</b>, full chains are used for structure alignment<br/><br/>";
58017
58106
  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/>";
58018
58107
  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/>";
58019
- 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/>";
58108
+ //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/>";
58109
+ html += me.htmlCls.buttonStr + "reload_chainalign_tmalign'>Align with TM-align</button>" + me.htmlCls.buttonStr + "reload_chainalign_asym' style='margin-left:30px'>Align with VAST</button><br/><br/>";
58110
+
58020
58111
  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>";
58021
58112
  html += "</div></div>";
58022
58113
 
@@ -58362,7 +58453,7 @@ class SetDialog {
58362
58453
  html += "<div style='text-indent:1.1em'><select id='" + me.pre + "atomsCustomRealignByStruct' multiple size='5' style='min-width:130px;'>";
58363
58454
  html += "</select></div>";
58364
58455
 
58365
- html += "<div>2. " + me.htmlCls.buttonStr + "applyRealignByStruct'>Realign by Structure</button></div><br>";
58456
+ 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>";
58366
58457
  html += "</div>";
58367
58458
 
58368
58459
 
@@ -58820,7 +58911,7 @@ class SetDialog {
58820
58911
  html += "</div>";
58821
58912
 
58822
58913
  html += me.htmlCls.divStr + "dl_rmsd' class='" + dialogClass + "'>";
58823
- html += "<br><b>Alignment RMSD</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "realignrmsd' value='35' size='10'>&#8491;<br><br>";
58914
+
58824
58915
  html += "</div>";
58825
58916
 
58826
58917
  html += me.htmlCls.divStr + "dl_buriedarea' class='" + dialogClass + "'>";
@@ -59016,6 +59107,24 @@ class Events {
59016
59107
  ic.saveFileCls.saveFile(structureStr + '-' + idStr + '.html', 'html', encodeURIComponent(html));
59017
59108
  }
59018
59109
 
59110
+ getAlignParas() { let me = this.icn3dui; me.icn3d;
59111
+ let alignment = $("#" + me.pre + "chainalignids").val();
59112
+ let idArray = alignment.split(',');
59113
+ let alignment_final = '';
59114
+ for(let i = 0, il = idArray.length; i < il; ++i) {
59115
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59116
+ if(i < il - 1) alignment_final += ',';
59117
+ }
59118
+ let resalign = $("#" + me.pre + "resalignids").val();
59119
+ let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
59120
+ if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
59121
+ var aaa = 1; //alert("Please make sure the number of chains and the lines of predefined residues are the same...");
59122
+ return;
59123
+ }
59124
+
59125
+ return {"alignment": alignment_final, "resalign": resalign, "predefinedres": predefinedres};
59126
+ }
59127
+
59019
59128
  //Hold all functions related to click events.
59020
59129
  allEventFunctions() { let me = this.icn3dui, ic = me.icn3d;
59021
59130
  let thisClass = this;
@@ -59263,6 +59372,25 @@ class Events {
59263
59372
  me.htmlCls.clickMenuCls.setLogCmd("realign on structure align", true);
59264
59373
  }
59265
59374
  });
59375
+
59376
+ me.myEventCls.onIds("#" + me.pre + "applyRealignByStruct_tmalign", "click", function(e) { let ic = me.icn3d;
59377
+ e.preventDefault();
59378
+ if(!me.cfg.notebook) dialog.dialog( "close" );
59379
+ let nameArray = $("#" + me.pre + "atomsCustomRealignByStruct").val();
59380
+ if(nameArray.length > 0) {
59381
+ ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
59382
+ }
59383
+
59384
+ me.cfg.aligntool = 'tmalign';
59385
+
59386
+ ic.realignParserCls.realignOnStructAlign();
59387
+ if(nameArray.length > 0) {
59388
+ me.htmlCls.clickMenuCls.setLogCmd("realign on tmalign | " + nameArray, true);
59389
+ }
59390
+ else {
59391
+ me.htmlCls.clickMenuCls.setLogCmd("realign on tmalign", true);
59392
+ }
59393
+ });
59266
59394
  // },
59267
59395
 
59268
59396
  me.myEventCls.onIds("#" + me.pre + "applyColorSpectrumBySets", "click", function(e) { let ic = me.icn3d;
@@ -59486,62 +59614,53 @@ class Events {
59486
59614
  window.open(hostUrl + '?align=' + alignment + '&showalignseq=1&atype=0&bu=1', '_blank');
59487
59615
  });
59488
59616
 
59489
- me.myEventCls.onIds("#" + me.pre + "reload_alignaf", "click", function(e) { me.icn3d;
59617
+ me.myEventCls.onIds("#" + me.pre + "reload_alignaf", "click", function(e) { me.icn3d;
59490
59618
  e.preventDefault();
59491
59619
  if(!me.cfg.notebook) dialog.dialog( "close" );
59492
59620
  let alignment = $("#" + me.pre + "alignafid1").val() + "_A," + $("#" + me.pre + "alignafid2").val() + "_A";
59493
59621
  me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment + " | residues | resdef ", false);
59494
59622
  window.open(hostUrl + '?chainalign=' + alignment + '&resnum=&resdef=&showalignseq=1', '_blank');
59495
59623
  });
59624
+
59625
+ me.myEventCls.onIds("#" + me.pre + "reload_alignaf_tmalign", "click", function(e) { me.icn3d;
59626
+ e.preventDefault();
59627
+ if(!me.cfg.notebook) dialog.dialog( "close" );
59628
+ let alignment = $("#" + me.pre + "alignafid1").val() + "_A," + $("#" + me.pre + "alignafid2").val() + "_A";
59629
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment + " | residues | resdef | align tmalign", false);
59630
+ window.open(hostUrl + '?chainalign=' + alignment + '&aligntool=tmalign&resnum=&resdef=&showalignseq=1', '_blank');
59631
+ });
59496
59632
  // },
59497
59633
  // clickReload_chainalign: function() {
59498
59634
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { me.icn3d;
59499
59635
  e.preventDefault();
59500
59636
  if(!me.cfg.notebook) dialog.dialog( "close" );
59501
- // let alignment = $("#" + me.pre + "chainalignid1").val() + "," + $("#" + me.pre + "chainalignid2").val();
59502
- let alignment = $("#" + me.pre + "chainalignids").val();
59503
- let idArray = alignment.split(',');
59504
- let alignment_final = '';
59505
- for(let i = 0, il = idArray.length; i < il; ++i) {
59506
- alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59507
- if(i < il - 1) alignment_final += ',';
59508
- }
59509
- let resalign = $("#" + me.pre + "resalignids").val();
59510
- let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
59511
59637
 
59512
- if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
59513
- var aaa = 1; //alert("Please make sure the number of chains and the lines of predefined residues are the same...");
59514
- return;
59515
- }
59638
+ let result = thisClass.getAlignParas();
59516
59639
 
59517
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " | residues " + resalign + " | resdef " + predefinedres, false);
59518
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?chainalign=' + alignment + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1', '_blank');
59519
- window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1', '_blank');
59640
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " | residues " + result.resalign + " | resdef " + result.predefinedres, false);
59641
+ window.open(hostUrl + '?chainalign=' + result.alignment + '&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1', '_blank');
59520
59642
  });
59521
59643
 
59522
59644
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym", "click", function(e) { me.icn3d;
59523
59645
  e.preventDefault();
59524
59646
  if(!me.cfg.notebook) dialog.dialog( "close" );
59525
- // let alignment = $("#" + me.pre + "chainalignid1").val() + "," + $("#" + me.pre + "chainalignid2").val();
59526
- let alignment = $("#" + me.pre + "chainalignids").val();
59527
- let idArray = alignment.split(',');
59528
- let alignment_final = '';
59529
- for(let i = 0, il = idArray.length; i < il; ++i) {
59530
- alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59531
- if(i < il - 1) alignment_final += ',';
59532
- }
59533
- let resalign = $("#" + me.pre + "resalignids").val();
59534
- let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
59535
- if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
59536
- var aaa = 1; //alert("Please make sure the number of chains and the lines of predefined residues are the same...");
59537
- return;
59538
- }
59539
59647
 
59540
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues " + resalign + " | resdef " + predefinedres, false);
59541
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?chainalign=' + alignment + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1&bu=0', '_blank');
59542
- window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1&bu=0', '_blank');
59648
+ let result = thisClass.getAlignParas();
59649
+
59650
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " on asymmetric unit | residues " + result.resalign + " | resdef " + result.predefinedres, false);
59651
+ window.open(hostUrl + '?chainalign=' + result.alignment + '&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1&bu=0', '_blank');
59543
59652
  });
59544
59653
 
59654
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_tmalign", "click", function(e) { me.icn3d;
59655
+ e.preventDefault();
59656
+ if(!me.cfg.notebook) dialog.dialog( "close" );
59657
+
59658
+ let result = thisClass.getAlignParas();
59659
+
59660
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " on asymmetric unit | residues " + result.resalign + " | resdef " + result.predefinedres + " | align tmalign", false);
59661
+ window.open(hostUrl + '?chainalign=' + result.alignment + '&aligntool=tmalign&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1&bu=0', '_blank');
59662
+ });
59663
+
59545
59664
  me.myEventCls.onIds("#" + me.pre + "reload_mutation_3d", "click", function(e) { me.icn3d;
59546
59665
  e.preventDefault();
59547
59666
  if(!me.cfg.notebook) dialog.dialog( "close" );
@@ -65848,7 +65967,7 @@ class iCn3DUI {
65848
65967
  //even when multiple iCn3D viewers are shown together.
65849
65968
  this.pre = this.cfg.divid + "_";
65850
65969
 
65851
- this.REVISION = '3.12.8';
65970
+ this.REVISION = '3.13.0';
65852
65971
 
65853
65972
  // In nodejs, iCn3D defines "window = {navigator: {}}"
65854
65973
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -66258,7 +66377,7 @@ iCn3DUI.prototype.show3DStructure = function(pdbStr) { let me = this;
66258
66377
 
66259
66378
  ic.bChainAlign = true;
66260
66379
  ic.inputid = me.cfg.chainalign;
66261
- ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + me.cfg.resdef + ' | parameters ' + me.cfg.inpara;
66380
+ ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + me.cfg.resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara;
66262
66381
  me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
66263
66382
  ic.chainalignParserCls.downloadChainalignment(me.cfg.chainalign, me.cfg.resnum, me.cfg.resdef);
66264
66383
  }