icn3d 3.13.0 → 3.14.3

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.
@@ -8383,15 +8387,16 @@ class Strand {
8383
8387
  }
8384
8388
 
8385
8389
  let maxDist = 6.0;
8386
- //let bBrokenSs = (prevCoorCA && Math.abs(currentCA.x - prevCoorCA.x) > maxDist) || (prevCoorCA && Math.abs(currentCA.y - prevCoorCA.y) > maxDist) || (prevCoorCA && Math.abs(currentCA.z - prevCoorCA.z) > maxDist);
8387
- let bBrokenSs = !atoms.hasOwnProperty(atom.serial) || (prevCoorCA && Math.abs(currentCA.x - prevCoorCA.x) > maxDist) || (prevCoorCA && Math.abs(currentCA.y - prevCoorCA.y) > maxDist) || (prevCoorCA && Math.abs(currentCA.z - prevCoorCA.z) > maxDist);
8390
+ let bBrokenSs = (prevCoorCA && Math.abs(currentCA.x - prevCoorCA.x) > maxDist) || (prevCoorCA && Math.abs(currentCA.y - prevCoorCA.y) > maxDist) || (prevCoorCA && Math.abs(currentCA.z - prevCoorCA.z) > maxDist);
8391
+ // The following code didn't work to select one residue
8392
+ // let bBrokenSs = !atoms.hasOwnProperty(atom.serial) || (prevCoorCA && Math.abs(currentCA.x - prevCoorCA.x) > maxDist) || (prevCoorCA && Math.abs(currentCA.y - prevCoorCA.y) > maxDist) || (prevCoorCA && Math.abs(currentCA.z - prevCoorCA.z) > maxDist);
8388
8393
 
8389
- if(bBrokenSs && atom.ss === 'sheet') {
8390
- bSheetSegment = true;
8391
- }
8392
- else if(bBrokenSs && atom.ss === 'helix') {
8393
- bHelixSegment = true;
8394
- }
8394
+ // if(bBrokenSs && atom.ss === 'sheet') {
8395
+ // bSheetSegment = true;
8396
+ // }
8397
+ // else if(bBrokenSs && atom.ss === 'helix') {
8398
+ // bHelixSegment = true;
8399
+ // }
8395
8400
 
