icn3d 3.13.0 → 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.js CHANGED
@@ -4227,7 +4227,11 @@ class UtilsCls {
4227
4227
  let dz = atom0.coord.z - atom1.coord.z;
4228
4228
  let distSq = dx*dx + dy*dy + dz*dz;
4229
4229
 
4230
- return distSq < 1.3 * r * r;
4230
+ // r(N) = 0.71, r(H) = 0.31, N-H in residues are about 1.5
4231
+ // factor = (1.5 / 1.02) * (1.5 / 1.02) = 2.16
4232
+ let factor = ((atom0.elem == 'N' && atom1.elem.substr(0,1) == 'H') || (atom1.elem == 'N' && atom0.elem.substr(0,1) == 'H')) ? 2.2 : 1.3;
4233
+
4234
+ return distSq < factor * r * r;
4231
4235
  }
4232
4236
 
4233
4237
  //Convert a three-letter residue name to a one-letter residue abbreviation, e.g., 'LYS' to 'K', or ' A' to 'A' for nucleotides.
@@ -17450,7 +17454,7 @@ class ShowInter {
17450
17454
  for(let j = 0, jl = ic.atoms[atom.serial].bonds.length; j < jl; ++j) {
17451
17455
  let serial = ic.atoms[atom.serial].bonds[j];
17452
17456
  //if(ic.atoms[serial].name === 'H') {
17453
- if(atom.elem.substr(0, 1) === 'H') {
17457
+ if(ic.atoms[serial].elem.substr(0, 1) === 'H') {
17454
17458
  ic.dAtoms[serial] = 1;
17455
17459
  ic.hAtoms[serial] = 1;
17456
17460
  }
@@ -17459,11 +17463,29 @@ class ShowInter {
17459
17463
  }
17460
17464
  }
17461
17465
  else {
17466
+ // for(let serial in ic.atoms) {
17467
+ // ic.dAtoms[serial] = 1;
17468
+ // ic.hAtoms[serial] = 1;
17469
+ // }
17470
+
17471
+ // add bonds in heavy atoms
17472
+ //for(let serial in ic.hAtoms) {
17462
17473
  for(let serial in ic.atoms) {
17463
- ic.dAtoms[serial] = 1;
17464
- ic.hAtoms[serial] = 1;
17465
- }
17474
+ let atom = ic.atoms[serial];
17475
+ //if(atom.name === 'H') {
17476
+ if(atom.elem.substr(0, 1) === 'H') {
17477
+ if(ic.atoms[serial].bonds.length > 0) {
17478
+ let otherSerial = ic.atoms[serial].bonds[0];
17479
+ ic.atoms[otherSerial].bonds.push(atom.serial);
17480
+ if(ic.atoms[otherSerial].bondOrder) ic.atoms[otherSerial].bondOrder.push(1);
17481
+ }
17482
+
17483
+ ic.dAtoms[serial] = 1;
17484
+ }
17485
+ }
17466
17486
  }
17487
+
17488
+ ic.bShowHighlight = false;
17467
17489
  }
17468
17490
 