8396
8401
  if ((atom.ssbegin || atom.ssend || (drawnResidueCount === totalResidueCount - 1) || bBrokenSs) && pnts[0].length > 0 && bSameChain) {
8397
8402
  let atomName = 'CA';
@@ -14678,7 +14683,10 @@ class DefinedSets {
14678
14683
  ic.hAtoms = {};
14679
14684
  this.setHAtomsFromSets(orArray, 'or');
14680
14685
 
14681
- if(Object.keys(ic.hAtoms).length == 0) ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
14686
+ if(Object.keys(ic.hAtoms).length == 0) {
14687
+ //ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
14688
+ ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
14689
+ }
14682
14690
  this.setHAtomsFromSets(andArray, 'and');
14683
14691
 
14684
14692
  this.setHAtomsFromSets(notArray, 'not');
@@ -18350,7 +18358,7 @@ class ShowInter {
18350
18358
  for(let j = 0, jl = ic.atoms[atom.serial].bonds.length; j < jl; ++j) {
18351
18359
  let serial = ic.atoms[atom.serial].bonds[j];
18352
18360
  //if(ic.atoms[serial].name === 'H') {
18353
- if(atom.elem.substr(0, 1) === 'H') {
18361
+ if(ic.atoms[serial].elem.substr(0, 1) === 'H') {
18354
18362
  ic.dAtoms[serial] = 1;
18355
18363
  ic.hAtoms[serial] = 1;
18356
18364
  }
@@ -18359,11 +18367,29 @@ class ShowInter {
18359
18367
  }
18360
18368
  }
18361
18369
  else {
18370
+ // for(let serial in ic.atoms) {
18371
+ // ic.dAtoms[serial] = 1;
18372
+ // ic.hAtoms[serial] = 1;
18373
+ // }
18374
+
18375
+ // add bonds in heavy atoms
18376
+ //for(let serial in ic.hAtoms) {
18362
18377
  for(let serial in ic.atoms) {
18363
- ic.dAtoms[serial] = 1;
18364
- ic.hAtoms[serial] = 1;
18365
- }
18378
+ let atom = ic.atoms[serial];
18379
+ //if(atom.name === 'H') {
18380
+ if(atom.elem.substr(0, 1) === 'H') {
18381
+ if(ic.atoms[serial].bonds.length > 0) {
18382
+ let otherSerial = ic.atoms[serial].bonds[0];
18383
+ ic.atoms[otherSerial].bonds.push(atom.serial);
18384
+ if(ic.atoms[otherSerial].bondOrder) ic.atoms[otherSerial].bondOrder.push(1);
18385
+ }
18386
+
18387
+ ic.dAtoms[serial] = 1;
18388
+ }
18389
+ }
18366
18390
  }
18391
+
18392
+ ic.bShowHighlight = false;
18367
18393
  }
18368
18394
 
18369
18395
  hideHydrogens() { let ic = this.icn3d; ic.icn3dui;
@@ -18740,7 +18766,7 @@ class SetColor {
18740
18766
  break;
18741
18767
 
18742
18768
  case 'chain':
18743
- if(ic.chainsColor !== undefined && Object.keys(ic.chainsColor).length > 0) { // mmdb input
18769
+ if(ic.chainsColor !== undefined && Object.keys(ic.chainsColor).length > 0) { // mmdb input
18744
18770
  this.setMmdbChainColor();
18745
18771
  }
18746
18772
  else {
@@ -19844,7 +19870,7 @@ class Delphi {
19844
19870
 
19845
19871
  ic.loadPhiFrom = 'delphi';
19846
19872
 
19847
- let url = "https://www.ncbi.nlm.nih.gov/Structure/delphi/delphi.cgi";
19873
+ let url = me.htmlCls.baseUrl + "delphi/delphi.cgi";
19848
19874
  let pdbid =(me.cfg.cid) ? me.cfg.cid : Object.keys(ic.structures).toString();
19849
19875
  let dataObj = {};
19850
19876
 
@@ -20656,7 +20682,7 @@ class Symd {
20656
20682
  let thisClass = this;
20657
20683
 
20658
20684
  //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";
20685
+ let url = me.htmlCls.baseUrl + "symd/symd.cgi";
20660
20686
 
20661
20687
  let atomHash = me.hashUtilsCls.intHash(ic.dAtoms, ic.hAtoms);
20662
20688
 
@@ -21803,7 +21829,7 @@ class LoadPDB {
21803
21829
  }
21804
21830
 
21805
21831
  if(!(curChain === atom.chain && curResi === atom.resi)) {
21806
- // a new residue, add the residue-residue bond beides the regular bonds
21832
+ // a new residue, add the residue-residue bond besides the regular bonds
21807
21833
  this.refreshBonds(curResAtoms, prevCarbonArray[0]);
21808
21834
 
21809
21835
  prevCarbonArray.splice(0, 1); // remove the first carbon
@@ -23534,7 +23560,7 @@ class Dssp {
23534
23560
 
23535
23561
  ic.pdbParserCls.loadPdbDataRender(bAppend);
23536
23562
 
23537
- if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
23563
+ //if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
23538
23564
  if(ic.deferredSecondary !== undefined) ic.deferredSecondary.resolve();
23539
23565
  });
23540
23566
  }
@@ -23653,7 +23679,7 @@ class Dssp {
23653
23679
 
23654
23680
  ic.pdbParserCls.loadPdbDataRender(bAppend);
23655
23681
 
23656
- if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
23682
+ //if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
23657
23683
  if(ic.deferredSecondary !== undefined) ic.deferredSecondary.resolve();
23658
23684
  }
23659
23685
  }
@@ -23674,7 +23700,7 @@ class PdbParser {
23674
23700
  let url, dataType;
23675
23701
 
23676
23702
  if(bAf) {
23677
- url = "https://alphafold.ebi.ac.uk/files/AF-" + pdbid + "-F1-model_v2.pdb";
23703
+ url = "https://alphafold.ebi.ac.uk/files/AF-" + pdbid + "-F1-model_v3.pdb";
23678
23704
  ic.ParserUtilsCls.setYourNote(pdbid.toUpperCase() + '(AlphaFold) in iCn3D');
23679
23705
  }
23680
23706
  else {
@@ -24818,13 +24844,13 @@ class OpmParser {
24818
24844
  });
24819
24845
  }
24820
24846
 
24821
- loadOpmData(data, pdbid, bFull, type, pdbid2) { let ic = this.icn3d; ic.icn3dui;
24847
+ loadOpmData(data, pdbid, bFull, type, pdbid2) { let ic = this.icn3d, me = ic.icn3dui;
24822
24848
  let thisClass = this;
24823
24849
  let url, dataType;
24824
24850
 
24825
24851
  if(!pdbid) pdbid = 'stru';
24826
24852
 
24827
- url = "https://www.ncbi.nlm.nih.gov/Structure/mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
24853
+ url = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
24828
24854
  dataType = "jsonp";
24829
24855
 
24830
24856
  $.ajax({
@@ -24965,7 +24991,7 @@ class MmdbParser {
24965
24991
 
24966
24992
  let molid2rescount = data.moleculeInfor;
24967
24993
  let molid2color = {}, chain2molid = {}, molid2chain = {};
24968
- let chainNameHash = {};
24994
+ let chainNameHash = {};
24969
24995
  for(let i in molid2rescount) {
24970
24996
  if(Object.keys(molid2rescount[i]).length === 0) continue;
24971
24997
 
@@ -24985,7 +25011,7 @@ class MmdbParser {
24985
25011
  chain2molid[chain] = i;
24986
25012
  molid2chain[i] = chain;
24987
25013
 
24988
- ic.chainsColor[chain] =(type !== undefined) ? me.parasCls.thr(me.htmlCls.GREY8) : me.parasCls.thr(color);
25014
+ ic.chainsColor[chain] = (type !== undefined && !me.cfg.mmdbafid) ? me.parasCls.thr(me.htmlCls.GREY8) : me.parasCls.thr(color);
24989
25015
 
24990
25016
  let geneId =(molid2rescount[i].geneId === undefined) ? '' : molid2rescount[i].geneId;
24991
25017
  let geneSymbol =(molid2rescount[i].geneSymbol === undefined) ? '' : molid2rescount[i].geneSymbol;
@@ -26101,6 +26127,7 @@ class ChainalignParser {
26101
26127
  let ajaxArray = [], indexArray = [], struArray = [];
26102
26128
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
26103
26129
  let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
26130
+ //let urltmalign = "https://test.ncbi.nlm.nih.gov/Structure/tmalign/tmalign.cgi";
26104
26131
 
26105
26132
  for(let index in ic.afChainIndexHash) {
26106
26133
  let idArray = ic.afChainIndexHash[index].split('_');
@@ -26556,7 +26583,7 @@ class ChainalignParser {
26556
26583
 
26557
26584
  let url_t;
26558
26585
  if(ic.mmdbid_t.length > 5) {
26559
- url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_t + "-F1-model_v2.pdb";
26586
+ url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_t + "-F1-model_v3.pdb";
26560
26587
 
26561
26588
  targetAjax = $.ajax({
26562
26589
  url: url_t,
@@ -26594,7 +26621,7 @@ class ChainalignParser {
26594
26621
 
26595
26622
  let url_q, queryAjax;
26596
26623
  if(ic.mmdbid_q.length > 5) {
26597
- url_q = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_q + "-F1-model_v2.pdb";
26624
+ url_q = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_q + "-F1-model_v3.pdb";
26598
26625
 
26599
26626
  queryAjax = $.ajax({
26600
26627
  url: url_q,
@@ -26897,7 +26924,7 @@ class ChainalignParser {
26897
26924
  let structure = ic.structArray[i];
26898
26925
 
26899
26926
  if(isNaN(structure) && structure.length > 5) {
26900
- url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.structArray[i] + "-F1-model_v2.pdb";
26927
+ url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.structArray[i] + "-F1-model_v3.pdb";
26901
26928
 
26902
26929
  targetAjax = $.ajax({
26903
26930
  url: url_t,
@@ -26962,6 +26989,8 @@ class ChainalignParser {
26962
26989
  let hAtoms = {}, hAtomsTmp = {};
26963
26990
  let bLastQuery = false;
26964
26991
 
26992
+ ic.opts['color'] = (structArray.length == 1) ? 'chain' : 'structure';
26993
+
26965
26994
  for(let i = 0, il = structArray.length; i < il; ++i) {
26966
26995
  if(i == structArray.length - 1) bLastQuery = true;
26967
26996
 
@@ -26974,10 +27003,11 @@ class ChainalignParser {
26974
27003
  targetOrQuery = 'query';
26975
27004
  bAppend = true;
26976
27005
  }
26977
-
27006
+
26978
27007
  //if(structArray[i].length > 4) {
26979
27008
  if(structArray[i].length > 5) { // PDB ID plus postfix could be 5
26980
- let bNoDssp = true;
27009
+ //let bNoDssp = true;
27010
+ let bNoDssp = false; // get secondary structure info
26981
27011
  hAtomsTmp = ic.pdbParserCls.loadPdbData(queryDataArray[i], structArray[i], false, bAppend, targetOrQuery, bLastQuery, bNoDssp);
26982
27012
  }
26983
27013
  else {
@@ -26990,7 +27020,7 @@ class ChainalignParser {
26990
27020
 
26991
27021
  // calculate secondary structures with applyCommandDssp
26992
27022
  if(bQuery && me.cfg.matchedchains) {
26993
- $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
27023
+ // $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
26994
27024
  let bRealign = true, bPredefined = true;
26995
27025
  ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
26996
27026
  // reset annotations
@@ -26999,11 +27029,10 @@ class ChainalignParser {
26999
27029
  if($('#' + ic.pre + 'dl_selectannotations').dialog( 'isOpen' )) {
27000
27030
  $('#' + ic.pre + 'dl_selectannotations').dialog( 'close' );
27001
27031
  }
27002
- });
27003
- }
27004
- else {
27005
- ic.pdbParserCls.applyCommandDssp(true);
27032
+ //});
27006
27033
  }
27034
+
27035
+ if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
27007
27036
  }
27008
27037
  }
27009
27038
 
@@ -28451,6 +28480,24 @@ class LoadScript {
28451
28480
 
28452
28481
  return;
28453
28482
  }
28483
+ else if(ic.commands[i].trim().indexOf('set annotation ptm') == 0 ) { // the command may have "|||{"factor"...
28484
+ let strArray = ic.commands[i].split("|||");
28485
+
28486
+ if(Object.keys(ic.proteins).length > 0 &&(ic.bAjaxPTM === undefined || !ic.bAjaxPTM) ) {
28487
+ $.when(thisClass.applyCommandPTM(strArray[0].trim())).then(function() {
28488
+ thisClass.execCommandsBase(i + 1, end, steps);
28489
+ });
28490
+ }
28491
+ else {
28492
+ if(Object.keys(ic.proteins).length > 0) {
28493
+ thisClass.applyCommandPTM(strArray[0].trim());
28494
+ }
28495
+
28496
+ this.execCommandsBase(i + 1, end, steps);
28497
+ }
28498
+
28499
+ return;
28500
+ }
28454
28501
  else if(ic.commands[i].trim().indexOf('set annotation 3ddomain') == 0) { // the command may have "|||{"factor"...
28455
28502
  let strArray = ic.commands[i].split("|||");
28456
28503
 
@@ -28681,6 +28728,8 @@ class LoadScript {
28681
28728
  ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
28682
28729
  }
28683
28730
 
28731
+ me.cfg.aligntool = 'vast';
28732
+
28684
28733
  $.when(thisClass.applyCommandRealignByStruct(command)).then(function() {
28685
28734
  thisClass.execCommandsBase(i + 1, end, steps);
28686
28735
  });
@@ -28841,6 +28890,9 @@ class LoadScript {
28841
28890
  else if(lastCommand.indexOf('set annotation snp') == 0) {
28842
28891
  thisClass.applyCommandSnp(lastCommand);
28843
28892
  }
28893
+ else if(lastCommand.indexOf('set annotation ptm') == 0) {
28894
+ thisClass.applyCommandPTM(lastCommand);
28895
+ }
28844
28896
  else if(lastCommand.indexOf('set annotation 3ddomain') == 0) {
28845
28897
  thisClass.applyCommand3ddomain(lastCommand);
28846
28898
  }
@@ -28891,6 +28943,9 @@ class LoadScript {
28891
28943
  let nameArray = paraArray[1].split(',');
28892
28944
  ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
28893
28945
  }
28946
+
28947
+ me.cfg.aligntool = 'vast';
28948
+
28894
28949
  thisClass.applyCommandRealignByStruct(lastCommand);
28895
28950
  }
28896
28951
  else if(lastCommand.indexOf('realign on tmalign') == 0) {
@@ -29296,6 +29351,25 @@ class LoadScript {
29296
29351
  return ic.deferredSnp.promise();
29297
29352
  }
29298
29353
 
29354
+ applyCommandPTMBase(command) { let ic = this.icn3d; ic.icn3dui;
29355
+ // chain functions together
29356
+ let pos = command.lastIndexOf(' '); // set annotation clinvar
29357
+ command.substr(pos + 1);
29358
+
29359
+ ic.annotationCls.setAnnoTabPTM();
29360
+ }
29361
+
29362
+ applyCommandPTM(command) { let ic = this.icn3d; ic.icn3dui;
29363
+ let thisClass = this;
29364
+
29365
+ // chain functions together
29366
+ ic.deferredPTM = $.Deferred(function() {
29367
+ thisClass.applyCommandPTMBase(command);
29368
+ }); // end of me.deferred = $.Deferred(function() {
29369
+
29370
+ return ic.deferredPTM.promise();
29371
+ }
29372
+
29299
29373
  applyCommand3ddomainBase(command) { let ic = this.icn3d; ic.icn3dui;
29300
29374
  // chain functions together
29301
29375
  let pos = command.lastIndexOf(' ');
@@ -29640,7 +29714,7 @@ class ResizeCanvas {
29640
29714
  //let itemArray = ['dl_selectannotations', 'dl_alignment', 'dl_2ddgm', 'dl_definedsets', 'dl_graph',
29641
29715
  // 'dl_linegraph', 'dl_scatterplot', 'dl_contactmap', 'dl_allinteraction', 'dl_copyurl',
29642
29716
  // 'dl_symmetry', 'dl_symd', 'dl_rmsd', 'dl_legend', 'dl_disttable'];
29643
- 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'];
29717
+ 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'];
29644
29718
 
29645
29719
  for(let i in itemArray) {
29646
29720
  let item = itemArray[i];
@@ -30837,7 +30911,8 @@ class ShowSeq {
30837
30911
  if(seqLength > ic.maxAnnoLength) {
30838
30912
  ic.maxAnnoLength = seqLength;
30839
30913
  }
30840
- let itemArray = ['giseq', 'cddsite', 'clinvar', 'snp', 'domain', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
30914
+ //let itemArray = ['giseq', 'cddsite', 'ptm', 'clinvar', 'snp', 'domain', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
30915
+ let itemArray = ['giseq', 'cddsite', 'clinvar', 'snp', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'custom', 'interaction'];
30841
30916
  for(let i in itemArray) {
30842
30917
  let item = itemArray[i];
30843
30918
  if($("#" + ic.pre + item + "_" + chnid).length) $("#" + ic.pre + item + "_" + chnid).width(divLength);
@@ -32677,7 +32752,7 @@ class AnnoCddSite {
32677
32752
  let chnidArray = Object.keys(ic.protein_chainid);
32678
32753
  // show conserved domains and binding sites
32679
32754
  // live search
32680
- let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + chnidBaseArray;
32755
+ let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + chnidBaseArray;
32681
32756
  // precalculated
32682
32757
  //let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + chnidBaseArray;
32683
32758
  // live search for AlphaFold structures
@@ -32723,7 +32798,7 @@ class AnnoCddSite {
32723
32798
 
32724
32799
  //url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + ic.giSeq[chnidArray[0]].join('');
32725
32800
  // live searchE
32726
- url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + seq;
32801
+ url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + seq;
32727
32802
  // precalculated
32728
32803
  //url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + seq;
32729
32804
 
@@ -33799,6 +33874,9 @@ class ApplyCommand {
33799
33874
  else if(command == 'set annotation interaction') {
33800
33875
  ic.annotationCls.setAnnoTabInteraction();
33801
33876
  }
33877
+ else if(command == 'set annotation ptm') {
33878
+ ic.annotationCls.setAnnoTabPTM();
33879
+ }
33802
33880
  else if(command == 'set annotation cdd') {
33803
33881
  ic.annotationCls.setAnnoTabCdd();
33804
33882
  }
@@ -33845,6 +33923,9 @@ class ApplyCommand {
33845
33923
  else if(type == 'site') {
33846
33924
  ic.annotationCls.hideAnnoTabSite();
33847
33925
  }
33926
+ else if(type == 'ptm') {
33927
+ ic.annotationCls.hideAnnoTabPTM();
33928
+ }
33848
33929
  else if(type == 'interaction') {
33849
33930
  ic.annotationCls.hideAnnoTabInteraction();
33850
33931
  }
@@ -34997,7 +35078,7 @@ class ApplyCommand {
34997
35078
  else if(cmd.indexOf('realign on seq align') == 0) return 'File > Realign Selection > on Sequence Alignment';
34998
35079
  else if(cmd.indexOf('realign') == 0) return 'File > Realign Selection > Residue by Residue';
34999
35080
  else if(cmd.indexOf('graph interaction pairs') == 0) return hbondIntStr + ' > 2D Graph(Force-Directed)';
35000
- else if(cmd.indexOf('export canvas') == 0) return 'File > Save Files > iCn3D PNG Image';
35081
+ else if(cmd.indexOf('export canvas') == 0) return 'File > Save File > iCn3D PNG Image';
35001
35082
  else if(cmd == 'export stl file') return printStr + 'STL';
35002
35083
  else if(cmd == 'export vrml file') return printStr + 'VRML(Color)';
35003
35084
  else if(cmd == 'export stl stabilizer file') return printStr + 'STL W/ Stabilizers';
@@ -35043,6 +35124,7 @@ class ApplyCommand {
35043
35124
  else if(cmd== 'set view overview') return seqAnnoStr + ': "Summary" tab';
35044
35125
  else if(cmd == 'set annotation custom') return seqAnnoStr + ': "Custom" checkbox';
35045
35126
  else if(cmd == 'set annotation interaction') return seqAnnoStr + ': "Interactions" checkbox';
35127
+ else if(cmd == 'set annotation ptm') return seqAnnoStr + ': "PTM" checkbox';
35046
35128
  else if(cmd == 'set annotation cdd') return seqAnnoStr + ': "Conserved Domains" checkbox';
35047
35129
  else if(cmd == 'set annotation site') return seqAnnoStr + ': "Functional Sites" checkbox';
35048
35130
  else if(cmd == 'set annotation ssbond') return seqAnnoStr + ': "Disulfide Bonds" checkbox';
@@ -35331,7 +35413,9 @@ class SelectByCommand {
35331
35413
  bResidueId = true;
35332
35414
  }
35333
35415
  else {
35334
- if(residueStrArray[j][0] === '3' && residueStrArray[j].length > 1 &&(residueStrArray[j].length - 1) % 3 === 0) { // three letter residue string, such as :3LysArg
35416
+ //if(residueStrArray[j].length > 1 && residueStrArray[j][0] === '3' && (residueStrArray[j].length - 1) % 3 === 0) { // three letter residue string, such as :3LysArg
35417
+ if(residueStrArray[j].length > 1 && residueStrArray[j][0] === '3'
35418
+ && isNaN(residueStrArray[j][1]) && residueStrArray[j][0] !== '-') { // three letter residue string, such as :3LysArg or :3ZN, but not :30 neither :3-10
35335
35419
  let tmpStr = residueStrArray[j].toUpperCase();
35336
35420
  threeLetterResidueStr = tmpStr.substr(1);
35337
35421
  bResidueArrayThree = true;
@@ -35447,7 +35531,8 @@ class SelectByCommand {
35447
35531
  }
35448
35532
  else if(bResidueArrayThree) {
35449
35533
  let threeLetter = me.utilsCls.residueAbbr2Name(ic.chainsSeq[molecule_chain][s].name);
35450
- chainSeq +=(threeLetter.length == 3) ? threeLetter : ' ';
35534
+
35535
+ chainSeq +=(threeLetter.length == 3) ? threeLetter : threeLetter.padEnd(3, '_');
35451
35536
  }
35452
35537
  resiArray.push(ic.chainsSeq[molecule_chain][s].resi);
35453
35538
  }
@@ -36345,7 +36430,8 @@ class SetSeqAlign {
36345
36430
  if(i > 0) {
36346
36431
  let index1 = alignIndex;
36347
36432
  for(let j = prevIndex1 + 1, jl = start1; j < jl; ++j) {
36348
- if(ic.chainsSeq[chainid1] === undefined) break;
36433
+ if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid1][j] === undefined) break;
36434
+
36349
36435
  let resi = ic.chainsSeq[chainid1][j].resi;
36350
36436
  let resn = ic.chainsSeq[chainid1][j].name.toLowerCase();
36351
36437
 
@@ -36359,7 +36445,8 @@ class SetSeqAlign {
36359
36445
 
36360
36446
  let index2 = alignIndex;
36361
36447
  for(let j = prevIndex2 + 1, jl = start2; j < jl; ++j) {
36362
- if(ic.chainsSeq[chainid2] === undefined) break;
36448
+ if(ic.chainsSeq[chainid2] === undefined || ic.chainsSeq[chainid2] === undefined) break;
36449
+
36363
36450
  let resi = ic.chainsSeq[chainid2][j].resi;
36364
36451
  let resn = ic.chainsSeq[chainid2][j].name.toLowerCase();
36365
36452
 
@@ -36505,11 +36592,15 @@ class SetSeqAlign {
36505
36592
  // start and end of MSA
36506
36593
  let start_t = 9999, end_t = -1;
36507
36594
 
36595
+ let baseResi = ic.chainsSeq[chainid1][0].resi - 1;
36596
+
36508
36597
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
36509
36598
  let chainIndex = index - 1;
36599
+ if(!ic.qt_start_end[chainIndex]) continue;
36600
+
36510
36601
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
36511
36602
  let start1, end1;
36512
- if(bRealign) { // realresidue numbers are stored
36603
+ if(bRealign) { // real residue numbers are stored
36513
36604
  start1 = ic.qt_start_end[chainIndex][i].t_start;
36514
36605
  end1 = ic.qt_start_end[chainIndex][i].t_end;
36515
36606
  }
@@ -36517,9 +36608,9 @@ class SetSeqAlign {
36517
36608
  start1 = ic.qt_start_end[chainIndex][i].t_start - 1;
36518
36609
  end1 = ic.qt_start_end[chainIndex][i].t_end - 1;
36519
36610
  }
36520
-
36521
36611
  for(let j = start1; j <= end1; ++j) {
36522
- let resi = this.getResi(chainidArray[0], j, bRealign);
36612
+ let resiPos = j - baseResi;
36613
+ let resi = this.getResi(chainidArray[0], resiPos, bRealign);
36523
36614
  resi2range_t[resi] = 1;
36524
36615
  if(j < start_t) start_t = j;
36525
36616
  if(j > end_t) end_t = j;
@@ -36527,6 +36618,9 @@ class SetSeqAlign {
36527
36618
  }
36528
36619
  }
36529
36620
 
36621
+ // TM-align should use "start1 = ic.qt_start_end[chainIndex][i].t_start - 1", but the rest are the same as ""bRealign"
36622
+ if(me.cfg.aligntool == 'tmalign') bRealign = true; // real residue numbers are stored
36623
+
36530
36624
  let resi2rangeArray = Object.keys(resi2range_t);
36531
36625
  resi2rangeArray.sort(function(a, b) {
36532
36626
  return parseInt(a) - parseInt(b);
@@ -36573,7 +36667,7 @@ class SetSeqAlign {
36573
36667
  for(let j = 0, jl = ic.chainsSeq[chainid1].length; j < jl; ++j) {
36574
36668
  let resi = ic.chainsSeq[chainid1][j].resi;
36575
36669
 
36576
- if((j < start_t || j > end_t) ) {
36670
+ if((j + baseResi < start_t || j + baseResi > end_t) ) {
36577
36671
  continue;
36578
36672
  }
36579
36673
 
@@ -37811,7 +37905,7 @@ class ParserUtils {
37811
37905
  if(me.cfg.showanno) {
37812
37906
  let cmd = "view annotations";
37813
37907
  me.htmlCls.clickMenuCls.setLogCmd(cmd, true);
37814
- ic.showAnnoCls.showAnnotations();
37908
+ ic.showAnnoCls.showAnnotations();
37815
37909
  }
37816
37910
  if(me.cfg.closepopup) {
37817
37911
  ic.resizeCanvasCls.closeDialogs();
@@ -38302,8 +38396,8 @@ class HlSeq {
38302
38396
  if(me.bNode) return;
38303
38397
 
38304
38398
  let thisClass = this;
38305
- $("#" + ic.pre + "dl_sequence2").add("[id^=" + ic.pre + "dt_giseq]").add("[id^=" + ic.pre + "dt_custom]").add("[id^=" + ic.pre + "dt_site]").add("[id^=" + ic.pre + "dt_snp]").add("[id^=" + ic.pre + "dt_clinvar]").add("[id^=" + ic.pre + "dt_cdd]").add("[id^=" + ic.pre + "dt_domain]").add("[id^=" + ic.pre + "dt_interaction]").add("[id^=" + ic.pre + "dt_ssbond]").add("[id^=" + ic.pre + "dt_crosslink]").add("[id^=" + ic.pre + "dt_transmem]")
38306
- .add("[id^=" + ic.pre + "tt_giseq]").add("[id^=" + ic.pre + "tt_custom]").add("[id^=" + ic.pre + "tt_site]").add("[id^=" + ic.pre + "tt_snp]").add("[id^=" + ic.pre + "tt_clinvar]").add("[id^=" + ic.pre + "tt_cdd]").add("[id^=" + ic.pre + "tt_domain]").add("[id^=" + ic.pre + "tt_interaction]").add("[id^=" + ic.pre + "tt_ssbond]").add("[id^=" + ic.pre + "tt_crosslink]").add("[id^=" + ic.pre + "tt_transmem]")
38399
+ $("#" + ic.pre + "dl_sequence2").add("[id^=" + ic.pre + "dt_giseq]").add("[id^=" + ic.pre + "dt_custom]").add("[id^=" + ic.pre + "dt_site]").add("[id^=" + ic.pre + "dt_ptm]").add("[id^=" + ic.pre + "dt_snp]").add("[id^=" + ic.pre + "dt_clinvar]").add("[id^=" + ic.pre + "dt_cdd]").add("[id^=" + ic.pre + "dt_domain]").add("[id^=" + ic.pre + "dt_interaction]").add("[id^=" + ic.pre + "dt_ssbond]").add("[id^=" + ic.pre + "dt_crosslink]").add("[id^=" + ic.pre + "dt_transmem]")
38400
+ .add("[id^=" + ic.pre + "tt_giseq]").add("[id^=" + ic.pre + "tt_custom]").add("[id^=" + ic.pre + "tt_site]").add("[id^=" + ic.pre + "tt_ptm]").add("[id^=" + ic.pre + "tt_snp]").add("[id^=" + ic.pre + "tt_clinvar]").add("[id^=" + ic.pre + "tt_cdd]").add("[id^=" + ic.pre + "tt_domain]").add("[id^=" + ic.pre + "tt_interaction]").add("[id^=" + ic.pre + "tt_ssbond]").add("[id^=" + ic.pre + "tt_crosslink]").add("[id^=" + ic.pre + "tt_transmem]")
38307
38401
  .selectable({
38308
38402
  distance: 1, //Tolerance, in pixels, for when selecting should start. If specified, selecting will not start until the mouse has been dragged beyond the specified distance.
38309
38403
  stop: function() { let ic = thisClass.icn3d;
@@ -38356,11 +38450,11 @@ class HlSeq {
38356
38450
  }
38357
38451
  });
38358
38452
 
38359
- $("[id^=" + ic.pre + "ov_giseq]").add("[id^=" + ic.pre + "ov_custom]").add("[id^=" + ic.pre + "ov_site]").add("[id^=" + ic.pre + "ov_snp]").add("[id^=" + ic.pre + "ov_clinvar]").add("[id^=" + ic.pre + "ov_cdd]").add("[id^=" + ic.pre + "ov_domain]").add("[id^=" + ic.pre + "ov_interaction]").add("[id^=" + ic.pre + "ov_ssbond]").add("[id^=" + ic.pre + "ov_crosslink]").add("[id^=" + ic.pre + "ov_transmem]")
38360
- .add("[id^=" + ic.pre + "tt_giseq]").add("[id^=" + ic.pre + "tt_custom]").add("[id^=" + ic.pre + "tt_site]").add("[id^=" + ic.pre + "tt_snp]").add("[id^=" + ic.pre + "tt_clinvar]").add("[id^=" + ic.pre + "tt_cdd]").add("[id^=" + ic.pre + "tt_domain]").add("[id^=" + ic.pre + "tt_interaction]").add("[id^=" + ic.pre + "tt_ssbond]").add("[id^=" + ic.pre + "tt_crosslink]").add("[id^=" + ic.pre + "tt_transmem]")
38453
+ $("[id^=" + ic.pre + "ov_giseq]").add("[id^=" + ic.pre + "ov_custom]").add("[id^=" + ic.pre + "ov_site]").add("[id^=" + ic.pre + "ov_ptm]").add("[id^=" + ic.pre + "ov_snp]").add("[id^=" + ic.pre + "ov_clinvar]").add("[id^=" + ic.pre + "ov_cdd]").add("[id^=" + ic.pre + "ov_domain]").add("[id^=" + ic.pre + "ov_interaction]").add("[id^=" + ic.pre + "ov_ssbond]").add("[id^=" + ic.pre + "ov_crosslink]").add("[id^=" + ic.pre + "ov_transmem]")
38454
+ .add("[id^=" + ic.pre + "tt_giseq]").add("[id^=" + ic.pre + "tt_custom]").add("[id^=" + ic.pre + "tt_site]").add("[id^=" + ic.pre + "tt_ptm]").add("[id^=" + ic.pre + "tt_snp]").add("[id^=" + ic.pre + "tt_clinvar]").add("[id^=" + ic.pre + "tt_cdd]").add("[id^=" + ic.pre + "tt_domain]").add("[id^=" + ic.pre + "tt_interaction]").add("[id^=" + ic.pre + "tt_ssbond]").add("[id^=" + ic.pre + "tt_crosslink]").add("[id^=" + ic.pre + "tt_transmem]")
38361
38455
 
38362
- .add("#" + ic.pre + "dl_sequence2").add("[id^=" + ic.pre + "dt_giseq]").add("[id^=" + ic.pre + "dt_custom]").add("[id^=" + ic.pre + "dt_site]").add("[id^=" + ic.pre + "dt_snp]").add("[id^=" + ic.pre + "dt_clinvar]").add("[id^=" + ic.pre + "dt_cdd]").add("[id^=" + ic.pre + "dt_domain]").add("[id^=" + ic.pre + "dt_interaction]").add("[id^=" + ic.pre + "dt_ssbond]").add("[id^=" + ic.pre + "dt_crosslink]").add("[id^=" + ic.pre + "dt_transmem]")
38363
- .add("[id^=" + ic.pre + "tt_giseq]").add("[id^=" + ic.pre + "tt_custom]").add("[id^=" + ic.pre + "tt_site]").add("[id^=" + ic.pre + "tt_snp]").add("[id^=" + ic.pre + "tt_clinvar]").add("[id^=" + ic.pre + "tt_cdd]").add("[id^=" + ic.pre + "tt_domain]").add("[id^=" + ic.pre + "tt_interaction]").add("[id^=" + ic.pre + "tt_ssbond]").add("[id^=" + ic.pre + "tt_crosslink]").add("[id^=" + ic.pre + "tt_transmem]")
38456
+ .add("#" + ic.pre + "dl_sequence2").add("[id^=" + ic.pre + "dt_giseq]").add("[id^=" + ic.pre + "dt_custom]").add("[id^=" + ic.pre + "dt_site]").add("[id^=" + ic.pre + "dt_ptm]").add("[id^=" + ic.pre + "dt_snp]").add("[id^=" + ic.pre + "dt_clinvar]").add("[id^=" + ic.pre + "dt_cdd]").add("[id^=" + ic.pre + "dt_domain]").add("[id^=" + ic.pre + "dt_interaction]").add("[id^=" + ic.pre + "dt_ssbond]").add("[id^=" + ic.pre + "dt_crosslink]").add("[id^=" + ic.pre + "dt_transmem]")
38457
+ .add("[id^=" + ic.pre + "tt_giseq]").add("[id^=" + ic.pre + "tt_custom]").add("[id^=" + ic.pre + "tt_site]").add("[id^=" + ic.pre + "tt_ptm]").add("[id^=" + ic.pre + "tt_snp]").add("[id^=" + ic.pre + "tt_clinvar]").add("[id^=" + ic.pre + "tt_cdd]").add("[id^=" + ic.pre + "tt_domain]").add("[id^=" + ic.pre + "tt_interaction]").add("[id^=" + ic.pre + "tt_ssbond]").add("[id^=" + ic.pre + "tt_crosslink]").add("[id^=" + ic.pre + "tt_transmem]")
38364
38458
 
38365
38459
  .on('click', '.icn3d-seqTitle', function(e) { let ic = thisClass.icn3d;
38366
38460
  e.stopImmediatePropagation();
@@ -38401,7 +38495,7 @@ class HlSeq {
38401
38495
 
38402
38496
  let thisClass = this;
38403
38497
 
38404
- $("#" + ic.pre + "dl_sequence2").add("[id^=" + ic.pre + "giseq]").add("[id^=" + ic.pre + "custom]").add("[id^=" + ic.pre + "site]").add("[id^=" + ic.pre + "clinvar]").add("[id^=" + ic.pre + "snp]").add("[id^=" + ic.pre + "cdd]").add("[id^=" + ic.pre + "domain]").add("[id^=" + ic.pre + "interaction]").add("[id^=" + ic.pre + "ssbond]").add("[id^=" + ic.pre + "crosslink]").add("[id^=" + ic.pre + "transmem]").on('click', '.icn3d-residue', function(e) { let ic = thisClass.icn3d;
38498
+ $("#" + ic.pre + "dl_sequence2").add("[id^=" + ic.pre + "giseq]").add("[id^=" + ic.pre + "custom]").add("[id^=" + ic.pre + "site]").add("[id^=" + ic.pre + "ptm]").add("[id^=" + ic.pre + "clinvar]").add("[id^=" + ic.pre + "snp]").add("[id^=" + ic.pre + "cdd]").add("[id^=" + ic.pre + "domain]").add("[id^=" + ic.pre + "interaction]").add("[id^=" + ic.pre + "ssbond]").add("[id^=" + ic.pre + "crosslink]").add("[id^=" + ic.pre + "transmem]").on('click', '.icn3d-residue', function(e) { let ic = thisClass.icn3d;
38405
38499
  e.stopImmediatePropagation();
38406
38500
  /*
38407
38501
  //if($(this).attr('id') === ic.pre + "dl_sequence2") {
@@ -38450,7 +38544,7 @@ class HlSeq {
38450
38544
 
38451
38545
  let thisClass = this;
38452
38546
 
38453
- $("#" + ic.pre + "dl_sequence2").add("[id^=" + ic.pre + "giseq]").add("[id^=" + ic.pre + "custom]").add("[id^=" + ic.pre + "site]").add("[id^=" + ic.pre + "feat]").add("[id^=" + ic.pre + "clinvar]").add("[id^=" + ic.pre + "snp]").add("[id^=" + ic.pre + "cdd]").add("[id^=" + ic.pre + "domain]").add("[id^=" + ic.pre + "interaction]").add("[id^=" + ic.pre + "ssbond]").add("[id^=" + ic.pre + "crosslink]").add("[id^=" + ic.pre + "transmem]").on('click', '.icn3d-seqTitle', function(e) { let ic = thisClass.icn3d;
38547
+ $("#" + ic.pre + "dl_sequence2").add("[id^=" + ic.pre + "giseq]").add("[id^=" + ic.pre + "custom]").add("[id^=" + ic.pre + "site]").add("[id^=" + ic.pre + "ptm]").add("[id^=" + ic.pre + "feat]").add("[id^=" + ic.pre + "clinvar]").add("[id^=" + ic.pre + "snp]").add("[id^=" + ic.pre + "cdd]").add("[id^=" + ic.pre + "domain]").add("[id^=" + ic.pre + "interaction]").add("[id^=" + ic.pre + "ssbond]").add("[id^=" + ic.pre + "crosslink]").add("[id^=" + ic.pre + "transmem]").on('click', '.icn3d-seqTitle', function(e) { let ic = thisClass.icn3d;
38454
38548
  e.stopImmediatePropagation();
38455
38549
 
38456
38550
  //if($(this).attr('id') === ic.pre + "dl_sequence2") {
@@ -38647,7 +38741,7 @@ class HlSeq {
38647
38741
  let residueid;
38648
38742
  let structure = chainid.substr(0, chainid.indexOf('_'));
38649
38743
  for(let i = 0, il = posArray.length; i < il; ++i) {
38650
- if($(that).attr('site') !== undefined) {
38744
+ if($(that).attr('site') !== undefined || $(that).attr('ptm') !== undefined) {
38651
38745
  if(ic.bNCBI) {
38652
38746
  let residNCBI = chainid + '_' +(parseInt(posArray[i])+1).toString();
38653
38747
  // AlphaFold domains calculated on-the-fly have no conversion
@@ -38817,9 +38911,11 @@ class ShowAnno {
38817
38911
  }
38818
38912
 
38819
38913
  let nucleotide_chainid = {}, chemical_chainid = {}, chemical_set = {};
38820
- ic.protein_chainid = {};
38914
+ //ic.protein_chainid = {};
38821
38915
 
38822
38916
  if(ic.bAnnoShown === undefined || !ic.bAnnoShown || ic.bResetAnno) { // ic.bResetAnno when loading another structure
38917
+ ic.protein_chainid = {};
38918
+
38823
38919
  let chainArray = Object.keys(ic.chains);
38824
38920
 
38825
38921
  if(ic.giSeq === undefined) ic.giSeq = {};
@@ -38860,6 +38956,7 @@ class ShowAnno {
38860
38956
  chainidBase = chainArray[i];
38861
38957
  }
38862
38958
  //if(me.cfg.mmdbid !== undefined) { // protein and chemicals/ions are in different chains
38959
+
38863
38960
  if(ic.proteins.hasOwnProperty(atom.serial) && ic.chainsSeq[chainArray[i]].length > 1) {
38864
38961
  ic.protein_chainid[chainArray[i]] = chainidBase;
38865
38962
  }
@@ -39046,6 +39143,8 @@ class ShowAnno {
39046
39143
  ++i;
39047
39144
  }
39048
39145
  ic.interactChainbase = me.hashUtilsCls.unionHash(ic.interactChainbase, chemical_chainid);
39146
+ ic.PTMChainbase = me.hashUtilsCls.unionHash(ic.PTMChainbase, ic.protein_chainid);
39147
+
39049
39148
  ic.ssbondChainbase = me.hashUtilsCls.unionHash(ic.ssbondChainbase, ic.protein_chainid);
39050
39149
  ic.ssbondChainbase = me.hashUtilsCls.unionHash(ic.ssbondChainbase, chemical_chainid);
39051
39150
  ic.crosslinkChainbase = me.hashUtilsCls.unionHash(ic.crosslinkChainbase, ic.protein_chainid);
@@ -39077,8 +39176,10 @@ class ShowAnno {
39077
39176
  //if(proteinName.length > 40) proteinName = proteinName.substr(0, 40) + "...";
39078
39177
  let categoryStr =(index == 0) ? "<span class='icn3d-annoLargeTitle'><b>Proteins</b>: </span><br><br>" : "";
39079
39178
  let geneLink =(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneId) ? "(Gene: <a href='https://www.ncbi.nlm.nih.gov/gene/" + ic.chainsGene[chnid].geneId + "' target='_blank' title='" + ic.chainsGene[chnid].geneDesc + "'>" + ic.chainsGene[chnid].geneSymbol + "</a>)" : '';
39179
+ let structure = chnid.substr(0, chnid.indexOf('_'));
39180
+ let chainLink = (structure.length > 5) ? '<a href="https://alphafold.ebi.ac.uk/entry/' + structure + '" target="_blank">' + chnid + '</a>' : chnid;
39080
39181
  let chainHtml = "<div id='" + ic.pre + "anno_" + chnid + "' class='icn3d-annotation'>" + categoryStr
39081
- + "<span style='font-weight:bold;'>Annotations of " + chnid
39182
+ + "<span style='font-weight:bold;'>Annotations of " + chainLink
39082
39183
  + "</span>: <a class='icn3d-blue' href='https://www.ncbi.nlm.nih.gov/protein?term="
39083
39184
  + chnid + "' target='_blank' title='" + fullProteinName + "'>" + proteinName + "</a>"
39084
39185
  + geneLink + "&nbsp;&nbsp;&nbsp;"
@@ -39091,7 +39192,8 @@ class ShowAnno {
39091
39192
  + this.addButton(chnid, "icn3d-sheetsets", "Sheet Sets", "Define sets for each sheet in this chain and add them to the menu of \"Defined Sets\"", 60, buttonStyle) + "&nbsp;"
39092
39193
  + this.addButton(chnid, "icn3d-coilsets", "Coil Sets", "Define sets for each coil in this chain and add them to the menu of \"Defined Sets\"", 60, buttonStyle);
39093
39194
  $("#" + ic.pre + "dl_annotations").append(chainHtml);
39094
- let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'domain', 'site', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
39195
+ //let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'domain', 'site', 'ptm', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
39196
+ let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'site', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'custom', 'interaction'];
39095
39197
  // dt: detailed view, hide by default; ov: overview, show by default
39096
39198
  for(let i in itemArray) {
39097
39199
  let item = itemArray[i];
@@ -39519,6 +39621,286 @@ class ShowAnno {
39519
39621
 
39520
39622
  }
39521
39623
 
39624
+ /**
39625
+ * @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
39626
+ */
39627
+
39628
+ class AnnoPTM {
39629
+ constructor(icn3d) {
39630
+ this.icn3d = icn3d;
39631
+ }
39632
+
39633
+ //Show the annotations of CDD domains and binding sites.
39634
+ showPTM(chnid, chnidBase) { let ic = this.icn3d; ic.icn3dui;
39635
+ let thisClass = this;
39636
+
39637
+ // UniProt ID
39638
+ let structure = chnid.substr(0, chnid.indexOf('_'));
39639
+ let chain = chnid.substr(chnid.indexOf('_') + 1);
39640
+
39641
+ // UniProt ID
39642
+ if( structure.length > 5 ) {
39643
+ let url = "https://www.ebi.ac.uk/proteins/api/features/" + structure;
39644
+ $.ajax({
39645
+ url: url,
39646
+ dataType: 'json',
39647
+ cache: true,
39648
+ tryCount : 0,
39649
+ retryLimit : 0, //1
39650
+ success: function(data) {
39651
+ thisClass.parsePTM(data, chnid);
39652
+ if(ic.deferredPTM !== undefined) ic.deferredPTM.resolve();
39653
+ },
39654
+ error : function(xhr, textStatus, errorThrown ) {
39655
+ this.tryCount++;
39656
+ if(this.tryCount <= this.retryLimit) {
39657
+ //try again
39658
+ $.ajax(this);
39659
+ return;
39660
+ }
39661
+
39662
+ thisClass.getNoPTM(chnid);
39663
+
39664
+ return;
39665
+ }
39666
+ });
39667
+ }
39668
+ else { // PDB
39669
+ // get PDB to UniProt mapping
39670
+ // https://www.ebi.ac.uk/pdbe/api/doc/
39671
+ let structLower = structure.substr(0, 4).toLowerCase();
39672
+ let urlMap = "https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/" + structLower;
39673
+
39674
+ $.ajax({
39675
+ url: urlMap,
39676
+ dataType: 'json',
39677
+ cache: true,
39678
+ success: function(dataMap) {
39679
+ let UniProtID = '';
39680
+ if(!ic.UPResi2ResiPosPerChain) ic.UPResi2ResiPosPerChain = {};
39681
+ ic.UPResi2ResiPosPerChain[chnid] = {};
39682
+ let mapping = dataMap[structLower].UniProt;
39683
+
39684
+ let bFound = false;
39685
+ for(let up in mapping) {
39686
+ let chainArray = mapping[up].mappings;
39687
+ if(bFound) break;
39688
+
39689
+ for(let i = 0, il = chainArray.length; i < il; ++i) {
39690
+ //"entity_id": 3, "end": { "author_residue_number": null, "author_insertion_code": "", "residue_number": 219 }, "chain_id": "A", "start": { "author_residue_number": 94, "author_insertion_code": "", "residue_number": 1 }, "unp_end": 312, "unp_start": 94, "struct_asym_id": "C"
39691
+ let chainObj = chainArray[i];
39692
+ if(chainObj.chain_id == chain) {
39693
+ let start = chainObj.unp_start;
39694
+ let end = chainObj.unp_end;
39695
+ let posStart = chainObj.start.residue_number;
39696
+ let posEnd = chainObj.end.residue_number;
39697
+
39698
+ if(posEnd - posStart != end - start) {
39699
+ console.log("There might be some issues in the PDB to UniProt residue mapping.");
39700
+ }
39701
+
39702
+ for(let j = 0; j <= end - start; ++j) {
39703
+ ic.UPResi2ResiPosPerChain[chnid][j + start] = j + posStart - 1; // 0-based
39704
+ }
39705
+
39706
+ UniProtID = up;
39707
+ bFound = true;
39708
+ break;
39709
+ }
39710
+ }
39711
+ }
39712
+
39713
+ if(UniProtID == '') {
39714
+ thisClass.getNoPTM(chnid);
39715
+ }
39716
+ else {
39717
+ let url = "https://www.ebi.ac.uk/proteins/api/features/" + UniProtID;
39718
+ $.ajax({
39719
+ url: url,
39720
+ dataType: 'json',
39721
+ cache: true,
39722
+ tryCount : 0,
39723
+ retryLimit : 0, //1
39724
+ success: function(data) {
39725
+ thisClass.parsePTM(data, chnid);
39726
+ if(ic.deferredPTM !== undefined) ic.deferredPTM.resolve();
39727
+ },
39728
+ error : function(xhr, textStatus, errorThrown ) {
39729
+ this.tryCount++;
39730
+ if(this.tryCount <= this.retryLimit) {
39731
+ //try again
39732
+ $.ajax(this);
39733
+ return;
39734
+ }
39735
+
39736
+ thisClass.getNoPTM(chnid);
39737
+
39738
+ return;
39739
+ }
39740
+ });
39741
+ }
39742
+ },
39743
+ error : function(xhr, textStatus, errorThrown ) {
39744
+ thisClass.getNoPTM(chnid);
39745
+ }
39746
+ });
39747
+ }
39748
+ }
39749
+
39750
+ parsePTM(data, chnid) { let ic = this.icn3d, me = ic.icn3dui;
39751
+
39752
+ if(me.bNode) {
39753
+ //if(!ic.resid2ptm) ic.resid2ptm = {};
39754
+ ic.resid2ptm = {};
39755
+ ic.resid2ptm[chnid] = [];
39756
+ }
39757
+
39758
+ let ptmHash = {};
39759
+ for(let i = 0, il = data.features.length; i < il; ++i) {
39760
+ let feature = data.features[i];
39761
+
39762
+ if(feature.category == 'PTM' && feature.type != 'DISULFID' && feature.type != 'CROSSLNK') {
39763
+ let title = '';
39764
+ if(feature.type == 'CARBOHYD') {
39765
+ //title = 'Glycosylation, ' + feature.description;
39766
+ title = 'Glycosylation';
39767
+ }
39768
+ else if(feature.type == 'LIPID') {
39769
+ title = 'Lipidation, ' + feature.description;
39770
+ }
39771
+ else if(feature.description.indexOf('Phospho') == 0) {
39772
+ title = 'Phosphorylation';
39773
+ }
39774
+ else if(feature.description) {
39775
+ title = feature.description;
39776
+ }
39777
+ else {
39778
+ title = feature.type;
39779
+ }
39780
+
39781
+ if(!ptmHash[title]) ptmHash[title] = [];
39782
+ ptmHash[title].push(feature);
39783
+ }
39784
+ }
39785
+
39786
+ let index = 0;
39787
+ let html = '', html2 = '', html3 = '';
39788
+ html += '<div id="' + ic.pre + chnid + '_ptmseq_sequence" class="icn3d-cdd icn3d-dl_sequence">';
39789
+ html2 += html;
39790
+ html3 += html;
39791
+ let stucture = chnid.substr(0, chnid.indexOf('_'));
39792
+
39793
+ for(let ptm in ptmHash) {
39794
+ let ptmArray = ptmHash[ptm];
39795
+ //"type": "MOD_RES", "category": "PTM", "description": "4-hydroxyproline", "begin": "382", "end": "382",
39796
+ let resPosArray = [];
39797
+ let bCoordinates = false;
39798
+ for(let i = 0, il = ptmArray.length; i < il; ++i) {
39799
+ let begin = parseInt(ptmArray[i].begin);
39800
+ let end = parseInt(ptmArray[i].end);
39801
+
39802
+
39803
+ for(let j = begin; j <= end; ++j) {
39804
+ if(stucture.length > 5) { // UniProt
39805
+ resPosArray.push(j - 1); // 0-based
39806
+ }
39807
+ else { // PDB
39808
+ if(ic.UPResi2ResiPosPerChain[chnid][j]) resPosArray.push(ic.UPResi2ResiPosPerChain[chnid][j]);
39809
+ }
39810
+
39811
+ if(!bCoordinates && ic.residues.hasOwnProperty(chnid + '_' + j)) {
39812
+ bCoordinates = true;
39813
+ }
39814
+ }
39815
+ }
39816
+
39817
+ if(resPosArray.length == 0) continue;
39818
+
39819
+ let resCnt = resPosArray.length;
39820
+ let title = 'PTM: ' + ptm;
39821
+ if(title.length > 17) title = title.substr(0, 17) + '...';
39822
+ let fulltitle = ptm;
39823
+
39824
+ let linkStr = (bCoordinates) ? 'icn3d-link icn3d-blue' : '';
39825
+
39826
+ let htmlTmp2 = '<div class="icn3d-seqTitle ' + linkStr + '" ptm="ptm" posarray="' + resPosArray.toString() + '" shorttitle="' + title + '" setname="' + chnid + '_ptm_' + index + '" anno="sequence" chain="' + chnid + '" title="' + fulltitle + '">' + title + ' </div>';
39827
+ let htmlTmp3 = '<span class="icn3d-residueNum" title="residue count">' + resCnt.toString() + ' Res</span>';
39828
+ let htmlTmp = '<span class="icn3d-seqLine">';
39829
+ html3 += htmlTmp2 + htmlTmp3 + '<br>';
39830
+ html += htmlTmp2 + htmlTmp3 + htmlTmp;
39831
+ html2 += htmlTmp2 + htmlTmp3 + htmlTmp;
39832
+ let pre = 'ptm' + index.toString();
39833
+ //var widthPerRes = ic.seqAnnWidth / ic.maxAnnoLength;
39834
+ let prevEmptyWidth = 0;
39835
+ let prevLineWidth = 0;
39836
+ let widthPerRes = 1;
39837
+ for(let i = 0, il = ic.giSeq[chnid].length; i < il; ++i) {
39838
+ html += ic.showSeqCls.insertGap(chnid, i, '-');
39839
+ if(resPosArray.indexOf(i) != -1) {
39840
+ let cFull = ic.giSeq[chnid][i];
39841
+ let c = cFull;
39842
+ if(cFull.length > 1) {
39843
+ c = cFull[0] + '..';
39844
+ }
39845
+ let pos = ic.annoCddSiteCls.getAdjustedResi(i, chnid, ic.matchedPos, ic.chainsSeq, ic.baseResi);
39846
+
39847
+ html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" title="' + c + pos + '" class="icn3d-residue">' + cFull + '</span>';
39848
+ if(me.bNode) {
39849
+ let obj = {};
39850
+ obj[chnid + '_' + pos] = 'PTM: ' + ptm;
39851
+ ic.resid2ptm[chnid].push(obj);
39852
+ }
39853
+
39854
+ html2 += ic.showSeqCls.insertGapOverview(chnid, i);
39855
+ let emptyWidth =(me.cfg.blast_rep_id == chnid) ? Math.round(ic.seqAnnWidth * i /(ic.maxAnnoLength + ic.nTotalGap) - prevEmptyWidth - prevLineWidth) : Math.round(ic.seqAnnWidth * i / ic.maxAnnoLength - prevEmptyWidth - prevLineWidth);
39856
+ //if(emptyWidth < 0) emptyWidth = 0;
39857
+ if(emptyWidth >= 0) {
39858
+ html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
39859
+ html2 += '<div style="display:inline-block; background-color:#000; width:' + widthPerRes + 'px;" title="' + c + pos + '">&nbsp;</div>';
39860
+ prevEmptyWidth += emptyWidth;
39861
+ prevLineWidth += widthPerRes;
39862
+ }
39863
+ }
39864
+ else {
39865
+ html += '<span>-</span>'; //'<span>-</span>';
39866
+ }
39867
+ }
39868
+ htmlTmp = '<span class="icn3d-residueNum" title="residue count">&nbsp;' + resCnt.toString() + ' Residues</span>';
39869
+ htmlTmp += '</span>';
39870
+ htmlTmp += '<br>';
39871
+ html += htmlTmp;
39872
+ html2 += htmlTmp;
39873
+
39874
+ ++index;
39875
+ }
39876
+
39877
+ html += '</div>';
39878
+ html2 += '</div>';
39879
+ html3 += '</div>';
39880
+
39881
+ $("#" + ic.pre + "dt_ptm_" + chnid).html(html);
39882
+ $("#" + ic.pre + "ov_ptm_" + chnid).html(html2);
39883
+ $("#" + ic.pre + "tt_ptm_" + chnid).html(html3);
39884
+
39885
+ // add here after the ajax call
39886
+ ic.showAnnoCls.enableHlSeq();
39887
+ ic.bAjaxPTM = true;
39888
+ }
39889
+
39890
+ getNoPTM(chnid) { let ic = this.icn3d; ic.icn3dui;
39891
+ console.log( "No PTM data were found for the chain " + chnid + "..." );
39892
+
39893
+ $("#" + ic.pre + "dt_ptm_" + chnid).html('');
39894
+ $("#" + ic.pre + "ov_ptm_" + chnid).html('');
39895
+ $("#" + ic.pre + "tt_ptm_" + chnid).html('');
39896
+
39897
+ // add here after the ajax call
39898
+ ic.showAnnoCls.enableHlSeq();
39899
+ ic.bAjaxPTM = true;
39900
+ if(ic.deferredPTM !== undefined) ic.deferredPTM.resolve();
39901
+ }
39902
+ }
39903
+
39522
39904
  /**
39523
39905
  * @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
39524
39906
  */
@@ -40648,11 +41030,11 @@ class AnnoSnpClinVar {
40648
41030
  if(ic.deferredClinvar !== undefined) ic.deferredClinvar.resolve();
40649
41031
  }
40650
41032
  }
40651
- showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
41033
+ showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
40652
41034
  let thisClass = this;
40653
41035
  //var url = "https://www.ncbi.nlm.nih.gov/projects/SNP/beVarSearch_mt.cgi?appname=iCn3D&format=bed&report=pdb2bed&acc=" + chnidBase;
40654
41036
  //var url = "https://www.ncbi.nlm.nih.gov/Structure/icn3d/clinvar.txt";
40655
- let url = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
41037
+ let url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
40656
41038
  if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
40657
41039
  url += "&gene=" + ic.chainsGene[chnid].geneSymbol;
40658
41040
  }
@@ -40687,7 +41069,7 @@ class AnnoSnpClinVar {
40687
41069
  });
40688
41070
  }
40689
41071
 
40690
- showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
41072
+ showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
40691
41073
  let thisClass = this;
40692
41074
  if(gi !== undefined) {
40693
41075
  /*
@@ -40706,7 +41088,7 @@ class AnnoSnpClinVar {
40706
41088
  } //if(data3 != "") {
40707
41089
  else {
40708
41090
  */
40709
- let url4 = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
41091
+ let url4 = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
40710
41092
  if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
40711
41093
  url4 += "&gene=" + ic.chainsGene[chnid].geneSymbol;
40712
41094
  }
@@ -40835,7 +41217,8 @@ class Annotation {
40835
41217
  this.setAnnoSeqBase(false);
40836
41218
  }
40837
41219
  setAnnoSeqBase(bShow) { let ic = this.icn3d; ic.icn3dui;
40838
- let itemArray = ['site', 'snp', 'clinvar', 'cdd', 'domain', 'interaction', 'ssbond', 'crosslink', 'transmem'];
41220
+ //let itemArray = ['site', 'ptm', 'snp', 'clinvar', 'cdd', 'domain', 'interaction', 'ssbond', 'crosslink', 'transmem'];
41221
+ let itemArray = ['cdd', 'clinvar', 'snp', 'site', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'interaction'];
40839
41222
  for(let i in itemArray) {
40840
41223
  let item = itemArray[i];
40841
41224
  if(bShow) {
@@ -40847,7 +41230,8 @@ class Annotation {
40847
41230
  }
40848
41231
  }
40849
41232
  setAnnoTabBase(bChecked) { let ic = this.icn3d; ic.icn3dui;
40850
- let itemArray = ['all', 'binding', 'snp', 'clinvar', 'cdd', '3dd', 'interact', 'custom', 'ssbond', 'crosslink', 'transmem'];
41233
+ //let itemArray = ['all', 'binding', 'ptm', 'snp', 'clinvar', 'cdd', '3dd', 'interact', 'custom', 'ssbond', 'crosslink', 'transmem'];
41234
+ let itemArray = ['all', 'cdd', 'clinvar', 'snp', 'binding', 'ptm', 'ssbond', 'crosslink', 'transmem', '3dd', 'custom', 'interact'];
40851
41235
  for(let i in itemArray) {
40852
41236
  let item = itemArray[i];
40853
41237
  if($("#" + ic.pre + "anno_" + item).length) $("#" + ic.pre + "anno_" + item)[0].checked = bChecked;
@@ -40859,10 +41243,11 @@ class Annotation {
40859
41243
  this.updateClinvar();
40860
41244
  this.updateSnp();
40861
41245
  this.updateDomain();
40862
- this.updateInteraction();
41246
+ this.updatePTM();
40863
41247
  this.updateSsbond();
40864
41248
  this.updateCrosslink();
40865
41249
  this.updateTransmem();
41250
+ this.updateInteraction();
40866
41251
  }
40867
41252
  hideAnnoTabAll() { let ic = this.icn3d; ic.icn3dui;
40868
41253
  this.setAnnoTabBase(false);
@@ -40915,6 +41300,11 @@ class Annotation {
40915
41300
  ic.bInteractionShown = false;
40916
41301
  this.updateInteraction();
40917
41302
  }
41303
+ if($("#" + ic.pre + "anno_ptm").length && $("#" + ic.pre + "anno_ptm")[0].checked) {
41304
+ $("[id^=" + ic.pre + "ptm]").show();
41305
+ ic.bPTMShown = false;
41306
+ this.updatePTM();
41307
+ }
40918
41308
  if($("#" + ic.pre + "anno_custom").length && $("#" + ic.pre + "anno_custom")[0].checked) {
40919
41309
  $("[id^=" + ic.pre + "custom]").show();
40920
41310
  }
@@ -40996,6 +41386,15 @@ class Annotation {
40996
41386
  $("[id^=" + ic.pre + "interaction]").hide();
40997
41387
  if($("#" + ic.pre + "anno_interact").length) $("#" + ic.pre + "anno_interact")[0].checked = false;
40998
41388
  }
41389
+ setAnnoTabPTM() { let ic = this.icn3d; ic.icn3dui;
41390
+ $("[id^=" + ic.pre + "ptm]").show();
41391
+ if($("#" + ic.pre + "anno_ptm").length) $("#" + ic.pre + "anno_ptm")[0].checked = true;
41392
+ this.updatePTM();
41393
+ }
41394
+ hideAnnoTabPTM() { let ic = this.icn3d; ic.icn3dui;
41395
+ $("[id^=" + ic.pre + "ptm]").hide();
41396
+ if($("#" + ic.pre + "anno_ptm").length) $("#" + ic.pre + "anno_ptm")[0].checked = false;
41397
+ }
40999
41398
  setAnnoTabSsbond() { let ic = this.icn3d; ic.icn3dui;
41000
41399
  $("[id^=" + ic.pre + "ssbond]").show();
41001
41400
  if($("#" + ic.pre + "anno_ssbond").length) $("#" + ic.pre + "anno_ssbond")[0].checked = true;
@@ -41107,6 +41506,17 @@ class Annotation {
41107
41506
  }
41108
41507
  });
41109
41508
 
41509
+ me.myEventCls.onIds("#" + ic.pre + "anno_ptm", "click", function(e) {
41510
+ if($("#" + ic.pre + "anno_ptm")[0].checked) {
41511
+ thisClass.setAnnoTabPTM();
41512
+ me.htmlCls.clickMenuCls.setLogCmd("set annotation ptm", true);
41513
+ }
41514
+ else {
41515
+ thisClass.hideAnnoTabPTM();
41516
+ me.htmlCls.clickMenuCls.setLogCmd("hide annotation ptm", true);
41517
+ }
41518
+ });
41519
+
41110
41520
  //$("#" + ic.pre + "anno_custom", "click", function(e) {
41111
41521
  me.myEventCls.onIds("#" + ic.pre + "anno_custom", "click", function(e) {
41112
41522
  if($("#" + ic.pre + "anno_custom")[0].checked) {
@@ -41202,7 +41612,7 @@ class Annotation {
41202
41612
  }
41203
41613
  }
41204
41614
  setAnnoDisplay(display, prefix) { let ic = this.icn3d; ic.icn3dui;
41205
- let itemArray = ['giseq', 'custom', 'site', 'snp', 'clinvar', 'cdd', 'domain', 'interaction', 'ssbond', 'crosslink', 'transmem'];
41615
+ let itemArray = ['giseq', 'custom', 'site', 'ptm', 'snp', 'clinvar', 'cdd', 'domain', 'interaction', 'ssbond', 'crosslink', 'transmem'];
41206
41616
  for(let i in itemArray) {
41207
41617
  let item = itemArray[i];
41208
41618
  $("[id^=" + ic.pre + prefix + "_" + item + "]").attr('style', display);
@@ -41273,6 +41683,15 @@ class Annotation {
41273
41683
  }
41274
41684
  ic.bInteractionShown = true;
41275
41685
  }
41686
+ updatePTM() { let ic = this.icn3d; ic.icn3dui;
41687
+ if(ic.bPTMShown === undefined || !ic.bPTMShown) {
41688
+ for(let chainid in ic.PTMChainbase) {
41689
+ let chainidBase = ic.PTMChainbase[chainid];
41690
+ ic.annoPTMCls.showPTM(chainid, chainidBase);
41691
+ }
41692
+ }
41693
+ ic.bPTMShown = true;
41694
+ }
41276
41695
  updateSsbond() { let ic = this.icn3d; ic.icn3dui;
41277
41696
  if(ic.bSSbondShown === undefined || !ic.bSSbondShown) {
41278
41697
  for(let chainid in ic.ssbondChainbase) {
@@ -43006,9 +43425,12 @@ class Selection {
43006
43425
 
43007
43426
  //Show the selection.
43008
43427
  showSelection() { let ic = this.icn3d, me = ic.icn3dui;
43009
- ic.dAtoms = {};
43428
+ //ic.dAtoms = {};
43010
43429
 
43011
- if(Object.keys(ic.hAtoms).length == 0) this.selectAll_base();
43430
+ if(Object.keys(ic.hAtoms).length == 0) {
43431
+ //this.selectAll_base();
43432
+ ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
43433
+ }
43012
43434
 
43013
43435
  ic.dAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
43014
43436
  ic.viewSelectionAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
@@ -43649,11 +44071,14 @@ class SetStyle {
43649
44071
  console.log("WebGL context was lost. Reset WebGLRenderer and launch iCn3D again.");
43650
44072
 
43651
44073
  ic.renderer = new THREE.WebGLRenderer({
43652
- canvas: ic.container.get(0),
43653
- antialias: true,
43654
- preserveDrawingBuffer: true,
43655
- alpha: true
44074
+ canvas: ic.oriContainer.get(0), //this.container.get(0),
44075
+ antialias: true,
44076
+ preserveDrawingBuffer: true,
44077
+ sortObjects: false,
44078
+ alpha: true
43656
44079
  });
44080
+ // Enable VR
44081
+ ic.renderer.xr.enabled = true;
43657
44082
 
43658
44083
  ic.drawCls.draw();
43659
44084
 
@@ -44862,7 +45287,8 @@ class ApplySymd {
44862
45287
  }
44863
45288
  else { // bSymd, subset, and one chain
44864
45289
  if(Object.keys(ic.hAtoms).length == 0) {
44865
- ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
45290
+ //ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
45291
+ ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
44866
45292
  }
44867
45293
 
44868
45294
  // pick the first 1/order of selection
@@ -45512,7 +45938,8 @@ class VRButton {
45512
45938
  button.style.display = '';
45513
45939
 
45514
45940
  button.style.cursor = 'pointer';
45515
- button.style.left = 'calc(50% - 50px)';
45941
+ //button.style.left = 'calc(50% - 50px)';
45942
+ button.style.left = 'calc(33% - 50px)';
45516
45943
  button.style.width = '100px';
45517
45944
 
45518
45945
  button.textContent = 'ENTER VR';
@@ -45566,7 +45993,7 @@ class VRButton {
45566
45993
  button.style.display = '';
45567
45994
 
45568
45995
  button.style.cursor = 'auto';
45569
- button.style.left = 'calc(50% - 75px)';
45996
+ button.style.left = 'calc(33% - 75px)'; //'calc(50% - 75px)';
45570
45997
  button.style.width = '150px';
45571
45998
 
45572
45999
  button.onmouseenter = null;
@@ -45759,7 +46186,8 @@ class ARButton {
45759
46186
  button.style.display = '';
45760
46187
 
45761
46188
  button.style.cursor = 'pointer';
45762
- button.style.left = 'calc(50% - 50px)';
46189
+ //button.style.left = 'calc(50% - 50px)';
46190
+ button.style.left = 'calc(66% - 50px)';
45763
46191
  button.style.width = '100px';
45764
46192
 
45765
46193
  button.textContent = 'START AR';
@@ -45807,7 +46235,7 @@ class ARButton {
45807
46235
  button.style.display = '';
45808
46236
 
45809
46237
  button.style.cursor = 'auto';
45810
- button.style.left = 'calc(50% - 75px)';
46238
+ button.style.left = 'calc(66% - 50px)'; //'calc(50% - 75px)';
45811
46239
  button.style.width = '150px';
45812
46240
 
45813
46241
  button.onmouseenter = null;
@@ -45904,7 +46332,7 @@ class ARButton {
45904
46332
 
45905
46333
  }
45906
46334
 
45907
- message.style.left = 'calc(50% - 90px)';
46335
+ message.style.left = 'calc(66% - 90px)'; //'calc(50% - 90px)';
45908
46336
  message.style.width = '180px';
45909
46337
  message.style.textDecoration = 'none';
45910
46338
 
@@ -54286,9 +54714,17 @@ class ClickMenu {
54286
54714
  // },
54287
54715
  // clkMn1_chainalign: function() {
54288
54716
  me.myEventCls.onIds("#" + me.pre + "mn1_chainalign", "click", function(e) { me.icn3d;
54289
- me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains of 3D structures');
54717
+ me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains by structure alignment');
54290
54718
  });
54291
54719
 
54720
+ me.myEventCls.onIds("#" + me.pre + "mn1_chainalign2", "click", function(e) { me.icn3d;
54721
+ me.htmlCls.dialogCls.openDlg('dl_chainalign2', 'Align multiple chains by sequence alignment');
54722
+ });
54723
+
54724
+ me.myEventCls.onIds("#" + me.pre + "mn1_chainalign3", "click", function(e) { me.icn3d;
54725
+ me.htmlCls.dialogCls.openDlg('dl_chainalign3', 'Align multiple chains residue by residue');
54726
+ });
54727
+
54292
54728
  me.myEventCls.onIds("#" + me.pre + "mn1_mutation", "click", function(e) { me.icn3d;
54293
54729
  me.htmlCls.dialogCls.openDlg('dl_mutation', 'Show the mutations in 3D');
54294
54730
  });
@@ -54467,6 +54903,12 @@ class ClickMenu {
54467
54903
  thisClass.setLogCmd("export pqr", true);
54468
54904
  });
54469
54905
 
54906
+ me.myEventCls.onIds(["#" + me.pre + "delphipdbh", "#" + me.pre + "phipqr", "#" + me.pre + "phiurlpqr"], "click", function(e) { me.icn3d;
54907
+ let bPdb = true;
54908
+ me.htmlCls.setHtmlCls.exportPqr(bPdb);
54909
+ thisClass.setLogCmd("export pdbh", false);
54910
+ });
54911
+
54470
54912
  // clkMn1_exportStl: function() {
54471
54913
  me.myEventCls.onIds("#" + me.pre + "mn1_exportStl", "click", function(e) { let ic = me.icn3d;
54472
54914
  thisClass.setLogCmd("export stl file", false);
@@ -56834,11 +57276,12 @@ class SetMenu {
56834
57276
 
56835
57277
  html += "<li><span>Retrieve by ID</span>";
56836
57278
  html += "<ul>";
57279
+
57280
+ html += me.htmlCls.setHtmlCls.getLink('mn1_mmdbafid', 'PDB/MMDB/AlphaFold IDs' + me.htmlCls.wifiStr);
56837
57281
  html += me.htmlCls.setHtmlCls.getLink('mn1_mmdbid', 'MMDB ID ' + me.htmlCls.wifiStr);
56838
57282
  html += me.htmlCls.setHtmlCls.getLink('mn1_mmtfid', 'MMTF ID ' + me.htmlCls.wifiStr);
56839
57283
  html += me.htmlCls.setHtmlCls.getLink('mn1_pdbid', 'PDB ID ' + me.htmlCls.wifiStr);
56840
57284
  html += me.htmlCls.setHtmlCls.getLink('mn1_afid', 'AlphaFold UniProt ID ' + me.htmlCls.wifiStr);
56841
- html += me.htmlCls.setHtmlCls.getLink('mn1_mmdbafid', 'MMDB or AlphaFold IDs' + me.htmlCls.wifiStr);
56842
57285
  if(!me.cfg.simplemenu) {
56843
57286
  html += me.htmlCls.setHtmlCls.getLink('mn1_opmid', 'OPM PDB ID ' + me.htmlCls.wifiStr);
56844
57287
  html += me.htmlCls.setHtmlCls.getLink('mn1_mmcifid', 'mmCIF ID ' + me.htmlCls.wifiStr);
@@ -56881,15 +57324,22 @@ class SetMenu {
56881
57324
  html += "</li>";
56882
57325
  html += "<li><span>Align</span>";
56883
57326
  html += "<ul>";
56884
- html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
56885
- //html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Structure to Structure ' + me.htmlCls.wifiStr);
57327
+
57328
+ html += "<li><span>Multiple Chains</span>";
57329
+ html += "<ul>";
57330
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign', 'by Structure Alignment ' + me.htmlCls.wifiStr);
57331
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign2', 'by Sequence Alignment ' + me.htmlCls.wifiStr);
57332
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign3', 'Residue by Residue');
57333
+ html += "</ul>";
57334
+ html += "</li>";
57335
+
56886
57336
  html += "<li><span>Structure to Structure</span>";
56887
57337
  html += "<ul>";
56888
57338
  html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Two PDB Structures ' + me.htmlCls.wifiStr);
56889
57339
  html += me.htmlCls.setHtmlCls.getLink('mn1_alignaf', 'Two AlphaFold Structures ' + me.htmlCls.wifiStr);
56890
57340
  html += "</ul>";
56891
57341
 
56892
- html += me.htmlCls.setHtmlCls.getLink('mn1_chainalign', 'Multiple Chains ' + me.htmlCls.wifiStr);
57342
+ html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
56893
57343
 
56894
57344
  html += "</ul>";
56895
57345
  html += "</li>";
@@ -56933,7 +57383,7 @@ class SetMenu {
56933
57383
  html += "</ul>";
56934
57384
  html += "</li>";
56935
57385
 
56936
- html += "<li><span>Save Files</span>";
57386
+ html += "<li><span>Save File</span>";
56937
57387
  html += "<ul>";
56938
57388
  //html += me.htmlCls.setHtmlCls.getLink('mn1_exportCanvas', 'iCn3D PNG Image');
56939
57389
 
@@ -56965,6 +57415,7 @@ class SetMenu {
56965
57415
  */
56966
57416
 
56967
57417
  html += me.htmlCls.setHtmlCls.getLink('mn1_exportPdbRes', 'PDB');
57418
+ html += me.htmlCls.setHtmlCls.getLink('delphipdbh', 'PDB with Hydrogens');
56968
57419
 
56969
57420
  if(me.cfg.cid === undefined) {
56970
57421
  html += me.htmlCls.setHtmlCls.getLink('mn1_exportSecondary', 'Secondary Structure');
@@ -57538,7 +57989,7 @@ class SetMenu {
57538
57989
 
57539
57990
  html += "<ul class='icn3d-mn-item'>";
57540
57991
 
57541
- html += "<li><span style='padding-left:1.5em;'>Unicolor</span>";
57992
+ html += "<li><span style='padding-left:1.5em!important;'>Unicolor</span>";
57542
57993
  html += "<ul>";
57543
57994
 
57544
57995
  html += "<li><span>Red</span>";
@@ -57745,7 +58196,7 @@ class SetMenu {
57745
58196
 
57746
58197
  if(me.cfg.cid === undefined) {
57747
58198
  //html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrRainbow', 'Rainbow (R-V)');
57748
- html += "<li><span style='padding-left:1.5em;'>Rainbow (R-V)</span>";
58199
+ html += "<li><span style='padding-left:1.5em!important;'>Rainbow (R-V)</span>";
57749
58200
  html += "<ul>";
57750
58201
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrRainbow', 'for Selection');
57751
58202
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrRainbowChain', 'for Chains');
@@ -57754,7 +58205,7 @@ class SetMenu {
57754
58205
 
57755
58206
  if(!me.cfg.simplemenu) {
57756
58207
  //html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSpectrum', 'Spectrum (V-R)');
57757
- html += "<li><span style='padding-left:1.5em;'>Spectrum (V-R)</span>";
58208
+ html += "<li><span style='padding-left:1.5em!important;'>Spectrum (V-R)</span>";
57758
58209
  html += "<ul>";
57759
58210
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSpectrum', 'for Selection');
57760
58211
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSpectrumChain', 'for Chains');
@@ -57762,7 +58213,7 @@ class SetMenu {
57762
58213
  html += "</ul>";
57763
58214
  }
57764
58215
 
57765
- html += "<li><span style='padding-left:1.5em;'>Secondary</span>";
58216
+ html += "<li><span style='padding-left:1.5em!important;'>Secondary</span>";
57766
58217
  html += "<ul>";
57767
58218
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSSGreen', 'Sheet in Green');
57768
58219
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSSYellow', 'Sheet in Yellow');
@@ -57777,13 +58228,13 @@ class SetMenu {
57777
58228
 
57778
58229
  //html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrHydrophobic', 'Wimley-White<br><span style="padding-left:1.5em;">Hydrophobicity</span>');
57779
58230
 
57780
- html += "<li><span style='padding-left:1.5em;'>Hydrophobicity</span>";
58231
+ html += "<li><span style='padding-left:1.5em!important;'>Hydrophobicity</span>";
57781
58232
  html += "<ul>";
57782
58233
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrNormalizedHP', 'Normalized');
57783
58234
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrHydrophobic', 'Wimley-White');
57784
58235
  html += "</ul>";
57785
58236
 
57786
- html += "<li><span style='padding-left:1.5em;'>B-factor</span>";
58237
+ html += "<li><span style='padding-left:1.5em!important;'>B-factor</span>";
57787
58238
  html += "<ul>";
57788
58239
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrBfactor', 'Original');
57789
58240
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrBfactorNorm', 'Percentile');
@@ -57806,7 +58257,7 @@ class SetMenu {
57806
58257
 
57807
58258
  if(me.cfg.cid === undefined) {
57808
58259
  if(!me.cfg.simplemenu) {
57809
- html += "<li><span style='padding-left:1.5em;'>Defined Sets</span>";
58260
+ html += "<li><span style='padding-left:1.5em!important;'>Defined Sets</span>";
57810
58261
  html += "<ul>";
57811
58262
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrsets', 'Rainbow for Selected Sets<br>in "Analysis > Defined Sets"');
57812
58263
  html += "</ul>";
@@ -57815,7 +58266,7 @@ class SetMenu {
57815
58266
 
57816
58267
  //html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrResidue', 'Residue');
57817
58268
 
57818
- html += "<li><span style='padding-left:1.5em;'>Residue</span>";
58269
+ html += "<li><span style='padding-left:1.5em!important;'>Residue</span>";
57819
58270
  html += "<ul>";
57820
58271
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrResidue', 'Default');
57821
58272
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrResidueCustom', 'Custom');
@@ -58119,17 +58570,29 @@ class SetMenu {
58119
58570
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#about' target='_blank'>About iCn3D<span style='font-size:0.9em'> " + me.REVISION + "</span></a></li>";
58120
58571
 
58121
58572
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#gallery' target='_blank'>Live Gallery " + me.htmlCls.wifiStr + "</a></li>";
58573
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#videos' target='_blank'>iCn3D Videos</a></li>";
58574
+
58575
+ html += "<li><span>FAQ</span>";
58122
58576
 
58123
- html += "<li><span>Tutorial</span>";
58124
58577
  html += "<ul>";
58125
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#useicn3d' target='_blank'>Use iCn3D</a></li>";
58126
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#videos' target='_blank'>iCn3D Videos</a></li>";
58127
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#parameters' target='_blank'>URL Parameters</a></li>";
58128
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#commands' target='_blank'>Commands</a></li>";
58578
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#viewstru' target='_blank'><span>View structure</span></a></li>";
58579
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#tfstru' target='_blank'><span>Transform Structure</span></a></li>";
58580
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#selsubset' target='_blank'><span>Select Subsets</span></a></li>";
58581
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#changestylecolor' target='_blank'><span>Change Style/Color</span></a></li>";
58582
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#saveview' target='_blank'><span>Save Work</span></a></li>";
58583
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#showanno' target='_blank'><span>Show Annotations</span></a></li>";
58584
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#exportanno' target='_blank'><span>Export Annotations</span></a></li>";
58585
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#interanalysis' target='_blank'><span>Interactions Analysis</span></a></li>";
58586
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#mutationanalysis' target='_blank'><span>Mutation Analysis</span></a></li>";
58587
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#elecpot' target='_blank'><span>Electrostatic Pot.</span></a></li>";
58588
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#simivast' target='_blank'><span>Similar PDB</span></a></li>";
58589
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#simifoldseek' target='_blank'><span>Similar AlphaFold/PDB</span></a></li>";
58590
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#alignmul' target='_blank'><span>Align Multiple Structures</span></a></li>";
58591
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#batchanalysis' target='_blank'><span>Batch Analysis</span></a></li>";
58592
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#embedicn3d' target='_blank'><span>Embed iCn3D</span></a></li>";
58129
58593
  html += "</ul>";
58130
- html += "</li>";
58131
58594
 
58132
- html += liStr + "https://www.ncbi.nlm.nih.gov/structure' target='_blank'>Search Structure " + me.htmlCls.wifiStr + "</a></li>";
58595
+ //html += liStr + "https://www.ncbi.nlm.nih.gov/structure' target='_blank'>Search Structure " + me.htmlCls.wifiStr + "</a></li>";
58133
58596
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#citing' target='_blank'>Citing iCn3D</a></li>";
58134
58597
 
58135
58598
  html += "<li><span>Source Code</span>";
@@ -58143,7 +58606,10 @@ class SetMenu {
58143
58606
  if(!me.cfg.simplemenu) {
58144
58607
  html += "<li><span>Develop</span>";
58145
58608
  html += "<ul>";
58146
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#HowToUse' target='_blank'>How to Embed</a></li>";
58609
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#HowToUse' target='_blank'>Embed iCn3D</a></li>";
58610
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#parameters' target='_blank'>URL Parameters</a></li>";
58611
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#commands' target='_blank'>Commands</a></li>";
58612
+
58147
58613
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#datastructure' target='_blank'>Data Structure</a></li>";
58148
58614
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#classstructure' target='_blank'>Class Structure</a></li>";
58149
58615
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#addclass' target='_blank'>Add New Classes</a></li>";
@@ -58911,8 +59377,8 @@ class SetDialog {
58911
59377
  html += "</div>";
58912
59378
 
58913
59379
  html += me.htmlCls.divStr + "dl_foldseek' class='" + dialogClass + "' style='max-width:500px'>";
58914
- html += 'Note: You can search similar PDB or AlphaFold structures for any structure at the fast <a href="https://search.foldseek.com/search" target="_blank">Foldseek</a> web server. <br><br>Once you see the structure neighbors, you can view the alignment in iCn3D by inputing a list of chain IDs below. <br><br>The PDB chain IDs are the same as the record names such as "1hho_A". The AlphaFold chain IDs are the UniProt ID plus "_A". For example, the UniProt ID for the record name "AF-P69905-F1-model_v2" is "P69905".<br><br>';
58915
- html += "Chain ID List: " + me.htmlCls.inputTextStr + "id='" + me.pre + "foldseekchainids' value='P69905_A,P01942_A,1HHO_A' size=30> ";
59380
+ html += 'Note: You can search similar PDB or AlphaFold structures for any structure at the fast <a href="https://search.foldseek.com/search" target="_blank">Foldseek</a> web server. <br><br>Once you see the structure neighbors, you can view the alignment in iCn3D by inputing a list of PDB chain IDs or AlphaFold UniProt IDs below. <br><br>The PDB chain IDs are the same as the record names such as "1hho_A". The UniProt ID is the text between "AF-" and "-F1". For example, the UniProt ID for the record name "AF-P69905-F1-model_v3" is "P69905".<br><br>';
59381
+ html += "Chain ID List: " + me.htmlCls.inputTextStr + "id='" + me.pre + "foldseekchainids' value='P69905,P01942,1hho_A' size=30> ";
58916
59382
  html += me.htmlCls.buttonStr + "reload_foldseek'>Align</button>";
58917
59383
  html += "</div>";
58918
59384
 
@@ -59002,25 +59468,51 @@ class SetDialog {
59002
59468
  html += "<div style='width:550px'>";
59003
59469
  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/>";
59004
59470
  html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
59005
- html += "<b>Optional 1</b>, full chains are used for structure alignment<br/><br/>";
59006
- 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/>";
59007
- 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/>";
59008
- //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/>";
59009
- 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/>";
59471
+ 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/>";
59472
+
59473
+ 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>";
59474
+ html += "</div></div>";
59475
+
59476
+ html += me.htmlCls.divStr + "dl_chainalign2' class='" + dialogClass + "'>";
59477
+ html += "<div style='width:550px'>";
59478
+ 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/>";
59479
+ html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids2' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
59480
+
59481
+ 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/>";
59482
+ html += me.htmlCls.buttonStr + "reload_chainalign_asym2' style='margin-top:3px;'><b>Align by Sequence Alignment</b></button><br/><br/>";
59483
+
59484
+ 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>";
59485
+ html += "</div></div>";
59486
+
59487
+ html += me.htmlCls.divStr + "dl_chainalign3' class='" + dialogClass + "'>";
59488
+ html += "<div style='width:550px'>";
59489
+ 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/>";
59490
+ html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids3' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
59491
+
59492
+ 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/>";
59493
+ html += me.htmlCls.buttonStr + "reload_chainalign_asym3'><b>Align Residue by Residue</b></button><br/><br/>";
59010
59494
 
59011
59495
  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>";
59012
59496
  html += "</div></div>";
59013
59497
 
59014
59498
  html += me.htmlCls.divStr + "dl_mutation' class='" + dialogClass + "'>";
59015
59499
  html += "<div style='width:500px'>";
59016
- 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/>';
59500
+ 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/>';
59017
59501
  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/>";
59018
59502
 
59019
- html += "<b>Data Source</b>: <select id='" + me.pre + "idsource'>";
59020
- html += "<option value='mmdbid' selected>PDB ID</option>";
59021
- html += "<option value='afid'>AlphaFold UniProt ID</option>";
59022
- html += "</select><br/><br/>";
59023
-
59503
+ // html += "<b>Data Source</b>: <select id='" + me.pre + "idsource'>";
59504
+ // html += "<option value='mmdbid' selected>PDB ID</option>";
59505
+ // html += "<option value='afid'>AlphaFold UniProt ID</option>";
59506
+ // html += "</select><br/><br/>";
59507
+
59508
+ html += '<b>ID Type</b>: ';
59509
+ html += '<input type="radio" name="' + me.pre + 'idsource" id="' + me.pre + 'type_mmdbid" value="mmdbid" checked>PDB ID';
59510
+ html += '<input type="radio" name="' + me.pre + 'idsource" id="' + me.pre + 'type_afid" value="afid" style="margin-left:20px">AlphaFold UniProt ID<br><br>';
59511
+
59512
+ html += '<b>Show Mutation in</b>: ';
59513
+ html += '<input type="radio" name="' + me.pre + 'pdbsource" id="' + me.pre + 'showin_currentpage" value="currentpage">Current Page';
59514
+ html += '<input type="radio" name="' + me.pre + 'pdbsource" id="' + me.pre + 'showin_newpage" value="newpage" style="margin-left:20px" checked>New Page<br><br>';
59515
+
59024
59516
  html += me.htmlCls.buttonStr + "reload_mutation_3d' title='Show the mutations in 3D using the scap program'>3D with scap</button>";
59025
59517
  html += me.htmlCls.buttonStr + "reload_mutation_inter' style='margin-left:20px' title='Show the mutations in 3D and the change of interactions'>Interactions</button>";
59026
59518
  html += me.htmlCls.buttonStr + "reload_mutation_pdb' style='margin-left:20px' title='Show the mutations in 3D and export the PDB of the mutant within 10 angstrom'>PDB</button>";
@@ -59104,7 +59596,7 @@ class SetDialog {
59104
59596
  html += "</div>";
59105
59597
 
59106
59598
  html += me.htmlCls.divStr + "dl_yournote' class='" + dialogClass + "'>";
59107
- html += "Your note will be saved in the HTML file when you click \"File > Save Files > iCn3D PNG Image\".<br><br>";
59599
+ html += "Your note will be saved in the HTML file when you click \"File > Save File > iCn3D PNG Image\".<br><br>";
59108
59600
  html += "<textarea id='" + me.pre + "yournote' rows='5' style='width: 100%; height: " +(me.htmlCls.LOG_HEIGHT) + "px; padding: 0px; border: 0px;' placeholder='Enter your note here'></textarea><br>";
59109
59601
  html += me.htmlCls.buttonStr + "applyyournote'>Save</button>";
59110
59602
  html += "</div>";
@@ -59859,10 +60351,17 @@ class SetDialog {
59859
60351
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_custom'>Custom" + me.htmlCls.space2 + "</span></td>";
59860
60352
  html += tmpStr2 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_3dd'>3D Domains" + me.htmlCls.space2 + "</span></td>";
59861
60353
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_snp'>SNPs" + me.htmlCls.space2 + "</span></td>";
59862
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_interact'>Interactions" + me.htmlCls.space2 + "</span></td>";
60354
+
60355
+ // if(me.cfg.mmdbid != undefined || me.cfg.pdbid != undefined || me.cfg.mmtfid != undefined || me.cfg.mmcifid != undefined) { // PDB
60356
+ // html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ptm' disabled>PTM (UniProt)" + me.htmlCls.space2 + "</span></td>";
60357
+ // }
60358
+ // else {
60359
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ptm'>PTM (UniProt)" + me.htmlCls.space2 + "</span></td>";
60360
+ // }
59863
60361
  html += "<td></td>";
59864
60362
  html += "</tr><tr>";
59865
60363
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ssbond'>Disulfide Bonds" + me.htmlCls.space2 + "</span></td>";
60364
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_interact'>Interactions" + me.htmlCls.space2 + "</span></td>";
59866
60365
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_crosslink'>Cross-Linkages" + me.htmlCls.space2 + "</span></td>";
59867
60366
  if(me.cfg.opmid !== undefined) {
59868
60367
  html += "<td style='min-width:110px;'><span id='" + me.pre + "anno_transmemli' style='white-space:nowrap'>" + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_transmem'>Transmembrane" + me.htmlCls.space2 + "</span></td>";
@@ -59901,6 +60400,17 @@ class Events {
59901
60400
  }
59902
60401
  }
59903
60402
 
60403
+ convertUniProtInChains(alignment) { let me = this.icn3dui; me.icn3d;
60404
+ let idArray = alignment.split(',');
60405
+ let alignment_final = '';
60406
+ for(let i = 0, il = idArray.length; i < il; ++i) {
60407
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
60408
+ if(i < il - 1) alignment_final += ',';
60409
+ }
60410
+
60411
+ return alignment_final;
60412
+ }
60413
+
59904
60414
  searchSeq() { let me = this.icn3dui, ic = me.icn3d;
59905
60415
  let select = $("#" + me.pre + "search_seq").val();
59906
60416
  if(isNaN(select) && select.indexOf('$') == -1 && select.indexOf('.') == -1 && select.indexOf(':') == -1 && select.indexOf('@') == -1) {
@@ -59997,7 +60507,7 @@ class Events {
59997
60507
 
59998
60508
  saveHtml(id) { let me = this.icn3dui, ic = me.icn3d;
59999
60509
  let html = '';
60000
- html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/lib/jquery-ui-1.12.1.min.css">\n';
60510
+ html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/lib/jquery-ui-1.13.2.min.css">\n';
60001
60511
  html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/icn3d_full_ui.css">\n';
60002
60512
  html += $("#" + id).html();
60003
60513
  let idArray = id.split('_');
@@ -60007,24 +60517,6 @@ class Events {
60007
60517
  ic.saveFileCls.saveFile(structureStr + '-' + idStr + '.html', 'html', encodeURIComponent(html));
60008
60518
  }
60009
60519
 
60010
- getAlignParas() { let me = this.icn3dui; me.icn3d;
60011
- let alignment = $("#" + me.pre + "chainalignids").val();
60012
- let idArray = alignment.split(',');
60013
- let alignment_final = '';
60014
- for(let i = 0, il = idArray.length; i < il; ++i) {
60015
- alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
60016
- if(i < il - 1) alignment_final += ',';
60017
- }
60018
- let resalign = $("#" + me.pre + "resalignids").val();
60019
- let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
60020
- if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
60021
- alert("Please make sure the number of chains and the lines of predefined residues are the same...");
60022
- return;
60023
- }
60024
-
60025
- return {"alignment": alignment_final, "resalign": resalign, "predefinedres": predefinedres};
60026
- }
60027
-
60028
60520
  //Hold all functions related to click events.
60029
60521
  allEventFunctions() { let me = this.icn3dui, ic = me.icn3d;
60030
60522
  let thisClass = this;
@@ -60181,6 +60673,8 @@ class Events {
60181
60673
  // },
60182
60674
  // clickRealignonseqalign: function() {
60183
60675
  me.myEventCls.onIds("#" + me.pre + "mn2_realignonseqalign", "click", function(e) { let ic = me.icn3d;
60676
+ if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
60677
+
60184
60678
  if(Object.keys(ic.structures).length < 2) {
60185
60679
  alert("At least two structuresare required for alignment...");
60186
60680
  return;
@@ -60196,15 +60690,14 @@ class Events {
60196
60690
  if($("#" + me.pre + "atomsCustomRealign").length) {
60197
60691
  $("#" + me.pre + "atomsCustomRealign").html(definedAtomsHtml);
60198
60692
  }
60199
- //if($("#" + me.pre + "atomsCustomRealign2").length) {
60200
- // $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
60201
- //}
60202
- if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
60693
+
60203
60694
  $("#" + me.pre + "atomsCustomRealign").resizable();
60204
60695
  //$("#" + me.pre + "atomsCustomRealign2").resizable();
60205
60696
  });
60206
60697
 
60207
60698
  me.myEventCls.onIds("#" + me.pre + "mn2_realignonstruct", "click", function(e) { let ic = me.icn3d;
60699
+ if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
60700
+
60208
60701
  if(Object.keys(ic.structures).length < 2) {
60209
60702
  alert("At least two structuresare required for alignment...");
60210
60703
  return;
@@ -60219,10 +60712,7 @@ class Events {
60219
60712
  if($("#" + me.pre + "atomsCustomRealignByStruct").length) {
60220
60713
  $("#" + me.pre + "atomsCustomRealignByStruct").html(definedAtomsHtml);
60221
60714
  }
60222
- //if($("#" + me.pre + "atomsCustomRealign2").length) {
60223
- // $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
60224
- //}
60225
- if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
60715
+
60226
60716
  $("#" + me.pre + "atomsCustomRealignByStruct").resizable();
60227
60717
  //$("#" + me.pre + "atomsCustomRealign2").resizable();
60228
60718
  });
@@ -60259,10 +60749,7 @@ class Events {
60259
60749
  ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
60260
60750
  }
60261
60751
 
60262
- // save the current selection
60263
- //ic.selectionCls.saveSelectionPrep();
60264
- //let name = 'realignSetsByStruct';
60265
- //ic.selectionCls.saveSelection(name, name);
60752
+ me.cfg.aligntool = 'vast';
60266
60753
 
60267
60754
  ic.realignParserCls.realignOnStructAlign();
60268
60755
  if(nameArray.length > 0) {
@@ -60394,8 +60881,16 @@ class Events {
60394
60881
  me.myEventCls.onIds("#" + me.pre + "reload_foldseek", "click", function(e) { me.icn3d;
60395
60882
  e.preventDefault();
60396
60883
  if(!me.cfg.notebook) dialog.dialog( "close" );
60397
- me.htmlCls.clickMenuCls.setLogCmd("load chainalignment " + $("#" + me.pre + "foldseekchainids").val(), true);
60398
- window.open(hostUrl + '?chainalign=' + $("#" + me.pre + "foldseekchainids").val(), '_self');
60884
+
60885
+ // me.htmlCls.clickMenuCls.setLogCmd("load chainalignment " + $("#" + me.pre + "foldseekchainids").val(), true);
60886
+ // window.open(hostUrl + '?chainalign=' + $("#" + me.pre + "foldseekchainids").val(), '_self');
60887
+
60888
+
60889
+ let alignment = $("#" + me.pre + "foldseekchainids").val();
60890
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
60891
+
60892
+ me.htmlCls.clickMenuCls.setLogCmd("load chainalignment " + alignment_final, true);
60893
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&aligntool=tmalign&showalignseq=1&bu=0', '_self');
60399
60894
  });
60400
60895
 
60401
60896
  me.myEventCls.onIds("#" + me.pre + "reload_mmtf", "click", function(e) { me.icn3d;
@@ -60531,85 +61026,197 @@ class Events {
60531
61026
  });
60532
61027
  // },
60533
61028
  // clickReload_chainalign: function() {
60534
- me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { me.icn3d;
61029
+ /*
61030
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { let ic = me.icn3d;
60535
61031
  e.preventDefault();
60536
61032
  if(!me.cfg.notebook) dialog.dialog( "close" );
60537
61033
 
60538
- let result = thisClass.getAlignParas();
61034
+ let alignment = $("#" + me.pre + "chainalignids").val();
61035
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
61036
+ let resalign = $("#" + me.pre + "resalignids").val();
61037
+ let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
61038
+ if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
61039
+ alert("Please make sure the number of chains and the lines of predefined residues are the same...");
61040
+ return;
61041
+ }
60539
61042
 
60540
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " | residues " + result.resalign + " | resdef " + result.predefinedres, false);
60541
- window.open(hostUrl + '?chainalign=' + result.alignment + '&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1', '_blank');
61043
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " | residues " + resalign + " | resdef " + predefinedres, false);
61044
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1', '_blank');
60542
61045
  });
61046
+ */
60543
61047
 
60544
61048
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym", "click", function(e) { me.icn3d;
60545
61049
  e.preventDefault();
60546
61050
  if(!me.cfg.notebook) dialog.dialog( "close" );
60547
61051
 
60548
- let result = thisClass.getAlignParas();
61052
+ let alignment = $("#" + me.pre + "chainalignids").val();
61053
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
60549
61054
 
60550
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " on asymmetric unit | residues " + result.resalign + " | resdef " + result.predefinedres, false);
60551
- window.open(hostUrl + '?chainalign=' + result.alignment + '&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1&bu=0', '_blank');
61055
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef ", false);
61056
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=&resdef=&showalignseq=1&bu=0', '_blank');
60552
61057
  });
60553
61058
 
61059
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym2", "click", function(e) { me.icn3d;
61060
+ e.preventDefault();
61061
+ if(!me.cfg.notebook) dialog.dialog( "close" );
61062
+
61063
+ let alignment = $("#" + me.pre + "chainalignids2").val();
61064
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
61065
+ let resalign = $("#" + me.pre + "resalignids").val();
61066
+
61067
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues " + resalign + " | resdef ", false);
61068
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=&showalignseq=1&bu=0', '_blank');
61069
+ });
61070
+
61071
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym3", "click", function(e) { me.icn3d;
61072
+ e.preventDefault();
61073
+ if(!me.cfg.notebook) dialog.dialog( "close" );
61074
+
61075
+ let alignment = $("#" + me.pre + "chainalignids3").val();
61076
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
61077
+
61078
+ let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
61079
+ if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
61080
+ alert("Please make sure the number of chains and the lines of predefined residues are the same...");
61081
+ return;
61082
+ }
61083
+
61084
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef " + predefinedres, false);
61085
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=&resdef=' + predefinedres + '&showalignseq=1&bu=0', '_blank');
61086
+ });
61087
+
60554
61088
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign_tmalign", "click", function(e) { me.icn3d;
60555
61089
  e.preventDefault();
60556
61090
  if(!me.cfg.notebook) dialog.dialog( "close" );
60557
61091
 
60558
- let result = thisClass.getAlignParas();
61092
+ let alignment = $("#" + me.pre + "chainalignids").val();
61093
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
60559
61094
 
60560
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " on asymmetric unit | residues " + result.resalign + " | resdef " + result.predefinedres + " | align tmalign", false);
60561
- window.open(hostUrl + '?chainalign=' + result.alignment + '&aligntool=tmalign&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1&bu=0', '_blank');
61095
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef | align tmalign", false);
61096
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&aligntool=tmalign&resnum=&resdef=&showalignseq=1&bu=0', '_blank');
60562
61097
  });
60563
61098
 
60564
- me.myEventCls.onIds("#" + me.pre + "reload_mutation_3d", "click", function(e) { me.icn3d;
61099
+ me.myEventCls.onIds("#" + me.pre + "reload_mutation_3d", "click", function(e) { let ic = me.icn3d;
60565
61100
  e.preventDefault();
60566
61101
  if(!me.cfg.notebook) dialog.dialog( "close" );
60567
61102
  let mutationids = $("#" + me.pre + "mutationids").val();
60568
- let idsource = $("#" + me.pre + "idsource").val();
60569
- let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
60570
- me.htmlCls.clickMenuCls.setLogCmd("3d of mutation " + mutationids, false);
60571
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?mmdbid=' + mmdbid + '&command=scap 3d ' + mutationids + '; select displayed set', '_blank');
60572
- window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap 3d ' + mutationids + '; select displayed set', '_blank');
61103
+ //let idsource = $("#" + me.pre + "idsource").val();
61104
+ let idsource, pdbsource;
61105
+ if($("#" + me.pre + "type_mmdbid").is(":checked")) {
61106
+ idsource = 'mmdbid';
61107
+ }
61108
+ else {
61109
+ idsource = 'afid';
61110
+ }
61111
+ if($("#" + me.pre + "showin_currentpage").is(":checked")) {
61112
+ pdbsource = 'currentpage';
61113
+ }
61114
+ else {
61115
+ pdbsource = 'newpage';
61116
+ }
61117
+
61118
+ if(pdbsource == 'currentpage') {
61119
+ let snp = mutationids;
61120
+
61121
+ ic.scapCls.retrieveScap(snp);
61122
+ me.htmlCls.clickMenuCls.setLogCmd('scap 3d ' + snp, true);
61123
+ me.htmlCls.clickMenuCls.setLogCmd("select displayed set", true);
61124
+ }
61125
+ else {
61126
+ let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
61127
+ me.htmlCls.clickMenuCls.setLogCmd("3d of mutation " + mutationids, false);
61128
+ window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap 3d ' + mutationids + '; select displayed set', '_blank');
61129
+ }
60573
61130
  });
60574
61131
 
60575
- me.myEventCls.onIds("#" + me.pre + "reload_mutation_pdb", "click", function(e) { me.icn3d;
61132
+ me.myEventCls.onIds("#" + me.pre + "reload_mutation_pdb", "click", function(e) { let ic = me.icn3d;
60576
61133
  e.preventDefault();
60577
61134
  if(!me.cfg.notebook) dialog.dialog( "close" );
60578
61135
  let mutationids = $("#" + me.pre + "mutationids").val();
60579
- let idsource = $("#" + me.pre + "idsource").val();
60580
- let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
60581
- me.htmlCls.clickMenuCls.setLogCmd("pdb of mutation " + mutationids, false);
60582
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?mmdbid=' + mmdbid + '&command=scap pdb ' + mutationids + '; select displayed set', '_blank');
60583
- window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap pdb ' + mutationids + '; select displayed set', '_blank');
61136
+ //let idsource = $("#" + me.pre + "idsource").val();
61137
+ let idsource, pdbsource;
61138
+ if($("#" + me.pre + "type_mmdbid").is(":checked")) {
61139
+ idsource = 'mmdbid';
61140
+ }
61141
+ else {
61142
+ idsource = 'afid';
61143
+ }
61144
+ if($("#" + me.pre + "showin_currentpage").is(":checked")) {
61145
+ pdbsource = 'currentpage';
61146
+ }
61147
+ else {
61148
+ pdbsource = 'newpage';
61149
+ }
61150
+
61151
+ if(pdbsource == 'currentpage') {
61152
+ let snp = mutationids;
61153
+
61154
+ let bPdb = true;
61155
+ ic.scapCls.retrieveScap(snp, undefined, bPdb);
61156
+ me.htmlCls.clickMenuCls.setLogCmd('scap pdb ' + snp, true);
61157
+ }
61158
+ else {
61159
+ let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
61160
+ me.htmlCls.clickMenuCls.setLogCmd("pdb of mutation " + mutationids, false);
61161
+ window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap pdb ' + mutationids + '; select displayed set', '_blank');
61162
+ }
60584
61163
  });
60585
61164
 
60586
61165
  me.myEventCls.onIds("#" + me.pre + "reload_mutation_inter", "click", function(e) { let ic = me.icn3d;
60587
61166
  e.preventDefault();
60588
61167
  if(!me.cfg.notebook) dialog.dialog( "close" );
60589
61168
  let mutationids = $("#" + me.pre + "mutationids").val();
60590
- let idsource = $("#" + me.pre + "idsource").val();
60591
-
60592
- let mutationArray = mutationids.split(',');
60593
- let residArray = [];
60594
- for(let i = 0, il = mutationArray.length; i < il; ++i) {
60595
- let pos = mutationArray[i].lastIndexOf('_');
60596
- let resid = mutationArray[i].substr(0, pos);
60597
- residArray.push(resid);
61169
+ //let idsource = $("#" + me.pre + "idsource").val();
61170
+ let idsource, pdbsource;
61171
+ if($("#" + me.pre + "type_mmdbid").is(":checked")) {
61172
+ idsource = 'mmdbid';
61173
+ }
61174
+ else {
61175
+ idsource = 'afid';
60598
61176
  }
61177
+ if($("#" + me.pre + "showin_currentpage").is(":checked")) {
61178
+ pdbsource = 'currentpage';
61179
+ }
61180
+ else {
61181
+ pdbsource = 'newpage';
61182
+ }
60599
61183
 
60600
- let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
61184
+ if(pdbsource == 'currentpage') {
61185
+ let snp = mutationids;
60601
61186
 
60602
- // if no structures are loaded yet
60603
- if(!ic.structures) {
60604
- ic.structures = {};
60605
- ic.structures[mmdbid] = 1;
61187
+ let bInteraction = true;
61188
+ ic.scapCls.retrieveScap(snp, bInteraction);
61189
+ me.htmlCls.clickMenuCls.setLogCmd('scap interaction ' + snp, true);
61190
+
61191
+ let idArray = snp.split('_'); //stru_chain_resi_snp
61192
+ let select = '.' + idArray[1] + ':' + idArray[2];
61193
+ let name = 'snp_' + idArray[1] + '_' + idArray[2];
61194
+ me.htmlCls.clickMenuCls.setLogCmd("select " + select + " | name " + name, true);
61195
+ me.htmlCls.clickMenuCls.setLogCmd("line graph interaction pairs | selected non-selected | hbonds,salt bridge,interactions,halogen,pi-cation,pi-stacking | false | threshold 3.8 6 4 3.8 6 5.5", true);
61196
+ me.htmlCls.clickMenuCls.setLogCmd("adjust dialog dl_linegraph", true);
61197
+ me.htmlCls.clickMenuCls.setLogCmd("select displayed set", true);
60606
61198
  }
60607
- ic.resid2specCls.residueids2spec(residArray);
61199
+ else {
61200
+ let mutationArray = mutationids.split(',');
61201
+ let residArray = [];
61202
+ for(let i = 0, il = mutationArray.length; i < il; ++i) {
61203
+ let pos = mutationArray[i].lastIndexOf('_');
61204
+ let resid = mutationArray[i].substr(0, pos);
61205
+ residArray.push(resid);
61206
+ }
60608
61207
 
60609
- me.htmlCls.clickMenuCls.setLogCmd("interaction change of mutation " + mutationids, false);
60610
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?mmdbid=' + mmdbid + '&command=scap interaction ' + mutationids + '; select ' + selectSpec + ' | name test; line graph interaction pairs | selected non-selected | hbonds,salt bridge,interactions,halogen,pi-cation,pi-stacking | false | threshold 3.8 6 4 3.8 6 5.5; adjust dialog dl_linegraph; select displayed set', '_blank');
60611
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?mmdbid=' + mmdbid + '&command=scap interaction ' + mutationids, '_blank');
60612
- window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap interaction ' + mutationids, '_blank');
61208
+ let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
61209
+
61210
+ // if no structures are loaded yet
61211
+ if(!ic.structures) {
61212
+ ic.structures = {};
61213
+ ic.structures[mmdbid] = 1;
61214
+ }
61215
+ ic.resid2specCls.residueids2spec(residArray);
61216
+
61217
+ me.htmlCls.clickMenuCls.setLogCmd("interaction change of mutation " + mutationids, false);
61218
+ window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap interaction ' + mutationids, '_blank');
61219
+ }
60613
61220
  });
60614
61221
 
60615
61222
  // },
@@ -61665,6 +62272,27 @@ class Events {
61665
62272
  let color = $("#" + me.pre + "colorcustom").val();
61666
62273
  picker.set('#' + color).enter();
61667
62274
  });
62275
+
62276
+ let picker2 = new CP(document.querySelector("#" + me.pre + "labelcolorall"));
62277
+ picker2.on("change", function(color) {
62278
+ this.target.value = color;
62279
+ });
62280
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "input", function() {
62281
+ let color = $("#" + me.pre + "labelcolorall").val();
62282
+ picker2.set('#' + color).enter();
62283
+ });
62284
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "keyup", function() {
62285
+ let color = $("#" + me.pre + "labelcolorall").val();
62286
+ picker2.set('#' + color).enter();
62287
+ });
62288
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "paste", function() {
62289
+ let color = $("#" + me.pre + "labelcolorall").val();
62290
+ picker2.set('#' + color).enter();
62291
+ });
62292
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "cut", function() {
62293
+ let color = $("#" + me.pre + "labelcolorall").val();
62294
+ picker2.set('#' + color).enter();
62295
+ });
61668
62296
  // },
61669
62297
  // clickApplypick_stabilizer_rm: function() {
61670
62298
  me.myEventCls.onIds("#" + me.pre + "applypick_stabilizer_rm", "click", function(e) { let ic = me.icn3d;
@@ -62939,7 +63567,7 @@ class SetHtml {
62939
63567
  return html;
62940
63568
  }
62941
63569
 
62942
- exportPqr() { let me = this.icn3dui, ic = me.icn3d;
63570
+ exportPqr(bPdb) { let me = this.icn3dui, ic = me.icn3d;
62943
63571
  let ionHash = {};
62944
63572
  let atomHash = {};
62945
63573
  /*
@@ -62971,13 +63599,15 @@ class SetHtml {
62971
63599
  }
62972
63600
  }
62973
63601
 
63602
+ let fileExt = (bPdb) ? 'pdb' : 'pqr';
62974
63603
  if(me.cfg.cid) {
62975
63604
  let pqrStr = '';
62976
63605
  /// pqrStr += ic.saveFileCls.getPDBHeader();
62977
- pqrStr += ic.saveFileCls.getAtomPDB(atomHash, true) + ic.saveFileCls.getAtomPDB(ionHash, true);
63606
+ let bPqr = (bPdb) ? false : true;
63607
+ pqrStr += ic.saveFileCls.getAtomPDB(atomHash, bPqr) + ic.saveFileCls.getAtomPDB(ionHash, bPqr);
62978
63608
 
62979
63609
  let file_pref =(ic.inputid) ? ic.inputid : "custom";
62980
- ic.saveFileCls.saveFile(file_pref + '_icn3d.pqr', 'text', [pqrStr]);
63610
+ ic.saveFileCls.saveFile(file_pref + '_icn3d.' + fileExt, 'text', [pqrStr]);
62981
63611
  }
62982
63612
  else {
62983
63613
  let bCalphaOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms));
@@ -63013,8 +63643,40 @@ class SetHtml {
63013
63643
  success: function(data) {
63014
63644
  let pqrStr = data;
63015
63645
 
63646
+ if(bPdb) {
63647
+ let lineArray = pqrStr.split('\n');
63648
+
63649
+ let pdbStr = '';
63650
+ for(let i = 0, il = lineArray.length; i < il; ++i) {
63651
+ let line = lineArray[i];
63652
+ if(line.substr(0, 6) == 'ATOM ' || line.substr(0, 6) == 'HETATM') {
63653
+ let atomName = line.substr(12, 4).trim();
63654
+ let elem;
63655
+ if(line.substr(0, 6) == 'ATOM ') {
63656
+ elem = atomName.substr(0, 1);
63657
+ }
63658
+ else {
63659
+ let twochar = atomName.substr(0, 2);
63660
+ if(me.parasCls.vdwRadii.hasOwnProperty(twochar)) {
63661
+ elem = twochar;
63662
+ }
63663
+ else {
63664
+ elem = atomName.substr(0, 1);
63665
+ }
63666
+ }
63667
+
63668
+ pdbStr += line.substr(0, 54) + ' ' + elem.padStart(2, ' ') + '\n';
63669
+ }
63670
+ else {
63671
+ pdbStr += line + '\n';
63672
+ }
63673
+ }
63674
+
63675
+ pqrStr = pdbStr;
63676
+ }
63677
+
63016
63678
  let file_pref =(ic.inputid) ? ic.inputid : "custom";
63017
- ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.pqr', 'text', [pqrStr]);
63679
+ ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.' + fileExt, 'text', [pqrStr]);
63018
63680
  },
63019
63681
  error : function(xhr, textStatus, errorThrown ) {
63020
63682
  this.tryCount++;
@@ -63379,7 +64041,8 @@ class Html {
63379
64041
  this.simulation = undefined;
63380
64042
 
63381
64043
  //this.baseUrl = "https://structure.ncbi.nlm.nih.gov/";
63382
- this.baseUrl = "https://www.ncbi.nlm.nih.gov/Structure/";
64044
+ this.baseUrl = (window && window.location && window.location.hostname == 'structure.ncbi.nlm.nih.gov')
64045
+ ? "https://structure.ncbi.nlm.nih.gov/Structure/" : "https://www.ncbi.nlm.nih.gov/Structure/";
63383
64046
  this.divStr = "<div id='" + this.icn3dui.pre;
63384
64047
  this.divNowrapStr = "<div style='white-space:nowrap'>";
63385
64048
  this.spanNowrapStr = "<span style='white-space:nowrap'>";
@@ -66236,7 +66899,7 @@ class iCn3D {
66236
66899
  if(bWebGL){
66237
66900
  //https://discourse.threejs.org/t/three-js-r128-ext-frag-depth-and-angle-instanced-arrays-extensions-are-not-supported/26037
66238
66901
  //this.renderer = new THREE.WebGL1Renderer({
66239
- if ( bWebGL2 && bVR) {
66902
+ if ( bWebGL2 && bVR) {
66240
66903
  this.renderer = new THREE.WebGLRenderer({
66241
66904
  canvas: this.oriContainer.get(0), //this.container.get(0),
66242
66905
  antialias: true,
@@ -66603,6 +67266,7 @@ class iCn3D {
66603
67266
 
66604
67267
  this.annoCddSiteCls = new AnnoCddSite(this);
66605
67268
  this.annoContactCls = new AnnoContact(this);
67269
+ this.annoPTMCls = new AnnoPTM(this);
66606
67270
  this.annoCrossLinkCls = new AnnoCrossLink(this);
66607
67271
  this.annoDomainCls = new AnnoDomain(this);
66608
67272
  this.annoSnpClinVarCls = new AnnoSnpClinVar(this);
@@ -66850,7 +67514,7 @@ iCn3D.prototype.resetConfig = function () { let ic = this, me = ic.icn3dui;
66850
67514
  }
66851
67515
 
66852
67516
  if(me.cfg.blast_rep_id !== undefined) this.opts['color'] = 'conservation';
66853
- if(me.cfg.mmdbafid !== undefined) this.opts['color'] = 'structure';
67517
+ if(me.cfg.mmdbafid !== undefined && ic.structures) ic.opts['color'] = (Object.keys(ic.structures).length == 1) ? 'chain' : 'structure';
66854
67518
 
66855
67519
  if(me.cfg.options !== undefined) $.extend(this.opts, me.cfg.options);
66856
67520
  };
@@ -66867,7 +67531,7 @@ class iCn3DUI {
66867
67531
  //even when multiple iCn3D viewers are shown together.
66868
67532
  this.pre = this.cfg.divid + "_";
66869
67533
 
66870
- this.REVISION = '3.13.0';
67534
+ this.REVISION = '3.14.3';
66871
67535
 
66872
67536
  // In nodejs, iCn3D defines "window = {navigator: {}}"
66873
67537
  this.bNode = (Object.keys(window).length < 2) ? true : false;