17469
17491
  hideHydrogens() { let ic = this.icn3d; ic.icn3dui;
@@ -18944,7 +18966,7 @@ class Delphi {
18944
18966
 
18945
18967
  ic.loadPhiFrom = 'delphi';
18946
18968
 
18947
- let url = "https://www.ncbi.nlm.nih.gov/Structure/delphi/delphi.cgi";
18969
+ let url = me.htmlCls.baseUrl + "delphi/delphi.cgi";
18948
18970
  let pdbid =(me.cfg.cid) ? me.cfg.cid : Object.keys(ic.structures).toString();
18949
18971
  let dataObj = {};
18950
18972
 
@@ -19756,7 +19778,7 @@ class Symd {
19756
19778
  let thisClass = this;
19757
19779
 
19758
19780
  //var url = "https://data.rcsb.org/rest/v1/core/assembly/" + pdbid + "/1";
19759
- let url = "https://www.ncbi.nlm.nih.gov/Structure/symd/symd.cgi";
19781
+ let url = me.htmlCls.baseUrl + "symd/symd.cgi";
19760
19782
 
19761
19783
  let atomHash = me.hashUtilsCls.intHash(ic.dAtoms, ic.hAtoms);
19762
19784
 
@@ -20903,7 +20925,7 @@ class LoadPDB {
20903
20925
  }
20904
20926
 
20905
20927
  if(!(curChain === atom.chain && curResi === atom.resi)) {
20906
- // a new residue, add the residue-residue bond beides the regular bonds
20928
+ // a new residue, add the residue-residue bond besides the regular bonds
20907
20929
  this.refreshBonds(curResAtoms, prevCarbonArray[0]);
20908
20930
 
20909
20931
  prevCarbonArray.splice(0, 1); // remove the first carbon
@@ -23918,13 +23940,13 @@ class OpmParser {
23918
23940
  });
23919
23941
  }
23920
23942
 
23921
- loadOpmData(data, pdbid, bFull, type, pdbid2) { let ic = this.icn3d; ic.icn3dui;
23943
+ loadOpmData(data, pdbid, bFull, type, pdbid2) { let ic = this.icn3d, me = ic.icn3dui;
23922
23944
  let thisClass = this;
23923
23945
  let url, dataType;
23924
23946
 
23925
23947
  if(!pdbid) pdbid = 'stru';
23926
23948
 
23927
- url = "https://www.ncbi.nlm.nih.gov/Structure/mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
23949
+ url = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
23928
23950
  dataType = "jsonp";
23929
23951
 
23930
23952
  $.ajax({
@@ -25201,6 +25223,7 @@ class ChainalignParser {
25201
25223
  let ajaxArray = [], indexArray = [], struArray = [];
25202
25224
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
25203
25225
  let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
25226
+ //let urltmalign = "https://test.ncbi.nlm.nih.gov/Structure/tmalign/tmalign.cgi";
25204
25227
 
25205
25228
  for(let index in ic.afChainIndexHash) {
25206
25229
  let idArray = ic.afChainIndexHash[index].split('_');
@@ -28740,7 +28763,7 @@ class ResizeCanvas {
28740
28763
  //let itemArray = ['dl_selectannotations', 'dl_alignment', 'dl_2ddgm', 'dl_definedsets', 'dl_graph',
28741
28764
  // 'dl_linegraph', 'dl_scatterplot', 'dl_contactmap', 'dl_allinteraction', 'dl_copyurl',
28742
28765
  // 'dl_symmetry', 'dl_symd', 'dl_rmsd', 'dl_legend', 'dl_disttable'];
28743
- 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'];
28766
+ 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'];
28744
28767
 
28745
28768
  for(let i in itemArray) {
28746
28769
  let item = itemArray[i];
@@ -31777,7 +31800,7 @@ class AnnoCddSite {
31777
31800
  let chnidArray = Object.keys(ic.protein_chainid);
31778
31801
  // show conserved domains and binding sites
31779
31802
  // live search
31780
- let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + chnidBaseArray;
31803
+ let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + chnidBaseArray;
31781
31804
  // precalculated
31782
31805
  //let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + chnidBaseArray;
31783
31806
  // live search for AlphaFold structures
@@ -31823,7 +31846,7 @@ class AnnoCddSite {
31823
31846
 
31824
31847
  //url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + ic.giSeq[chnidArray[0]].join('');
31825
31848
  // live searchE
31826
- url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + seq;
31849
+ url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + seq;
31827
31850
  // precalculated
31828
31851
  //url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + seq;
31829
31852
 
@@ -35605,11 +35628,15 @@ class SetSeqAlign {
35605
35628
  // start and end of MSA
35606
35629
  let start_t = 9999, end_t = -1;
35607
35630
 
35631
+ let baseResi = ic.chainsSeq[chainid1][0].resi - 1;
35632
+
35608
35633
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
35609
35634
  let chainIndex = index - 1;
35635
+ if(!ic.qt_start_end[chainIndex]) continue;
35636
+
35610
35637
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
35611
35638
  let start1, end1;
35612
- if(bRealign) { // realresidue numbers are stored
35639
+ if(bRealign) { // real residue numbers are stored
35613
35640
  start1 = ic.qt_start_end[chainIndex][i].t_start;
35614
35641
  end1 = ic.qt_start_end[chainIndex][i].t_end;
35615
35642
  }
@@ -35617,9 +35644,9 @@ class SetSeqAlign {
35617
35644
  start1 = ic.qt_start_end[chainIndex][i].t_start - 1;
35618
35645
  end1 = ic.qt_start_end[chainIndex][i].t_end - 1;
35619
35646
  }
35620
-
35621
35647
  for(let j = start1; j <= end1; ++j) {
35622
- let resi = this.getResi(chainidArray[0], j, bRealign);
35648
+ let resiPos = j - baseResi;
35649
+ let resi = this.getResi(chainidArray[0], resiPos, bRealign);
35623
35650
  resi2range_t[resi] = 1;
35624
35651
  if(j < start_t) start_t = j;
35625
35652
  if(j > end_t) end_t = j;
@@ -35627,6 +35654,9 @@ class SetSeqAlign {
35627
35654
  }
35628
35655
  }
35629
35656
 
35657
+ // TM-align should use "start1 = ic.qt_start_end[chainIndex][i].t_start - 1", but the rest are the same as ""bRealign"
35658
+ if(me.cfg.aligntool == 'tmalign') bRealign = true; // real residue numbers are stored
35659
+
35630
35660
  let resi2rangeArray = Object.keys(resi2range_t);
35631
35661
  resi2rangeArray.sort(function(a, b) {
35632
35662
  return parseInt(a) - parseInt(b);
@@ -35673,7 +35703,7 @@ class SetSeqAlign {
35673
35703
  for(let j = 0, jl = ic.chainsSeq[chainid1].length; j < jl; ++j) {
35674
35704
  let resi = ic.chainsSeq[chainid1][j].resi;
35675
35705
 
35676
- if((j < start_t || j > end_t) ) {
35706
+ if((j + baseResi < start_t || j + baseResi > end_t) ) {
35677
35707
  continue;
35678
35708
  }
35679
35709
 
@@ -36911,7 +36941,7 @@ class ParserUtils {
36911
36941
  if(me.cfg.showanno) {
36912
36942
  let cmd = "view annotations";
36913
36943
  me.htmlCls.clickMenuCls.setLogCmd(cmd, true);
36914
- ic.showAnnoCls.showAnnotations();
36944
+ ic.showAnnoCls.showAnnotations();
36915
36945
  }
36916
36946
  if(me.cfg.closepopup) {
36917
36947
  ic.resizeCanvasCls.closeDialogs();
@@ -37917,9 +37947,11 @@ class ShowAnno {
37917
37947
  }
37918
37948
 
37919
37949
  let nucleotide_chainid = {}, chemical_chainid = {}, chemical_set = {};
37920
- ic.protein_chainid = {};
37950
+ //ic.protein_chainid = {};
37921
37951
 
37922
37952
  if(ic.bAnnoShown === undefined || !ic.bAnnoShown || ic.bResetAnno) { // ic.bResetAnno when loading another structure
37953
+ ic.protein_chainid = {};
37954
+
37923
37955
  let chainArray = Object.keys(ic.chains);
37924
37956
 
37925
37957
  if(ic.giSeq === undefined) ic.giSeq = {};
@@ -37960,6 +37992,7 @@ class ShowAnno {
37960
37992
  chainidBase = chainArray[i];
37961
37993
  }
37962
37994
  //if(me.cfg.mmdbid !== undefined) { // protein and chemicals/ions are in different chains
37995
+
37963
37996
  if(ic.proteins.hasOwnProperty(atom.serial) && ic.chainsSeq[chainArray[i]].length > 1) {
37964
37997
  ic.protein_chainid[chainArray[i]] = chainidBase;
37965
37998
  }
@@ -39748,11 +39781,11 @@ class AnnoSnpClinVar {
39748
39781
  if(ic.deferredClinvar !== undefined) ic.deferredClinvar.resolve();
39749
39782
  }
39750
39783
  }
39751
- showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
39784
+ showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
39752
39785
  let thisClass = this;
39753
39786
  //var url = "https://www.ncbi.nlm.nih.gov/projects/SNP/beVarSearch_mt.cgi?appname=iCn3D&format=bed&report=pdb2bed&acc=" + chnidBase;
39754
39787
  //var url = "https://www.ncbi.nlm.nih.gov/Structure/icn3d/clinvar.txt";
39755
- let url = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
39788
+ let url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
39756
39789
  if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
39757
39790
  url += "&gene=" + ic.chainsGene[chnid].geneSymbol;
39758
39791
  }
@@ -39787,7 +39820,7 @@ class AnnoSnpClinVar {
39787
39820
  });
39788
39821
  }
39789
39822
 
39790
- showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
39823
+ showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
39791
39824
  let thisClass = this;
39792
39825
  if(gi !== undefined) {
39793
39826
  /*
@@ -39806,7 +39839,7 @@ class AnnoSnpClinVar {
39806
39839
  } //if(data3 != "") {
39807
39840
  else {
39808
39841
  */
39809
- let url4 = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
39842
+ let url4 = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
39810
39843
  if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
39811
39844
  url4 += "&gene=" + ic.chainsGene[chnid].geneSymbol;
39812
39845
  }
@@ -44612,7 +44645,8 @@ class VRButton {
44612
44645
  button.style.display = '';
44613
44646
 
44614
44647
  button.style.cursor = 'pointer';
44615
- button.style.left = 'calc(50% - 50px)';
44648
+ //button.style.left = 'calc(50% - 50px)';
44649
+ button.style.left = 'calc(33% - 50px)';
44616
44650
  button.style.width = '100px';
44617
44651
 
44618
44652
  button.textContent = 'ENTER VR';
@@ -44666,7 +44700,7 @@ class VRButton {
44666
44700
  button.style.display = '';
44667
44701
 
44668
44702
  button.style.cursor = 'auto';
44669
- button.style.left = 'calc(50% - 75px)';
44703
+ button.style.left = 'calc(33% - 75px)'; //'calc(50% - 75px)';
44670
44704
  button.style.width = '150px';
44671
44705
 
44672
44706
  button.onmouseenter = null;
@@ -44859,7 +44893,8 @@ class ARButton {
44859
44893
  button.style.display = '';
44860
44894
 
44861
44895
  button.style.cursor = 'pointer';
44862
- button.style.left = 'calc(50% - 50px)';
44896
+ //button.style.left = 'calc(50% - 50px)';
44897
+ button.style.left = 'calc(66% - 50px)';
44863
44898
  button.style.width = '100px';
44864
44899
 
44865
44900
  button.textContent = 'START AR';
@@ -44907,7 +44942,7 @@ class ARButton {
44907
44942
  button.style.display = '';
44908
44943
 
44909
44944
  button.style.cursor = 'auto';
44910
- button.style.left = 'calc(50% - 75px)';
44945
+ button.style.left = 'calc(66% - 50px)'; //'calc(50% - 75px)';
44911
44946
  button.style.width = '150px';
44912
44947
 
44913
44948
  button.onmouseenter = null;
@@ -45004,7 +45039,7 @@ class ARButton {
45004
45039
 
45005
45040
  }
45006
45041
 
45007
- message.style.left = 'calc(50% - 90px)';
45042
+ message.style.left = 'calc(66% - 90px)'; //'calc(50% - 90px)';
45008
45043
  message.style.width = '180px';
45009
45044
  message.style.textDecoration = 'none';
45010
45045
 
@@ -53386,9 +53421,17 @@ class ClickMenu {
53386
53421
  // },
53387
53422
  // clkMn1_chainalign: function() {
53388
53423
  me.myEventCls.onIds("#" + me.pre + "mn1_chainalign", "click", function(e) { me.icn3d;
53389
- me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains of 3D structures');
53424
+ me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains by structure alignment');
53390
53425
  });
53391
53426
 
53427
+ me.myEventCls.onIds("#" + me.pre + "mn1_chainalign2", "click", function(e) { me.icn3d;
53428
+ me.htmlCls.dialogCls.openDlg('dl_chainalign2', 'Align multiple chains by sequence alignment');
53429
+ });
53430
+
53431
+ me.myEventCls.onIds("#" + me.pre + "mn1_chainalign3", "click", function(e) { me.icn3d;
53432
+ me.htmlCls.dialogCls.openDlg('dl_chainalign3', 'Align multiple chains residue by residue');
53433
+ });
53434
+
53392
53435
  me.myEventCls.onIds("#" + me.pre + "mn1_mutation", "click", function(e) { me.icn3d;
53393
53436
  me.htmlCls.dialogCls.openDlg('dl_mutation', 'Show the mutations in 3D');
53394
53437
  });
@@ -53567,6 +53610,12 @@ class ClickMenu {
53567
53610
  thisClass.setLogCmd("export pqr", true);
53568
53611
  });
53569
53612
 
53613
+ me.myEventCls.onIds(["#" + me.pre + "delphipdbh", "#" + me.pre + "phipqr", "#" + me.pre + "phiurlpqr"], "click", function(e) { me.icn3d;
53614
+ let bPdb = true;
53615
+ me.htmlCls.setHtmlCls.exportPqr(bPdb);
53616
+ thisClass.setLogCmd("export pdbh", false);
53617
+ });
53618
+
53570
53619
  // clkMn1_exportStl: function() {
53571
53620
  me.myEventCls.onIds("#" + me.pre + "mn1_exportStl", "click", function(e) { let ic = me.icn3d;
53572
53621
  thisClass.setLogCmd("export stl file", false);
@@ -55981,15 +56030,22 @@ class SetMenu {
55981
56030
  html += "</li>";
55982
56031
  html += "<li><span>Align</span>";
55983
56032
  html += "<ul>";
55984
- html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
55985
- //html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Structure to Structure ' + me.htmlCls.wifiStr);
56033
+
56034
+ html += "<li><span>Multiple Chains</span>";
56035
+ html += "<ul>";
56036
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign', 'by Structure Alignment ' + me.htmlCls.wifiStr);
56037
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign2', 'by Sequence Alignment ' + me.htmlCls.wifiStr);
56038
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign3', 'Residue by Residue');
56039
+ html += "</ul>";
56040
+ html += "</li>";
56041
+
55986
56042
  html += "<li><span>Structure to Structure</span>";
55987
56043
  html += "<ul>";
55988
56044
  html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Two PDB Structures ' + me.htmlCls.wifiStr);
55989
56045
  html += me.htmlCls.setHtmlCls.getLink('mn1_alignaf', 'Two AlphaFold Structures ' + me.htmlCls.wifiStr);
55990
56046
  html += "</ul>";
55991
56047
 
55992
- html += me.htmlCls.setHtmlCls.getLink('mn1_chainalign', 'Multiple Chains ' + me.htmlCls.wifiStr);
56048
+ html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
55993
56049
 
55994
56050
  html += "</ul>";
55995
56051
  html += "</li>";
@@ -56065,6 +56121,7 @@ class SetMenu {
56065
56121
  */
56066
56122
 
56067
56123
  html += me.htmlCls.setHtmlCls.getLink('mn1_exportPdbRes', 'PDB');
56124
+ html += me.htmlCls.setHtmlCls.getLink('delphipdbh', 'PDB with Hydrogens');
56068
56125
 
56069
56126
  if(me.cfg.cid === undefined) {
56070
56127
  html += me.htmlCls.setHtmlCls.getLink('mn1_exportSecondary', 'Secondary Structure');
@@ -58102,18 +58159,36 @@ class SetDialog {
58102
58159
  html += "<div style='width:550px'>";
58103
58160
  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/>";
58104
58161
  html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
58105
- html += "<b>Optional 1</b>, full chains are used for structure alignment<br/><br/>";
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/>";
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/>";
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/>";
58162
+ 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/>";
58163
+
58164
+ 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>";
58165
+ html += "</div></div>";
58166
+
58167
+ html += me.htmlCls.divStr + "dl_chainalign2' class='" + dialogClass + "'>";
58168
+ html += "<div style='width:550px'>";
58169
+ 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/>";
58170
+ html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids2' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
58171
+
58172
+ 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/>";
58173
+ html += me.htmlCls.buttonStr + "reload_chainalign_asym2' style='margin-top:3px;'><b>Align by Sequence Alignment</b></button><br/><br/>";
58174
+
58175
+ 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>";
58176
+ html += "</div></div>";
58177
+
58178
+ html += me.htmlCls.divStr + "dl_chainalign3' class='" + dialogClass + "'>";
58179
+ html += "<div style='width:550px'>";
58180
+ 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/>";
58181
+ html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids3' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
58182
+
58183
+ 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/>";
58184
+ html += me.htmlCls.buttonStr + "reload_chainalign_asym3'><b>Align Residue by Residue</b></button><br/><br/>";
58110
58185
 
58111
58186
  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>";
58112
58187
  html += "</div></div>";
58113
58188
 
58114
58189
  html += me.htmlCls.divStr + "dl_mutation' class='" + dialogClass + "'>";
58115
58190
  html += "<div style='width:500px'>";
58116
- 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/>';
58191
+ 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/>';
58117
58192
  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/>";
58118
58193
 
58119
58194
  html += "<b>Data Source</b>: <select id='" + me.pre + "idsource'>";
@@ -59097,7 +59172,7 @@ class Events {
59097
59172
 
59098
59173
  saveHtml(id) { let me = this.icn3dui, ic = me.icn3d;
59099
59174
  let html = '';
59100
- html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/lib/jquery-ui-1.12.1.min.css">\n';
59175
+ html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/lib/jquery-ui-1.13.2.min.css">\n';
59101
59176
  html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/icn3d_full_ui.css">\n';
59102
59177
  html += $("#" + id).html();
59103
59178
  let idArray = id.split('_');
@@ -59107,24 +59182,6 @@ class Events {
59107
59182
  ic.saveFileCls.saveFile(structureStr + '-' + idStr + '.html', 'html', encodeURIComponent(html));
59108
59183
  }
59109
59184
 
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
-
59128
59185
  //Hold all functions related to click events.
59129
59186
  allEventFunctions() { let me = this.icn3dui, ic = me.icn3d;
59130
59187
  let thisClass = this;
@@ -59281,6 +59338,8 @@ class Events {
59281
59338
  // },
59282
59339
  // clickRealignonseqalign: function() {
59283
59340
  me.myEventCls.onIds("#" + me.pre + "mn2_realignonseqalign", "click", function(e) { let ic = me.icn3d;
59341
+ if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
59342
+
59284
59343
  if(Object.keys(ic.structures).length < 2) {
59285
59344
  var aaa = 1; //alert("At least two structuresare required for alignment...");
59286
59345
  return;
@@ -59296,15 +59355,14 @@ class Events {
59296
59355
  if($("#" + me.pre + "atomsCustomRealign").length) {
59297
59356
  $("#" + me.pre + "atomsCustomRealign").html(definedAtomsHtml);
59298
59357
  }
59299
- //if($("#" + me.pre + "atomsCustomRealign2").length) {
59300
- // $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
59301
- //}
59302
- if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
59358
+
59303
59359
  $("#" + me.pre + "atomsCustomRealign").resizable();
59304
59360
  //$("#" + me.pre + "atomsCustomRealign2").resizable();
59305
59361
  });
59306
59362
 
59307
59363
  me.myEventCls.onIds("#" + me.pre + "mn2_realignonstruct", "click", function(e) { let ic = me.icn3d;
59364
+ if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
59365
+
59308
59366
  if(Object.keys(ic.structures).length < 2) {
59309
59367
  var aaa = 1; //alert("At least two structuresare required for alignment...");
59310
59368
  return;
@@ -59319,10 +59377,7 @@ class Events {
59319
59377
  if($("#" + me.pre + "atomsCustomRealignByStruct").length) {
59320
59378
  $("#" + me.pre + "atomsCustomRealignByStruct").html(definedAtomsHtml);
59321
59379
  }
59322
- //if($("#" + me.pre + "atomsCustomRealign2").length) {
59323
- // $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
59324
- //}
59325
- if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
59380
+
59326
59381
  $("#" + me.pre + "atomsCustomRealignByStruct").resizable();
59327
59382
  //$("#" + me.pre + "atomsCustomRealign2").resizable();
59328
59383
  });
@@ -59631,34 +59686,99 @@ class Events {
59631
59686
  });
59632
59687
  // },
59633
59688
  // clickReload_chainalign: function() {
59634
- me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { me.icn3d;
59689
+ /*
59690
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { let ic = me.icn3d;
59635
59691
  e.preventDefault();
59636
59692
  if(!me.cfg.notebook) dialog.dialog( "close" );
59637
59693
 
59638
- let result = thisClass.getAlignParas();
59694
+ let alignment = $("#" + me.pre + "chainalignids").val();
59695
+ let idArray = alignment.split(',');
59696
+ let alignment_final = '';
59697
+ for(let i = 0, il = idArray.length; i < il; ++i) {
59698
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59699
+ if(i < il - 1) alignment_final += ',';
59700
+ }
59701
+ let resalign = $("#" + me.pre + "resalignids").val();
59702
+ let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
59703
+ if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
59704
+ var aaa = 1; //alert("Please make sure the number of chains and the lines of predefined residues are the same...");
59705
+ return;
59706
+ }
59639
59707
 
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');
59708
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " | residues " + resalign + " | resdef " + predefinedres, false);
59709
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1', '_blank');
59642
59710
  });
59711
+ */
59643
59712
 
59644
59713
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym", "click", function(e) { me.icn3d;
59645
59714
  e.preventDefault();
59646
59715
  if(!me.cfg.notebook) dialog.dialog( "close" );
59647
59716
 
59648
- let result = thisClass.getAlignParas();
59717
+ let alignment = $("#" + me.pre + "chainalignids").val();
59718
+ let idArray = alignment.split(',');
59719
+ let alignment_final = '';
59720
+ for(let i = 0, il = idArray.length; i < il; ++i) {
59721
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59722
+ if(i < il - 1) alignment_final += ',';
59723
+ }
59649
59724
 
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');
59725
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef ", false);
59726
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=&resdef=&showalignseq=1&bu=0', '_blank');
59652
59727
  });
59653
59728
 
59729
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym2", "click", function(e) { me.icn3d;
59730
+ e.preventDefault();
59731
+ if(!me.cfg.notebook) dialog.dialog( "close" );
59732
+
59733
+ let alignment = $("#" + me.pre + "chainalignids2").val();
59734
+ let idArray = alignment.split(',');
59735
+ let alignment_final = '';
59736
+ for(let i = 0, il = idArray.length; i < il; ++i) {
59737
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59738
+ if(i < il - 1) alignment_final += ',';
59739
+ }
59740
+ let resalign = $("#" + me.pre + "resalignids").val();
59741
+
59742
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues " + resalign + " | resdef ", false);
59743
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=&showalignseq=1&bu=0', '_blank');
59744
+ });
59745
+
59746
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym3", "click", function(e) { me.icn3d;
59747
+ e.preventDefault();
59748
+ if(!me.cfg.notebook) dialog.dialog( "close" );
59749
+
59750
+ let alignment = $("#" + me.pre + "chainalignids3").val();
59751
+ let idArray = alignment.split(',');
59752
+ let alignment_final = '';
59753
+ for(let i = 0, il = idArray.length; i < il; ++i) {
59754
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59755
+ if(i < il - 1) alignment_final += ',';
59756
+ }
59757
+
59758
+ let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
59759
+ if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
59760
+ var aaa = 1; //alert("Please make sure the number of chains and the lines of predefined residues are the same...");
59761
+ return;
59762
+ }
59763
+
59764
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef " + predefinedres, false);
59765
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=&resdef=' + predefinedres + '&showalignseq=1&bu=0', '_blank');
59766
+ });
59767
+
59654
59768
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign_tmalign", "click", function(e) { me.icn3d;
59655
59769
  e.preventDefault();
59656
59770
  if(!me.cfg.notebook) dialog.dialog( "close" );
59657
59771
 
59658
- let result = thisClass.getAlignParas();
59772
+ let alignment = $("#" + me.pre + "chainalignids").val();
59773
+ let idArray = alignment.split(',');
59774
+ let alignment_final = '';
59775
+ for(let i = 0, il = idArray.length; i < il; ++i) {
59776
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59777
+ if(i < il - 1) alignment_final += ',';
59778
+ }
59659
59779
 
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');
59780
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef | align tmalign", false);
59781
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&aligntool=tmalign&resnum=&resdef=&showalignseq=1&bu=0', '_blank');
59662
59782
  });
59663
59783
 
59664
59784
  me.myEventCls.onIds("#" + me.pre + "reload_mutation_3d", "click", function(e) { me.icn3d;
@@ -60765,6 +60885,27 @@ class Events {
60765
60885
  let color = $("#" + me.pre + "colorcustom").val();
60766
60886
  picker.set('#' + color).enter();
60767
60887
  });
60888
+
60889
+ let picker2 = new CP(document.querySelector("#" + me.pre + "labelcolorall"));
60890
+ picker2.on("change", function(color) {
60891
+ this.target.value = color;
60892
+ });
60893
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "input", function() {
60894
+ let color = $("#" + me.pre + "labelcolorall").val();
60895
+ picker2.set('#' + color).enter();
60896
+ });
60897
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "keyup", function() {
60898
+ let color = $("#" + me.pre + "labelcolorall").val();
60899
+ picker2.set('#' + color).enter();
60900
+ });
60901
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "paste", function() {
60902
+ let color = $("#" + me.pre + "labelcolorall").val();
60903
+ picker2.set('#' + color).enter();
60904
+ });
60905
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "cut", function() {
60906
+ let color = $("#" + me.pre + "labelcolorall").val();
60907
+ picker2.set('#' + color).enter();
60908
+ });
60768
60909
  // },
60769
60910
  // clickApplypick_stabilizer_rm: function() {
60770
60911
  me.myEventCls.onIds("#" + me.pre + "applypick_stabilizer_rm", "click", function(e) { let ic = me.icn3d;
@@ -62039,7 +62180,7 @@ class SetHtml {
62039
62180
  return html;
62040
62181
  }
62041
62182
 
62042
- exportPqr() { let me = this.icn3dui, ic = me.icn3d;
62183
+ exportPqr(bPdb) { let me = this.icn3dui, ic = me.icn3d;
62043
62184
  let ionHash = {};
62044
62185
  let atomHash = {};
62045
62186
  /*
@@ -62071,13 +62212,15 @@ class SetHtml {
62071
62212
  }
62072
62213
  }
62073
62214
 
62215
+ let fileExt = (bPdb) ? 'pdb' : 'pqr';
62074
62216
  if(me.cfg.cid) {
62075
62217
  let pqrStr = '';
62076
62218
  /// pqrStr += ic.saveFileCls.getPDBHeader();
62077
- pqrStr += ic.saveFileCls.getAtomPDB(atomHash, true) + ic.saveFileCls.getAtomPDB(ionHash, true);
62219
+ let bPqr = (bPdb) ? false : true;
62220
+ pqrStr += ic.saveFileCls.getAtomPDB(atomHash, bPqr) + ic.saveFileCls.getAtomPDB(ionHash, bPqr);
62078
62221
 
62079
62222
  let file_pref =(ic.inputid) ? ic.inputid : "custom";
62080
- ic.saveFileCls.saveFile(file_pref + '_icn3d.pqr', 'text', [pqrStr]);
62223
+ ic.saveFileCls.saveFile(file_pref + '_icn3d.' + fileExt, 'text', [pqrStr]);
62081
62224
  }
62082
62225
  else {
62083
62226
  let bCalphaOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms));
@@ -62113,8 +62256,40 @@ class SetHtml {
62113
62256
  success: function(data) {
62114
62257
  let pqrStr = data;
62115
62258
 
62259
+ if(bPdb) {
62260
+ let lineArray = pqrStr.split('\n');
62261
+
62262
+ let pdbStr = '';
62263
+ for(let i = 0, il = lineArray.length; i < il; ++i) {
62264
+ let line = lineArray[i];
62265
+ if(line.substr(0, 6) == 'ATOM ' || line.substr(0, 6) == 'HETATM') {
62266
+ let atomName = line.substr(12, 4).trim();
62267
+ let elem;
62268
+ if(line.substr(0, 6) == 'ATOM ') {
62269
+ elem = atomName.substr(0, 1);
62270
+ }
62271
+ else {
62272
+ let twochar = atomName.substr(0, 2);
62273
+ if(me.parasCls.vdwRadii.hasOwnProperty(twochar)) {
62274
+ elem = twochar;
62275
+ }
62276
+ else {
62277
+ elem = atomName.substr(0, 1);
62278
+ }
62279
+ }
62280
+
62281
+ pdbStr += line.substr(0, 54) + ' ' + elem.padStart(2, ' ') + '\n';
62282
+ }
62283
+ else {
62284
+ pdbStr += line + '\n';
62285
+ }
62286
+ }
62287
+
62288
+ pqrStr = pdbStr;
62289
+ }
62290
+
62116
62291
  let file_pref =(ic.inputid) ? ic.inputid : "custom";
62117
- ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.pqr', 'text', [pqrStr]);
62292
+ ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.' + fileExt, 'text', [pqrStr]);
62118
62293
  },
62119
62294
  error : function(xhr, textStatus, errorThrown ) {
62120
62295
  this.tryCount++;
@@ -62479,7 +62654,8 @@ class Html {
62479
62654
  this.simulation = undefined;
62480
62655
 
62481
62656
  //this.baseUrl = "https://structure.ncbi.nlm.nih.gov/";
62482
- this.baseUrl = "https://www.ncbi.nlm.nih.gov/Structure/";
62657
+ this.baseUrl = (window && window.location && window.location.hostname == 'structure.ncbi.nlm.nih.gov')
62658
+ ? "https://structure.ncbi.nlm.nih.gov/Structure/" : "https://www.ncbi.nlm.nih.gov/Structure/";
62483
62659
  this.divStr = "<div id='" + this.icn3dui.pre;
62484
62660
  this.divNowrapStr = "<div style='white-space:nowrap'>";
62485
62661
  this.spanNowrapStr = "<span style='white-space:nowrap'>";
@@ -65967,7 +66143,7 @@ class iCn3DUI {
65967
66143
  //even when multiple iCn3D viewers are shown together.
65968
66144
  this.pre = this.cfg.divid + "_";
65969
66145
 
65970
- this.REVISION = '3.13.0';
66146
+ this.REVISION = '3.13.2';
65971
66147
 
65972
66148
  // In nodejs, iCn3D defines "window = {navigator: {}}"
65973
66149
  this.bNode = (Object.keys(window).length < 2) ? true : false;