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.js CHANGED
@@ -4227,7 +4227,11 @@ class UtilsCls {
4227
4227
  let dz = atom0.coord.z - atom1.coord.z;
4228
4228
  let distSq = dx*dx + dy*dy + dz*dz;
4229
4229
 
4230
- return distSq < 1.3 * r * r;
4230
+ // r(N) = 0.71, r(H) = 0.31, N-H in residues are about 1.5
4231
+ // factor = (1.5 / 1.02) * (1.5 / 1.02) = 2.16
4232
+ let factor = ((atom0.elem == 'N' && atom1.elem.substr(0,1) == 'H') || (atom1.elem == 'N' && atom0.elem.substr(0,1) == 'H')) ? 2.2 : 1.3;
4233
+
4234
+ return distSq < factor * r * r;
4231
4235
  }
4232
4236
 
4233
4237
  //Convert a three-letter residue name to a one-letter residue abbreviation, e.g., 'LYS' to 'K', or ' A' to 'A' for nucleotides.
@@ -7483,15 +7487,16 @@ class Strand {
7483
7487
  }
7484
7488
 
7485
7489
  let maxDist = 6.0;
7486
- //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);
7487
- 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);
7490
+ 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);
7491
+ // The following code didn't work to select one residue
7492
+ // 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);
7488
7493
 
7489
- if(bBrokenSs && atom.ss === 'sheet') {
7490
- bSheetSegment = true;
7491
- }
7492
- else if(bBrokenSs && atom.ss === 'helix') {
7493
- bHelixSegment = true;
7494
- }
7494
+ // if(bBrokenSs && atom.ss === 'sheet') {
7495
+ // bSheetSegment = true;
7496
+ // }
7497
+ // else if(bBrokenSs && atom.ss === 'helix') {
7498
+ // bHelixSegment = true;
7499
+ // }
7495
7500
 
7496
7501
  if ((atom.ssbegin || atom.ssend || (drawnResidueCount === totalResidueCount - 1) || bBrokenSs) && pnts[0].length > 0 && bSameChain) {
7497
7502
  let atomName = 'CA';
@@ -13778,7 +13783,10 @@ class DefinedSets {
13778
13783
  ic.hAtoms = {};
13779
13784
  this.setHAtomsFromSets(orArray, 'or');
13780
13785
 
13781
- if(Object.keys(ic.hAtoms).length == 0) ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
13786
+ if(Object.keys(ic.hAtoms).length == 0) {
13787
+ //ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
13788
+ ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
13789
+ }
13782
13790
  this.setHAtomsFromSets(andArray, 'and');
13783
13791
 
13784
13792
  this.setHAtomsFromSets(notArray, 'not');
@@ -17450,7 +17458,7 @@ class ShowInter {
17450
17458
  for(let j = 0, jl = ic.atoms[atom.serial].bonds.length; j < jl; ++j) {
17451
17459
  let serial = ic.atoms[atom.serial].bonds[j];
17452
17460
  //if(ic.atoms[serial].name === 'H') {
17453
- if(atom.elem.substr(0, 1) === 'H') {
17461
+ if(ic.atoms[serial].elem.substr(0, 1) === 'H') {
17454
17462
  ic.dAtoms[serial] = 1;
17455
17463
  ic.hAtoms[serial] = 1;
17456
17464
  }
@@ -17459,11 +17467,29 @@ class ShowInter {
17459
17467
  }
17460
17468
  }
17461
17469
  else {
17470
+ // for(let serial in ic.atoms) {
17471
+ // ic.dAtoms[serial] = 1;
17472
+ // ic.hAtoms[serial] = 1;
17473
+ // }
17474
+
17475
+ // add bonds in heavy atoms
17476
+ //for(let serial in ic.hAtoms) {
17462
17477
  for(let serial in ic.atoms) {
17463
- ic.dAtoms[serial] = 1;
17464
- ic.hAtoms[serial] = 1;
17465
- }
17478
+ let atom = ic.atoms[serial];
17479
+ //if(atom.name === 'H') {
17480
+ if(atom.elem.substr(0, 1) === 'H') {
17481
+ if(ic.atoms[serial].bonds.length > 0) {
17482
+ let otherSerial = ic.atoms[serial].bonds[0];
17483
+ ic.atoms[otherSerial].bonds.push(atom.serial);
17484
+ if(ic.atoms[otherSerial].bondOrder) ic.atoms[otherSerial].bondOrder.push(1);
17485
+ }
17486
+
17487
+ ic.dAtoms[serial] = 1;
17488
+ }
17489
+ }
17466
17490
  }
17491
+
17492
+ ic.bShowHighlight = false;
17467
17493
  }
17468
17494
 
17469
17495
  hideHydrogens() { let ic = this.icn3d; ic.icn3dui;
@@ -17840,7 +17866,7 @@ class SetColor {
17840
17866
  break;
17841
17867
 
17842
17868
  case 'chain':
17843
- if(ic.chainsColor !== undefined && Object.keys(ic.chainsColor).length > 0) { // mmdb input
17869
+ if(ic.chainsColor !== undefined && Object.keys(ic.chainsColor).length > 0) { // mmdb input
17844
17870
  this.setMmdbChainColor();
17845
17871
  }
17846
17872
  else {
@@ -18944,7 +18970,7 @@ class Delphi {
18944
18970
 
18945
18971
  ic.loadPhiFrom = 'delphi';
18946
18972
 
18947
- let url = "https://www.ncbi.nlm.nih.gov/Structure/delphi/delphi.cgi";
18973
+ let url = me.htmlCls.baseUrl + "delphi/delphi.cgi";
18948
18974
  let pdbid =(me.cfg.cid) ? me.cfg.cid : Object.keys(ic.structures).toString();
18949
18975
  let dataObj = {};
18950
18976
 
@@ -19756,7 +19782,7 @@ class Symd {
19756
19782
  let thisClass = this;
19757
19783
 
19758
19784
  //var url = "https://data.rcsb.org/rest/v1/core/assembly/" + pdbid + "/1";
19759
- let url = "https://www.ncbi.nlm.nih.gov/Structure/symd/symd.cgi";
19785
+ let url = me.htmlCls.baseUrl + "symd/symd.cgi";
19760
19786
 
19761
19787
  let atomHash = me.hashUtilsCls.intHash(ic.dAtoms, ic.hAtoms);
19762
19788
 
@@ -20903,7 +20929,7 @@ class LoadPDB {
20903
20929
  }
20904
20930
 
20905
20931
  if(!(curChain === atom.chain && curResi === atom.resi)) {
20906
- // a new residue, add the residue-residue bond beides the regular bonds
20932
+ // a new residue, add the residue-residue bond besides the regular bonds
20907
20933
  this.refreshBonds(curResAtoms, prevCarbonArray[0]);
20908
20934
 
20909
20935
  prevCarbonArray.splice(0, 1); // remove the first carbon
@@ -22634,7 +22660,7 @@ class Dssp {
22634
22660
 
22635
22661
  ic.pdbParserCls.loadPdbDataRender(bAppend);
22636
22662
 
22637
- if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
22663
+ //if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
22638
22664
  if(ic.deferredSecondary !== undefined) ic.deferredSecondary.resolve();
22639
22665
  });
22640
22666
  }
@@ -22753,7 +22779,7 @@ class Dssp {
22753
22779
 
22754
22780
  ic.pdbParserCls.loadPdbDataRender(bAppend);
22755
22781
 
22756
- if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
22782
+ //if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
22757
22783
  if(ic.deferredSecondary !== undefined) ic.deferredSecondary.resolve();
22758
22784
  }
22759
22785
  }
@@ -22774,7 +22800,7 @@ class PdbParser {
22774
22800
  let url, dataType;
22775
22801
 
22776
22802
  if(bAf) {
22777
- url = "https://alphafold.ebi.ac.uk/files/AF-" + pdbid + "-F1-model_v2.pdb";
22803
+ url = "https://alphafold.ebi.ac.uk/files/AF-" + pdbid + "-F1-model_v3.pdb";
22778
22804
  ic.ParserUtilsCls.setYourNote(pdbid.toUpperCase() + '(AlphaFold) in iCn3D');
22779
22805
  }
22780
22806
  else {
@@ -23918,13 +23944,13 @@ class OpmParser {
23918
23944
  });
23919
23945
  }
23920
23946
 
23921
- loadOpmData(data, pdbid, bFull, type, pdbid2) { let ic = this.icn3d; ic.icn3dui;
23947
+ loadOpmData(data, pdbid, bFull, type, pdbid2) { let ic = this.icn3d, me = ic.icn3dui;
23922
23948
  let thisClass = this;
23923
23949
  let url, dataType;
23924
23950
 
23925
23951
  if(!pdbid) pdbid = 'stru';
23926
23952
 
23927
- url = "https://www.ncbi.nlm.nih.gov/Structure/mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
23953
+ url = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
23928
23954
  dataType = "jsonp";
23929
23955
 
23930
23956
  $.ajax({
@@ -24065,7 +24091,7 @@ class MmdbParser {
24065
24091
 
24066
24092
  let molid2rescount = data.moleculeInfor;
24067
24093
  let molid2color = {}, chain2molid = {}, molid2chain = {};
24068
- let chainNameHash = {};
24094
+ let chainNameHash = {};
24069
24095
  for(let i in molid2rescount) {
24070
24096
  if(Object.keys(molid2rescount[i]).length === 0) continue;
24071
24097
 
@@ -24085,7 +24111,7 @@ class MmdbParser {
24085
24111
  chain2molid[chain] = i;
24086
24112
  molid2chain[i] = chain;
24087
24113
 
24088
- ic.chainsColor[chain] =(type !== undefined) ? me.parasCls.thr(me.htmlCls.GREY8) : me.parasCls.thr(color);
24114
+ ic.chainsColor[chain] = (type !== undefined && !me.cfg.mmdbafid) ? me.parasCls.thr(me.htmlCls.GREY8) : me.parasCls.thr(color);
24089
24115
 
24090
24116
  let geneId =(molid2rescount[i].geneId === undefined) ? '' : molid2rescount[i].geneId;
24091
24117
  let geneSymbol =(molid2rescount[i].geneSymbol === undefined) ? '' : molid2rescount[i].geneSymbol;
@@ -25201,6 +25227,7 @@ class ChainalignParser {
25201
25227
  let ajaxArray = [], indexArray = [], struArray = [];
25202
25228
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
25203
25229
  let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
25230
+ //let urltmalign = "https://test.ncbi.nlm.nih.gov/Structure/tmalign/tmalign.cgi";
25204
25231
 
25205
25232
  for(let index in ic.afChainIndexHash) {
25206
25233
  let idArray = ic.afChainIndexHash[index].split('_');
@@ -25656,7 +25683,7 @@ class ChainalignParser {
25656
25683
 
25657
25684
  let url_t;
25658
25685
  if(ic.mmdbid_t.length > 5) {
25659
- url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_t + "-F1-model_v2.pdb";
25686
+ url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_t + "-F1-model_v3.pdb";
25660
25687
 
25661
25688
  targetAjax = $.ajax({
25662
25689
  url: url_t,
@@ -25694,7 +25721,7 @@ class ChainalignParser {
25694
25721
 
25695
25722
  let url_q, queryAjax;
25696
25723
  if(ic.mmdbid_q.length > 5) {
25697
- url_q = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_q + "-F1-model_v2.pdb";
25724
+ url_q = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_q + "-F1-model_v3.pdb";
25698
25725
 
25699
25726
  queryAjax = $.ajax({
25700
25727
  url: url_q,
@@ -25997,7 +26024,7 @@ class ChainalignParser {
25997
26024
  let structure = ic.structArray[i];
25998
26025
 
25999
26026
  if(isNaN(structure) && structure.length > 5) {
26000
- url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.structArray[i] + "-F1-model_v2.pdb";
26027
+ url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.structArray[i] + "-F1-model_v3.pdb";
26001
26028
 
26002
26029
  targetAjax = $.ajax({
26003
26030
  url: url_t,
@@ -26062,6 +26089,8 @@ class ChainalignParser {
26062
26089
  let hAtoms = {}, hAtomsTmp = {};
26063
26090
  let bLastQuery = false;
26064
26091
 
26092
+ ic.opts['color'] = (structArray.length == 1) ? 'chain' : 'structure';
26093
+
26065
26094
  for(let i = 0, il = structArray.length; i < il; ++i) {
26066
26095
  if(i == structArray.length - 1) bLastQuery = true;
26067
26096
 
@@ -26074,10 +26103,11 @@ class ChainalignParser {
26074
26103
  targetOrQuery = 'query';
26075
26104
  bAppend = true;
26076
26105
  }
26077
-
26106
+
26078
26107
  //if(structArray[i].length > 4) {
26079
26108
  if(structArray[i].length > 5) { // PDB ID plus postfix could be 5
26080
- let bNoDssp = true;
26109
+ //let bNoDssp = true;
26110
+ let bNoDssp = false; // get secondary structure info
26081
26111
  hAtomsTmp = ic.pdbParserCls.loadPdbData(queryDataArray[i], structArray[i], false, bAppend, targetOrQuery, bLastQuery, bNoDssp);
26082
26112
  }
26083
26113
  else {
@@ -26090,7 +26120,7 @@ class ChainalignParser {
26090
26120
 
26091
26121
  // calculate secondary structures with applyCommandDssp
26092
26122
  if(bQuery && me.cfg.matchedchains) {
26093
- $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
26123
+ // $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
26094
26124
  let bRealign = true, bPredefined = true;
26095
26125
  ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
26096
26126
  // reset annotations
@@ -26099,11 +26129,10 @@ class ChainalignParser {
26099
26129
  if($('#' + ic.pre + 'dl_selectannotations').dialog( 'isOpen' )) {
26100
26130
  $('#' + ic.pre + 'dl_selectannotations').dialog( 'close' );
26101
26131
  }
26102
- });
26103
- }
26104
- else {
26105
- ic.pdbParserCls.applyCommandDssp(true);
26132
+ //});
26106
26133
  }
26134
+
26135
+ if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
26107
26136
  }
26108
26137
  }
26109
26138
 
@@ -27551,6 +27580,24 @@ class LoadScript {
27551
27580
 
27552
27581
  return;
27553
27582
  }
27583
+ else if(ic.commands[i].trim().indexOf('set annotation ptm') == 0 ) { // the command may have "|||{"factor"...
27584
+ let strArray = ic.commands[i].split("|||");
27585
+
27586
+ if(Object.keys(ic.proteins).length > 0 &&(ic.bAjaxPTM === undefined || !ic.bAjaxPTM) ) {
27587
+ $.when(thisClass.applyCommandPTM(strArray[0].trim())).then(function() {
27588
+ thisClass.execCommandsBase(i + 1, end, steps);
27589
+ });
27590
+ }
27591
+ else {
27592
+ if(Object.keys(ic.proteins).length > 0) {
27593
+ thisClass.applyCommandPTM(strArray[0].trim());
27594
+ }
27595
+
27596
+ this.execCommandsBase(i + 1, end, steps);
27597
+ }
27598
+
27599
+ return;
27600
+ }
27554
27601
  else if(ic.commands[i].trim().indexOf('set annotation 3ddomain') == 0) { // the command may have "|||{"factor"...
27555
27602
  let strArray = ic.commands[i].split("|||");
27556
27603
 
@@ -27781,6 +27828,8 @@ class LoadScript {
27781
27828
  ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
27782
27829
  }
27783
27830
 
27831
+ me.cfg.aligntool = 'vast';
27832
+
27784
27833
  $.when(thisClass.applyCommandRealignByStruct(command)).then(function() {
27785
27834
  thisClass.execCommandsBase(i + 1, end, steps);
27786
27835
  });
@@ -27941,6 +27990,9 @@ class LoadScript {
27941
27990
  else if(lastCommand.indexOf('set annotation snp') == 0) {
27942
27991
  thisClass.applyCommandSnp(lastCommand);
27943
27992
  }
27993
+ else if(lastCommand.indexOf('set annotation ptm') == 0) {
27994
+ thisClass.applyCommandPTM(lastCommand);
27995
+ }
27944
27996
  else if(lastCommand.indexOf('set annotation 3ddomain') == 0) {
27945
27997
  thisClass.applyCommand3ddomain(lastCommand);
27946
27998
  }
@@ -27991,6 +28043,9 @@ class LoadScript {
27991
28043
  let nameArray = paraArray[1].split(',');
27992
28044
  ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
27993
28045
  }
28046
+
28047
+ me.cfg.aligntool = 'vast';
28048
+
27994
28049
  thisClass.applyCommandRealignByStruct(lastCommand);
27995
28050
  }
27996
28051
  else if(lastCommand.indexOf('realign on tmalign') == 0) {
@@ -28396,6 +28451,25 @@ class LoadScript {
28396
28451
  return ic.deferredSnp.promise();
28397
28452
  }
28398
28453
 
28454
+ applyCommandPTMBase(command) { let ic = this.icn3d; ic.icn3dui;
28455
+ // chain functions together
28456
+ let pos = command.lastIndexOf(' '); // set annotation clinvar
28457
+ command.substr(pos + 1);
28458
+
28459
+ ic.annotationCls.setAnnoTabPTM();
28460
+ }
28461
+
28462
+ applyCommandPTM(command) { let ic = this.icn3d; ic.icn3dui;
28463
+ let thisClass = this;
28464
+
28465
+ // chain functions together
28466
+ ic.deferredPTM = $.Deferred(function() {
28467
+ thisClass.applyCommandPTMBase(command);
28468
+ }); // end of me.deferred = $.Deferred(function() {
28469
+
28470
+ return ic.deferredPTM.promise();
28471
+ }
28472
+
28399
28473
  applyCommand3ddomainBase(command) { let ic = this.icn3d; ic.icn3dui;
28400
28474
  // chain functions together
28401
28475
  let pos = command.lastIndexOf(' ');
@@ -28740,7 +28814,7 @@ class ResizeCanvas {
28740
28814
  //let itemArray = ['dl_selectannotations', 'dl_alignment', 'dl_2ddgm', 'dl_definedsets', 'dl_graph',
28741
28815
  // 'dl_linegraph', 'dl_scatterplot', 'dl_contactmap', 'dl_allinteraction', 'dl_copyurl',
28742
28816
  // 'dl_symmetry', 'dl_symd', 'dl_rmsd', 'dl_legend', 'dl_disttable'];
28743
- let itemArray = ['dl_2ddgm', 'dl_2dctn', 'dl_alignment', 'dl_sequence2', 'dl_definedsets', 'dl_setsmenu', 'dl_command', 'dl_setoperations', 'dl_vast', 'dl_foldseek', 'dl_mmtfid', 'dl_pdbid', 'dl_afid', 'dl_opmid', 'dl_pdbfile', 'dl_pdbfile_app', 'dl_rescolorfile', 'dl_customcolor', 'dl_align', 'dl_alignaf', 'dl_chainalign', 'dl_mutation', 'dl_mol2file', 'dl_sdffile', 'dl_xyzfile', 'dl_afmapfile', 'dl_urlfile', 'dl_mmciffile', 'dl_mmcifid', 'dl_mmdbid', 'dl_mmdbafid', 'dl_blast_rep_id', 'dl_yournote', 'dl_gi', 'dl_uniprotid', 'dl_cid', 'dl_pngimage', 'dl_state', 'dl_fixedversion', 'dl_selection', 'dl_dsn6', 'dl_dsn6url', 'dl_clr', 'dl_symmetry', 'dl_symd', 'dl_contact', 'dl_hbonds', 'dl_realign', 'dl_realignbystruct', 'dl_allinteraction', 'dl_interactionsorted', 'dl_linegraph', 'dl_linegraphcolor', 'dl_scatterplot', 'dl_scatterplotcolor', 'dl_contactmap', 'dl_alignerrormap', 'dl_elecmap2fofc', 'dl_elecmapfofc', 'dl_emmap', 'dl_aroundsphere', 'dl_adjustmem', 'dl_selectplane', 'dl_addlabel', 'dl_addlabelselection', 'dl_labelColor', 'dl_distance', 'dl_stabilizer', 'dl_disttwosets', 'dl_distmanysets', 'dl_stabilizer_rm', 'dl_thickness', 'dl_thickness2', 'dl_addtrack', 'dl_addtrack_tabs', 'dl_saveselection', 'dl_copyurl', 'dl_selectannotations', 'dl_annotations_tabs', 'dl_anno_view_tabs', 'dl_annotations', 'dl_graph', 'dl_svgcolor', 'dl_area', 'dl_colorbyarea', 'dl_rmsd', 'dl_buriedarea', 'dl_propbypercentout', 'dl_propbybfactor', 'dl_legend', 'dl_disttable'];
28817
+ let itemArray = ['dl_2ddgm', 'dl_2dctn', 'dl_alignment', 'dl_sequence2', 'dl_definedsets', 'dl_setsmenu', 'dl_command', 'dl_setoperations', 'dl_vast', 'dl_foldseek', 'dl_mmtfid', 'dl_pdbid', 'dl_afid', 'dl_opmid', 'dl_pdbfile', 'dl_pdbfile_app', 'dl_rescolorfile', 'dl_customcolor', 'dl_align', 'dl_alignaf', 'dl_chainalign', 'dl_chainalign2', 'dl_chainalign3', 'dl_mutation', 'dl_mol2file', 'dl_sdffile', 'dl_xyzfile', 'dl_afmapfile', 'dl_urlfile', 'dl_mmciffile', 'dl_mmcifid', 'dl_mmdbid', 'dl_mmdbafid', 'dl_blast_rep_id', 'dl_yournote', 'dl_gi', 'dl_uniprotid', 'dl_cid', 'dl_pngimage', 'dl_state', 'dl_fixedversion', 'dl_selection', 'dl_dsn6', 'dl_dsn6url', 'dl_clr', 'dl_symmetry', 'dl_symd', 'dl_contact', 'dl_hbonds', 'dl_realign', 'dl_realignbystruct', 'dl_allinteraction', 'dl_interactionsorted', 'dl_linegraph', 'dl_linegraphcolor', 'dl_scatterplot', 'dl_scatterplotcolor', 'dl_contactmap', 'dl_alignerrormap', 'dl_elecmap2fofc', 'dl_elecmapfofc', 'dl_emmap', 'dl_aroundsphere', 'dl_adjustmem', 'dl_selectplane', 'dl_addlabel', 'dl_addlabelselection', 'dl_labelColor', 'dl_distance', 'dl_stabilizer', 'dl_disttwosets', 'dl_distmanysets', 'dl_stabilizer_rm', 'dl_thickness', 'dl_thickness2', 'dl_addtrack', 'dl_addtrack_tabs', 'dl_saveselection', 'dl_copyurl', 'dl_selectannotations', 'dl_annotations_tabs', 'dl_anno_view_tabs', 'dl_annotations', 'dl_graph', 'dl_svgcolor', 'dl_area', 'dl_colorbyarea', 'dl_rmsd', 'dl_buriedarea', 'dl_propbypercentout', 'dl_propbybfactor', 'dl_legend', 'dl_disttable'];
28744
28818
 
28745
28819
  for(let i in itemArray) {
28746
28820
  let item = itemArray[i];
@@ -29937,7 +30011,8 @@ class ShowSeq {
29937
30011
  if(seqLength > ic.maxAnnoLength) {
29938
30012
  ic.maxAnnoLength = seqLength;
29939
30013
  }
29940
- let itemArray = ['giseq', 'cddsite', 'clinvar', 'snp', 'domain', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
30014
+ //let itemArray = ['giseq', 'cddsite', 'ptm', 'clinvar', 'snp', 'domain', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
30015
+ let itemArray = ['giseq', 'cddsite', 'clinvar', 'snp', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'custom', 'interaction'];
29941
30016
  for(let i in itemArray) {
29942
30017
  let item = itemArray[i];
29943
30018
  if($("#" + ic.pre + item + "_" + chnid).length) $("#" + ic.pre + item + "_" + chnid).width(divLength);
@@ -31777,7 +31852,7 @@ class AnnoCddSite {
31777
31852
  let chnidArray = Object.keys(ic.protein_chainid);
31778
31853
  // show conserved domains and binding sites
31779
31854
  // live search
31780
- let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + chnidBaseArray;
31855
+ let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + chnidBaseArray;
31781
31856
  // precalculated
31782
31857
  //let url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + chnidBaseArray;
31783
31858
  // live search for AlphaFold structures
@@ -31823,7 +31898,7 @@ class AnnoCddSite {
31823
31898
 
31824
31899
  //url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + ic.giSeq[chnidArray[0]].join('');
31825
31900
  // live searchE
31826
- url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + seq;
31901
+ url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&frclive&live=lcl&queries=" + seq;
31827
31902
  // precalculated
31828
31903
  //url = me.htmlCls.baseUrl + "cdannots/cdannots.fcgi?fmt&live=lcl&queries=" + seq;
31829
31904
 
@@ -32899,6 +32974,9 @@ class ApplyCommand {
32899
32974
  else if(command == 'set annotation interaction') {
32900
32975
  ic.annotationCls.setAnnoTabInteraction();
32901
32976
  }
32977
+ else if(command == 'set annotation ptm') {
32978
+ ic.annotationCls.setAnnoTabPTM();
32979
+ }
32902
32980
  else if(command == 'set annotation cdd') {
32903
32981
  ic.annotationCls.setAnnoTabCdd();
32904
32982
  }
@@ -32945,6 +33023,9 @@ class ApplyCommand {
32945
33023
  else if(type == 'site') {
32946
33024
  ic.annotationCls.hideAnnoTabSite();
32947
33025
  }
33026
+ else if(type == 'ptm') {
33027
+ ic.annotationCls.hideAnnoTabPTM();
33028
+ }
32948
33029
  else if(type == 'interaction') {
32949
33030
  ic.annotationCls.hideAnnoTabInteraction();
32950
33031
  }
@@ -34097,7 +34178,7 @@ class ApplyCommand {
34097
34178
  else if(cmd.indexOf('realign on seq align') == 0) return 'File > Realign Selection > on Sequence Alignment';
34098
34179
  else if(cmd.indexOf('realign') == 0) return 'File > Realign Selection > Residue by Residue';
34099
34180
  else if(cmd.indexOf('graph interaction pairs') == 0) return hbondIntStr + ' > 2D Graph(Force-Directed)';
34100
- else if(cmd.indexOf('export canvas') == 0) return 'File > Save Files > iCn3D PNG Image';
34181
+ else if(cmd.indexOf('export canvas') == 0) return 'File > Save File > iCn3D PNG Image';
34101
34182
  else if(cmd == 'export stl file') return printStr + 'STL';
34102
34183
  else if(cmd == 'export vrml file') return printStr + 'VRML(Color)';
34103
34184
  else if(cmd == 'export stl stabilizer file') return printStr + 'STL W/ Stabilizers';
@@ -34143,6 +34224,7 @@ class ApplyCommand {
34143
34224
  else if(cmd== 'set view overview') return seqAnnoStr + ': "Summary" tab';
34144
34225
  else if(cmd == 'set annotation custom') return seqAnnoStr + ': "Custom" checkbox';
34145
34226
  else if(cmd == 'set annotation interaction') return seqAnnoStr + ': "Interactions" checkbox';
34227
+ else if(cmd == 'set annotation ptm') return seqAnnoStr + ': "PTM" checkbox';
34146
34228
  else if(cmd == 'set annotation cdd') return seqAnnoStr + ': "Conserved Domains" checkbox';
34147
34229
  else if(cmd == 'set annotation site') return seqAnnoStr + ': "Functional Sites" checkbox';
34148
34230
  else if(cmd == 'set annotation ssbond') return seqAnnoStr + ': "Disulfide Bonds" checkbox';
@@ -34431,7 +34513,9 @@ class SelectByCommand {
34431
34513
  bResidueId = true;
34432
34514
  }
34433
34515
  else {
34434
- if(residueStrArray[j][0] === '3' && residueStrArray[j].length > 1 &&(residueStrArray[j].length - 1) % 3 === 0) { // three letter residue string, such as :3LysArg
34516
+ //if(residueStrArray[j].length > 1 && residueStrArray[j][0] === '3' && (residueStrArray[j].length - 1) % 3 === 0) { // three letter residue string, such as :3LysArg
34517
+ if(residueStrArray[j].length > 1 && residueStrArray[j][0] === '3'
34518
+ && isNaN(residueStrArray[j][1]) && residueStrArray[j][0] !== '-') { // three letter residue string, such as :3LysArg or :3ZN, but not :30 neither :3-10
34435
34519
  let tmpStr = residueStrArray[j].toUpperCase();
34436
34520
  threeLetterResidueStr = tmpStr.substr(1);
34437
34521
  bResidueArrayThree = true;
@@ -34547,7 +34631,8 @@ class SelectByCommand {
34547
34631
  }
34548
34632
  else if(bResidueArrayThree) {
34549
34633
  let threeLetter = me.utilsCls.residueAbbr2Name(ic.chainsSeq[molecule_chain][s].name);
34550
- chainSeq +=(threeLetter.length == 3) ? threeLetter : ' ';
34634
+
34635
+ chainSeq +=(threeLetter.length == 3) ? threeLetter : threeLetter.padEnd(3, '_');
34551
34636
  }
34552
34637
  resiArray.push(ic.chainsSeq[molecule_chain][s].resi);
34553
34638
  }
@@ -35445,7 +35530,8 @@ class SetSeqAlign {
35445
35530
  if(i > 0) {
35446
35531
  let index1 = alignIndex;
35447
35532
  for(let j = prevIndex1 + 1, jl = start1; j < jl; ++j) {
35448
- if(ic.chainsSeq[chainid1] === undefined) break;
35533
+ if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid1][j] === undefined) break;
35534
+
35449
35535
  let resi = ic.chainsSeq[chainid1][j].resi;
35450
35536
  let resn = ic.chainsSeq[chainid1][j].name.toLowerCase();
35451
35537
 
@@ -35459,7 +35545,8 @@ class SetSeqAlign {
35459
35545
 
35460
35546
  let index2 = alignIndex;
35461
35547
  for(let j = prevIndex2 + 1, jl = start2; j < jl; ++j) {
35462
- if(ic.chainsSeq[chainid2] === undefined) break;
35548
+ if(ic.chainsSeq[chainid2] === undefined || ic.chainsSeq[chainid2] === undefined) break;
35549
+
35463
35550
  let resi = ic.chainsSeq[chainid2][j].resi;
35464
35551
  let resn = ic.chainsSeq[chainid2][j].name.toLowerCase();
35465
35552
 
@@ -35605,11 +35692,15 @@ class SetSeqAlign {
35605
35692
  // start and end of MSA
35606
35693
  let start_t = 9999, end_t = -1;
35607
35694
 
35695
+ let baseResi = ic.chainsSeq[chainid1][0].resi - 1;
35696
+
35608
35697
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
35609
35698
  let chainIndex = index - 1;
35699
+ if(!ic.qt_start_end[chainIndex]) continue;
35700
+
35610
35701
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
35611
35702
  let start1, end1;
35612
- if(bRealign) { // realresidue numbers are stored
35703
+ if(bRealign) { // real residue numbers are stored
35613
35704
  start1 = ic.qt_start_end[chainIndex][i].t_start;
35614
35705
  end1 = ic.qt_start_end[chainIndex][i].t_end;
35615
35706
  }
@@ -35617,9 +35708,9 @@ class SetSeqAlign {
35617
35708
  start1 = ic.qt_start_end[chainIndex][i].t_start - 1;
35618
35709
  end1 = ic.qt_start_end[chainIndex][i].t_end - 1;
35619
35710
  }
35620
-
35621
35711
  for(let j = start1; j <= end1; ++j) {
35622
- let resi = this.getResi(chainidArray[0], j, bRealign);
35712
+ let resiPos = j - baseResi;
35713
+ let resi = this.getResi(chainidArray[0], resiPos, bRealign);
35623
35714
  resi2range_t[resi] = 1;
35624
35715
  if(j < start_t) start_t = j;
35625
35716
  if(j > end_t) end_t = j;
@@ -35627,6 +35718,9 @@ class SetSeqAlign {
35627
35718
  }
35628
35719
  }
35629
35720
 
35721
+ // TM-align should use "start1 = ic.qt_start_end[chainIndex][i].t_start - 1", but the rest are the same as ""bRealign"
35722
+ if(me.cfg.aligntool == 'tmalign') bRealign = true; // real residue numbers are stored
35723
+
35630
35724
  let resi2rangeArray = Object.keys(resi2range_t);
35631
35725
  resi2rangeArray.sort(function(a, b) {
35632
35726
  return parseInt(a) - parseInt(b);
@@ -35673,7 +35767,7 @@ class SetSeqAlign {
35673
35767
  for(let j = 0, jl = ic.chainsSeq[chainid1].length; j < jl; ++j) {
35674
35768
  let resi = ic.chainsSeq[chainid1][j].resi;
35675
35769
 
35676
- if((j < start_t || j > end_t) ) {
35770
+ if((j + baseResi < start_t || j + baseResi > end_t) ) {
35677
35771
  continue;
35678
35772
  }
35679
35773
 
@@ -36911,7 +37005,7 @@ class ParserUtils {
36911
37005
  if(me.cfg.showanno) {
36912
37006
  let cmd = "view annotations";
36913
37007
  me.htmlCls.clickMenuCls.setLogCmd(cmd, true);
36914
- ic.showAnnoCls.showAnnotations();
37008
+ ic.showAnnoCls.showAnnotations();
36915
37009
  }
36916
37010
  if(me.cfg.closepopup) {
36917
37011
  ic.resizeCanvasCls.closeDialogs();
@@ -37402,8 +37496,8 @@ class HlSeq {
37402
37496
  if(me.bNode) return;
37403
37497
 
37404
37498
  let thisClass = this;
37405
- $("#" + 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]")
37406
- .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]")
37499
+ $("#" + 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]")
37500
+ .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]")
37407
37501
  .selectable({
37408
37502
  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.
37409
37503
  stop: function() { let ic = thisClass.icn3d;
@@ -37456,11 +37550,11 @@ class HlSeq {
37456
37550
  }
37457
37551
  });
37458
37552
 
37459
- $("[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]")
37460
- .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]")
37553
+ $("[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]")
37554
+ .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]")
37461
37555
 
37462
- .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]")
37463
- .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]")
37556
+ .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]")
37557
+ .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]")
37464
37558
 
37465
37559
  .on('click', '.icn3d-seqTitle', function(e) { let ic = thisClass.icn3d;
37466
37560
  e.stopImmediatePropagation();
@@ -37501,7 +37595,7 @@ class HlSeq {
37501
37595
 
37502
37596
  let thisClass = this;
37503
37597
 
37504
- $("#" + 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;
37598
+ $("#" + 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;
37505
37599
  e.stopImmediatePropagation();
37506
37600
  /*
37507
37601
  //if($(this).attr('id') === ic.pre + "dl_sequence2") {
@@ -37550,7 +37644,7 @@ class HlSeq {
37550
37644
 
37551
37645
  let thisClass = this;
37552
37646
 
37553
- $("#" + 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;
37647
+ $("#" + 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;
37554
37648
  e.stopImmediatePropagation();
37555
37649
 
37556
37650
  //if($(this).attr('id') === ic.pre + "dl_sequence2") {
@@ -37747,7 +37841,7 @@ class HlSeq {
37747
37841
  let residueid;
37748
37842
  let structure = chainid.substr(0, chainid.indexOf('_'));
37749
37843
  for(let i = 0, il = posArray.length; i < il; ++i) {
37750
- if($(that).attr('site') !== undefined) {
37844
+ if($(that).attr('site') !== undefined || $(that).attr('ptm') !== undefined) {
37751
37845
  if(ic.bNCBI) {
37752
37846
  let residNCBI = chainid + '_' +(parseInt(posArray[i])+1).toString();
37753
37847
  // AlphaFold domains calculated on-the-fly have no conversion
@@ -37917,9 +38011,11 @@ class ShowAnno {
37917
38011
  }
37918
38012
 
37919
38013
  let nucleotide_chainid = {}, chemical_chainid = {}, chemical_set = {};
37920
- ic.protein_chainid = {};
38014
+ //ic.protein_chainid = {};
37921
38015
 
37922
38016
  if(ic.bAnnoShown === undefined || !ic.bAnnoShown || ic.bResetAnno) { // ic.bResetAnno when loading another structure
38017
+ ic.protein_chainid = {};
38018
+
37923
38019
  let chainArray = Object.keys(ic.chains);
37924
38020
 
37925
38021
  if(ic.giSeq === undefined) ic.giSeq = {};
@@ -37960,6 +38056,7 @@ class ShowAnno {
37960
38056
  chainidBase = chainArray[i];
37961
38057
  }
37962
38058
  //if(me.cfg.mmdbid !== undefined) { // protein and chemicals/ions are in different chains
38059
+
37963
38060
  if(ic.proteins.hasOwnProperty(atom.serial) && ic.chainsSeq[chainArray[i]].length > 1) {
37964
38061
  ic.protein_chainid[chainArray[i]] = chainidBase;
37965
38062
  }
@@ -38146,6 +38243,8 @@ class ShowAnno {
38146
38243
  ++i;
38147
38244
  }
38148
38245
  ic.interactChainbase = me.hashUtilsCls.unionHash(ic.interactChainbase, chemical_chainid);
38246
+ ic.PTMChainbase = me.hashUtilsCls.unionHash(ic.PTMChainbase, ic.protein_chainid);
38247
+
38149
38248
  ic.ssbondChainbase = me.hashUtilsCls.unionHash(ic.ssbondChainbase, ic.protein_chainid);
38150
38249
  ic.ssbondChainbase = me.hashUtilsCls.unionHash(ic.ssbondChainbase, chemical_chainid);
38151
38250
  ic.crosslinkChainbase = me.hashUtilsCls.unionHash(ic.crosslinkChainbase, ic.protein_chainid);
@@ -38177,8 +38276,10 @@ class ShowAnno {
38177
38276
  //if(proteinName.length > 40) proteinName = proteinName.substr(0, 40) + "...";
38178
38277
  let categoryStr =(index == 0) ? "<span class='icn3d-annoLargeTitle'><b>Proteins</b>: </span><br><br>" : "";
38179
38278
  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>)" : '';
38279
+ let structure = chnid.substr(0, chnid.indexOf('_'));
38280
+ let chainLink = (structure.length > 5) ? '<a href="https://alphafold.ebi.ac.uk/entry/' + structure + '" target="_blank">' + chnid + '</a>' : chnid;
38180
38281
  let chainHtml = "<div id='" + ic.pre + "anno_" + chnid + "' class='icn3d-annotation'>" + categoryStr
38181
- + "<span style='font-weight:bold;'>Annotations of " + chnid
38282
+ + "<span style='font-weight:bold;'>Annotations of " + chainLink
38182
38283
  + "</span>: <a class='icn3d-blue' href='https://www.ncbi.nlm.nih.gov/protein?term="
38183
38284
  + chnid + "' target='_blank' title='" + fullProteinName + "'>" + proteinName + "</a>"
38184
38285
  + geneLink + "&nbsp;&nbsp;&nbsp;"
@@ -38191,7 +38292,8 @@ class ShowAnno {
38191
38292
  + 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;"
38192
38293
  + 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);
38193
38294
  $("#" + ic.pre + "dl_annotations").append(chainHtml);
38194
- let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'domain', 'site', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
38295
+ //let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'domain', 'site', 'ptm', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
38296
+ let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'site', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'custom', 'interaction'];
38195
38297
  // dt: detailed view, hide by default; ov: overview, show by default
38196
38298
  for(let i in itemArray) {
38197
38299
  let item = itemArray[i];
@@ -38619,6 +38721,286 @@ class ShowAnno {
38619
38721
 
38620
38722
  }
38621
38723
 
38724
+ /**
38725
+ * @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
38726
+ */
38727
+
38728
+ class AnnoPTM {
38729
+ constructor(icn3d) {
38730
+ this.icn3d = icn3d;
38731
+ }
38732
+
38733
+ //Show the annotations of CDD domains and binding sites.
38734
+ showPTM(chnid, chnidBase) { let ic = this.icn3d; ic.icn3dui;
38735
+ let thisClass = this;
38736
+
38737
+ // UniProt ID
38738
+ let structure = chnid.substr(0, chnid.indexOf('_'));
38739
+ let chain = chnid.substr(chnid.indexOf('_') + 1);
38740
+
38741
+ // UniProt ID
38742
+ if( structure.length > 5 ) {
38743
+ let url = "https://www.ebi.ac.uk/proteins/api/features/" + structure;
38744
+ $.ajax({
38745
+ url: url,
38746
+ dataType: 'json',
38747
+ cache: true,
38748
+ tryCount : 0,
38749
+ retryLimit : 0, //1
38750
+ success: function(data) {
38751
+ thisClass.parsePTM(data, chnid);
38752
+ if(ic.deferredPTM !== undefined) ic.deferredPTM.resolve();
38753
+ },
38754
+ error : function(xhr, textStatus, errorThrown ) {
38755
+ this.tryCount++;
38756
+ if(this.tryCount <= this.retryLimit) {
38757
+ //try again
38758
+ $.ajax(this);
38759
+ return;
38760
+ }
38761
+
38762
+ thisClass.getNoPTM(chnid);
38763
+
38764
+ return;
38765
+ }
38766
+ });
38767
+ }
38768
+ else { // PDB
38769
+ // get PDB to UniProt mapping
38770
+ // https://www.ebi.ac.uk/pdbe/api/doc/
38771
+ let structLower = structure.substr(0, 4).toLowerCase();
38772
+ let urlMap = "https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/" + structLower;
38773
+
38774
+ $.ajax({
38775
+ url: urlMap,
38776
+ dataType: 'json',
38777
+ cache: true,
38778
+ success: function(dataMap) {
38779
+ let UniProtID = '';
38780
+ if(!ic.UPResi2ResiPosPerChain) ic.UPResi2ResiPosPerChain = {};
38781
+ ic.UPResi2ResiPosPerChain[chnid] = {};
38782
+ let mapping = dataMap[structLower].UniProt;
38783
+
38784
+ let bFound = false;
38785
+ for(let up in mapping) {
38786
+ let chainArray = mapping[up].mappings;
38787
+ if(bFound) break;
38788
+
38789
+ for(let i = 0, il = chainArray.length; i < il; ++i) {
38790
+ //"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"
38791
+ let chainObj = chainArray[i];
38792
+ if(chainObj.chain_id == chain) {
38793
+ let start = chainObj.unp_start;
38794
+ let end = chainObj.unp_end;
38795
+ let posStart = chainObj.start.residue_number;
38796
+ let posEnd = chainObj.end.residue_number;
38797
+
38798
+ if(posEnd - posStart != end - start) {
38799
+ console.log("There might be some issues in the PDB to UniProt residue mapping.");
38800
+ }
38801
+
38802
+ for(let j = 0; j <= end - start; ++j) {
38803
+ ic.UPResi2ResiPosPerChain[chnid][j + start] = j + posStart - 1; // 0-based
38804
+ }
38805
+
38806
+ UniProtID = up;
38807
+ bFound = true;
38808
+ break;
38809
+ }
38810
+ }
38811
+ }
38812
+
38813
+ if(UniProtID == '') {
38814
+ thisClass.getNoPTM(chnid);
38815
+ }
38816
+ else {
38817
+ let url = "https://www.ebi.ac.uk/proteins/api/features/" + UniProtID;
38818
+ $.ajax({
38819
+ url: url,
38820
+ dataType: 'json',
38821
+ cache: true,
38822
+ tryCount : 0,
38823
+ retryLimit : 0, //1
38824
+ success: function(data) {
38825
+ thisClass.parsePTM(data, chnid);
38826
+ if(ic.deferredPTM !== undefined) ic.deferredPTM.resolve();
38827
+ },
38828
+ error : function(xhr, textStatus, errorThrown ) {
38829
+ this.tryCount++;
38830
+ if(this.tryCount <= this.retryLimit) {
38831
+ //try again
38832
+ $.ajax(this);
38833
+ return;
38834
+ }
38835
+
38836
+ thisClass.getNoPTM(chnid);
38837
+
38838
+ return;
38839
+ }
38840
+ });
38841
+ }
38842
+ },
38843
+ error : function(xhr, textStatus, errorThrown ) {
38844
+ thisClass.getNoPTM(chnid);
38845
+ }
38846
+ });
38847
+ }
38848
+ }
38849
+
38850
+ parsePTM(data, chnid) { let ic = this.icn3d, me = ic.icn3dui;
38851
+
38852
+ if(me.bNode) {
38853
+ //if(!ic.resid2ptm) ic.resid2ptm = {};
38854
+ ic.resid2ptm = {};
38855
+ ic.resid2ptm[chnid] = [];
38856
+ }
38857
+
38858
+ let ptmHash = {};
38859
+ for(let i = 0, il = data.features.length; i < il; ++i) {
38860
+ let feature = data.features[i];
38861
+
38862
+ if(feature.category == 'PTM' && feature.type != 'DISULFID' && feature.type != 'CROSSLNK') {
38863
+ let title = '';
38864
+ if(feature.type == 'CARBOHYD') {
38865
+ //title = 'Glycosylation, ' + feature.description;
38866
+ title = 'Glycosylation';
38867
+ }
38868
+ else if(feature.type == 'LIPID') {
38869
+ title = 'Lipidation, ' + feature.description;
38870
+ }
38871
+ else if(feature.description.indexOf('Phospho') == 0) {
38872
+ title = 'Phosphorylation';
38873
+ }
38874
+ else if(feature.description) {
38875
+ title = feature.description;
38876
+ }
38877
+ else {
38878
+ title = feature.type;
38879
+ }
38880
+
38881
+ if(!ptmHash[title]) ptmHash[title] = [];
38882
+ ptmHash[title].push(feature);
38883
+ }
38884
+ }
38885
+
38886
+ let index = 0;
38887
+ let html = '', html2 = '', html3 = '';
38888
+ html += '<div id="' + ic.pre + chnid + '_ptmseq_sequence" class="icn3d-cdd icn3d-dl_sequence">';
38889
+ html2 += html;
38890
+ html3 += html;
38891
+ let stucture = chnid.substr(0, chnid.indexOf('_'));
38892
+
38893
+ for(let ptm in ptmHash) {
38894
+ let ptmArray = ptmHash[ptm];
38895
+ //"type": "MOD_RES", "category": "PTM", "description": "4-hydroxyproline", "begin": "382", "end": "382",
38896
+ let resPosArray = [];
38897
+ let bCoordinates = false;
38898
+ for(let i = 0, il = ptmArray.length; i < il; ++i) {
38899
+ let begin = parseInt(ptmArray[i].begin);
38900
+ let end = parseInt(ptmArray[i].end);
38901
+
38902
+
38903
+ for(let j = begin; j <= end; ++j) {
38904
+ if(stucture.length > 5) { // UniProt
38905
+ resPosArray.push(j - 1); // 0-based
38906
+ }
38907
+ else { // PDB
38908
+ if(ic.UPResi2ResiPosPerChain[chnid][j]) resPosArray.push(ic.UPResi2ResiPosPerChain[chnid][j]);
38909
+ }
38910
+
38911
+ if(!bCoordinates && ic.residues.hasOwnProperty(chnid + '_' + j)) {
38912
+ bCoordinates = true;
38913
+ }
38914
+ }
38915
+ }
38916
+
38917
+ if(resPosArray.length == 0) continue;
38918
+
38919
+ let resCnt = resPosArray.length;
38920
+ let title = 'PTM: ' + ptm;
38921
+ if(title.length > 17) title = title.substr(0, 17) + '...';
38922
+ let fulltitle = ptm;
38923
+
38924
+ let linkStr = (bCoordinates) ? 'icn3d-link icn3d-blue' : '';
38925
+
38926
+ 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>';
38927
+ let htmlTmp3 = '<span class="icn3d-residueNum" title="residue count">' + resCnt.toString() + ' Res</span>';
38928
+ let htmlTmp = '<span class="icn3d-seqLine">';
38929
+ html3 += htmlTmp2 + htmlTmp3 + '<br>';
38930
+ html += htmlTmp2 + htmlTmp3 + htmlTmp;
38931
+ html2 += htmlTmp2 + htmlTmp3 + htmlTmp;
38932
+ let pre = 'ptm' + index.toString();
38933
+ //var widthPerRes = ic.seqAnnWidth / ic.maxAnnoLength;
38934
+ let prevEmptyWidth = 0;
38935
+ let prevLineWidth = 0;
38936
+ let widthPerRes = 1;
38937
+ for(let i = 0, il = ic.giSeq[chnid].length; i < il; ++i) {
38938
+ html += ic.showSeqCls.insertGap(chnid, i, '-');
38939
+ if(resPosArray.indexOf(i) != -1) {
38940
+ let cFull = ic.giSeq[chnid][i];
38941
+ let c = cFull;
38942
+ if(cFull.length > 1) {
38943
+ c = cFull[0] + '..';
38944
+ }
38945
+ let pos = ic.annoCddSiteCls.getAdjustedResi(i, chnid, ic.matchedPos, ic.chainsSeq, ic.baseResi);
38946
+
38947
+ html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" title="' + c + pos + '" class="icn3d-residue">' + cFull + '</span>';
38948
+ if(me.bNode) {
38949
+ let obj = {};
38950
+ obj[chnid + '_' + pos] = 'PTM: ' + ptm;
38951
+ ic.resid2ptm[chnid].push(obj);
38952
+ }
38953
+
38954
+ html2 += ic.showSeqCls.insertGapOverview(chnid, i);
38955
+ 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);
38956
+ //if(emptyWidth < 0) emptyWidth = 0;
38957
+ if(emptyWidth >= 0) {
38958
+ html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
38959
+ html2 += '<div style="display:inline-block; background-color:#000; width:' + widthPerRes + 'px;" title="' + c + pos + '">&nbsp;</div>';
38960
+ prevEmptyWidth += emptyWidth;
38961
+ prevLineWidth += widthPerRes;
38962
+ }
38963
+ }
38964
+ else {
38965
+ html += '<span>-</span>'; //'<span>-</span>';
38966
+ }
38967
+ }
38968
+ htmlTmp = '<span class="icn3d-residueNum" title="residue count">&nbsp;' + resCnt.toString() + ' Residues</span>';
38969
+ htmlTmp += '</span>';
38970
+ htmlTmp += '<br>';
38971
+ html += htmlTmp;
38972
+ html2 += htmlTmp;
38973
+
38974
+ ++index;
38975
+ }
38976
+
38977
+ html += '</div>';
38978
+ html2 += '</div>';
38979
+ html3 += '</div>';
38980
+
38981
+ $("#" + ic.pre + "dt_ptm_" + chnid).html(html);
38982
+ $("#" + ic.pre + "ov_ptm_" + chnid).html(html2);
38983
+ $("#" + ic.pre + "tt_ptm_" + chnid).html(html3);
38984
+
38985
+ // add here after the ajax call
38986
+ ic.showAnnoCls.enableHlSeq();
38987
+ ic.bAjaxPTM = true;
38988
+ }
38989
+
38990
+ getNoPTM(chnid) { let ic = this.icn3d; ic.icn3dui;
38991
+ console.log( "No PTM data were found for the chain " + chnid + "..." );
38992
+
38993
+ $("#" + ic.pre + "dt_ptm_" + chnid).html('');
38994
+ $("#" + ic.pre + "ov_ptm_" + chnid).html('');
38995
+ $("#" + ic.pre + "tt_ptm_" + chnid).html('');
38996
+
38997
+ // add here after the ajax call
38998
+ ic.showAnnoCls.enableHlSeq();
38999
+ ic.bAjaxPTM = true;
39000
+ if(ic.deferredPTM !== undefined) ic.deferredPTM.resolve();
39001
+ }
39002
+ }
39003
+
38622
39004
  /**
38623
39005
  * @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
38624
39006
  */
@@ -39748,11 +40130,11 @@ class AnnoSnpClinVar {
39748
40130
  if(ic.deferredClinvar !== undefined) ic.deferredClinvar.resolve();
39749
40131
  }
39750
40132
  }
39751
- showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
40133
+ showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
39752
40134
  let thisClass = this;
39753
40135
  //var url = "https://www.ncbi.nlm.nih.gov/projects/SNP/beVarSearch_mt.cgi?appname=iCn3D&format=bed&report=pdb2bed&acc=" + chnidBase;
39754
40136
  //var url = "https://www.ncbi.nlm.nih.gov/Structure/icn3d/clinvar.txt";
39755
- let url = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
40137
+ let url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
39756
40138
  if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
39757
40139
  url += "&gene=" + ic.chainsGene[chnid].geneSymbol;
39758
40140
  }
@@ -39787,7 +40169,7 @@ class AnnoSnpClinVar {
39787
40169
  });
39788
40170
  }
39789
40171
 
39790
- showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
40172
+ showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
39791
40173
  let thisClass = this;
39792
40174
  if(gi !== undefined) {
39793
40175
  /*
@@ -39806,7 +40188,7 @@ class AnnoSnpClinVar {
39806
40188
  } //if(data3 != "") {
39807
40189
  else {
39808
40190
  */
39809
- let url4 = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
40191
+ let url4 = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
39810
40192
  if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
39811
40193
  url4 += "&gene=" + ic.chainsGene[chnid].geneSymbol;
39812
40194
  }
@@ -39935,7 +40317,8 @@ class Annotation {
39935
40317
  this.setAnnoSeqBase(false);
39936
40318
  }
39937
40319
  setAnnoSeqBase(bShow) { let ic = this.icn3d; ic.icn3dui;
39938
- let itemArray = ['site', 'snp', 'clinvar', 'cdd', 'domain', 'interaction', 'ssbond', 'crosslink', 'transmem'];
40320
+ //let itemArray = ['site', 'ptm', 'snp', 'clinvar', 'cdd', 'domain', 'interaction', 'ssbond', 'crosslink', 'transmem'];
40321
+ let itemArray = ['cdd', 'clinvar', 'snp', 'site', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'interaction'];
39939
40322
  for(let i in itemArray) {
39940
40323
  let item = itemArray[i];
39941
40324
  if(bShow) {
@@ -39947,7 +40330,8 @@ class Annotation {
39947
40330
  }
39948
40331
  }
39949
40332
  setAnnoTabBase(bChecked) { let ic = this.icn3d; ic.icn3dui;
39950
- let itemArray = ['all', 'binding', 'snp', 'clinvar', 'cdd', '3dd', 'interact', 'custom', 'ssbond', 'crosslink', 'transmem'];
40333
+ //let itemArray = ['all', 'binding', 'ptm', 'snp', 'clinvar', 'cdd', '3dd', 'interact', 'custom', 'ssbond', 'crosslink', 'transmem'];
40334
+ let itemArray = ['all', 'cdd', 'clinvar', 'snp', 'binding', 'ptm', 'ssbond', 'crosslink', 'transmem', '3dd', 'custom', 'interact'];
39951
40335
  for(let i in itemArray) {
39952
40336
  let item = itemArray[i];
39953
40337
  if($("#" + ic.pre + "anno_" + item).length) $("#" + ic.pre + "anno_" + item)[0].checked = bChecked;
@@ -39959,10 +40343,11 @@ class Annotation {
39959
40343
  this.updateClinvar();
39960
40344
  this.updateSnp();
39961
40345
  this.updateDomain();
39962
- this.updateInteraction();
40346
+ this.updatePTM();
39963
40347
  this.updateSsbond();
39964
40348
  this.updateCrosslink();
39965
40349
  this.updateTransmem();
40350
+ this.updateInteraction();
39966
40351
  }
39967
40352
  hideAnnoTabAll() { let ic = this.icn3d; ic.icn3dui;
39968
40353
  this.setAnnoTabBase(false);
@@ -40015,6 +40400,11 @@ class Annotation {
40015
40400
  ic.bInteractionShown = false;
40016
40401
  this.updateInteraction();
40017
40402
  }
40403
+ if($("#" + ic.pre + "anno_ptm").length && $("#" + ic.pre + "anno_ptm")[0].checked) {
40404
+ $("[id^=" + ic.pre + "ptm]").show();
40405
+ ic.bPTMShown = false;
40406
+ this.updatePTM();
40407
+ }
40018
40408
  if($("#" + ic.pre + "anno_custom").length && $("#" + ic.pre + "anno_custom")[0].checked) {
40019
40409
  $("[id^=" + ic.pre + "custom]").show();
40020
40410
  }
@@ -40096,6 +40486,15 @@ class Annotation {
40096
40486
  $("[id^=" + ic.pre + "interaction]").hide();
40097
40487
  if($("#" + ic.pre + "anno_interact").length) $("#" + ic.pre + "anno_interact")[0].checked = false;
40098
40488
  }
40489
+ setAnnoTabPTM() { let ic = this.icn3d; ic.icn3dui;
40490
+ $("[id^=" + ic.pre + "ptm]").show();
40491
+ if($("#" + ic.pre + "anno_ptm").length) $("#" + ic.pre + "anno_ptm")[0].checked = true;
40492
+ this.updatePTM();
40493
+ }
40494
+ hideAnnoTabPTM() { let ic = this.icn3d; ic.icn3dui;
40495
+ $("[id^=" + ic.pre + "ptm]").hide();
40496
+ if($("#" + ic.pre + "anno_ptm").length) $("#" + ic.pre + "anno_ptm")[0].checked = false;
40497
+ }
40099
40498
  setAnnoTabSsbond() { let ic = this.icn3d; ic.icn3dui;
40100
40499
  $("[id^=" + ic.pre + "ssbond]").show();
40101
40500
  if($("#" + ic.pre + "anno_ssbond").length) $("#" + ic.pre + "anno_ssbond")[0].checked = true;
@@ -40207,6 +40606,17 @@ class Annotation {
40207
40606
  }
40208
40607
  });
40209
40608
 
40609
+ me.myEventCls.onIds("#" + ic.pre + "anno_ptm", "click", function(e) {
40610
+ if($("#" + ic.pre + "anno_ptm")[0].checked) {
40611
+ thisClass.setAnnoTabPTM();
40612
+ me.htmlCls.clickMenuCls.setLogCmd("set annotation ptm", true);
40613
+ }
40614
+ else {
40615
+ thisClass.hideAnnoTabPTM();
40616
+ me.htmlCls.clickMenuCls.setLogCmd("hide annotation ptm", true);
40617
+ }
40618
+ });
40619
+
40210
40620
  //$("#" + ic.pre + "anno_custom", "click", function(e) {
40211
40621
  me.myEventCls.onIds("#" + ic.pre + "anno_custom", "click", function(e) {
40212
40622
  if($("#" + ic.pre + "anno_custom")[0].checked) {
@@ -40302,7 +40712,7 @@ class Annotation {
40302
40712
  }
40303
40713
  }
40304
40714
  setAnnoDisplay(display, prefix) { let ic = this.icn3d; ic.icn3dui;
40305
- let itemArray = ['giseq', 'custom', 'site', 'snp', 'clinvar', 'cdd', 'domain', 'interaction', 'ssbond', 'crosslink', 'transmem'];
40715
+ let itemArray = ['giseq', 'custom', 'site', 'ptm', 'snp', 'clinvar', 'cdd', 'domain', 'interaction', 'ssbond', 'crosslink', 'transmem'];
40306
40716
  for(let i in itemArray) {
40307
40717
  let item = itemArray[i];
40308
40718
  $("[id^=" + ic.pre + prefix + "_" + item + "]").attr('style', display);
@@ -40373,6 +40783,15 @@ class Annotation {
40373
40783
  }
40374
40784
  ic.bInteractionShown = true;
40375
40785
  }
40786
+ updatePTM() { let ic = this.icn3d; ic.icn3dui;
40787
+ if(ic.bPTMShown === undefined || !ic.bPTMShown) {
40788
+ for(let chainid in ic.PTMChainbase) {
40789
+ let chainidBase = ic.PTMChainbase[chainid];
40790
+ ic.annoPTMCls.showPTM(chainid, chainidBase);
40791
+ }
40792
+ }
40793
+ ic.bPTMShown = true;
40794
+ }
40376
40795
  updateSsbond() { let ic = this.icn3d; ic.icn3dui;
40377
40796
  if(ic.bSSbondShown === undefined || !ic.bSSbondShown) {
40378
40797
  for(let chainid in ic.ssbondChainbase) {
@@ -42106,9 +42525,12 @@ class Selection {
42106
42525
 
42107
42526
  //Show the selection.
42108
42527
  showSelection() { let ic = this.icn3d, me = ic.icn3dui;
42109
- ic.dAtoms = {};
42528
+ //ic.dAtoms = {};
42110
42529
 
42111
- if(Object.keys(ic.hAtoms).length == 0) this.selectAll_base();
42530
+ if(Object.keys(ic.hAtoms).length == 0) {
42531
+ //this.selectAll_base();
42532
+ ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
42533
+ }
42112
42534
 
42113
42535
  ic.dAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
42114
42536
  ic.viewSelectionAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
@@ -42749,11 +43171,14 @@ class SetStyle {
42749
43171
  console.log("WebGL context was lost. Reset WebGLRenderer and launch iCn3D again.");
42750
43172
 
42751
43173
  ic.renderer = new THREE.WebGLRenderer({
42752
- canvas: ic.container.get(0),
42753
- antialias: true,
42754
- preserveDrawingBuffer: true,
42755
- alpha: true
43174
+ canvas: ic.oriContainer.get(0), //this.container.get(0),
43175
+ antialias: true,
43176
+ preserveDrawingBuffer: true,
43177
+ sortObjects: false,
43178
+ alpha: true
42756
43179
  });
43180
+ // Enable VR
43181
+ ic.renderer.xr.enabled = true;
42757
43182
 
42758
43183
  ic.drawCls.draw();
42759
43184
 
@@ -43962,7 +44387,8 @@ class ApplySymd {
43962
44387
  }
43963
44388
  else { // bSymd, subset, and one chain
43964
44389
  if(Object.keys(ic.hAtoms).length == 0) {
43965
- ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
44390
+ //ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
44391
+ ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
43966
44392
  }
43967
44393
 
43968
44394
  // pick the first 1/order of selection
@@ -44612,7 +45038,8 @@ class VRButton {
44612
45038
  button.style.display = '';
44613
45039
 
44614
45040
  button.style.cursor = 'pointer';
44615
- button.style.left = 'calc(50% - 50px)';
45041
+ //button.style.left = 'calc(50% - 50px)';
45042
+ button.style.left = 'calc(33% - 50px)';
44616
45043
  button.style.width = '100px';
44617
45044
 
44618
45045
  button.textContent = 'ENTER VR';
@@ -44666,7 +45093,7 @@ class VRButton {
44666
45093
  button.style.display = '';
44667
45094
 
44668
45095
  button.style.cursor = 'auto';
44669
- button.style.left = 'calc(50% - 75px)';
45096
+ button.style.left = 'calc(33% - 75px)'; //'calc(50% - 75px)';
44670
45097
  button.style.width = '150px';
44671
45098
 
44672
45099
  button.onmouseenter = null;
@@ -44859,7 +45286,8 @@ class ARButton {
44859
45286
  button.style.display = '';
44860
45287
 
44861
45288
  button.style.cursor = 'pointer';
44862
- button.style.left = 'calc(50% - 50px)';
45289
+ //button.style.left = 'calc(50% - 50px)';
45290
+ button.style.left = 'calc(66% - 50px)';
44863
45291
  button.style.width = '100px';
44864
45292
 
44865
45293
  button.textContent = 'START AR';
@@ -44907,7 +45335,7 @@ class ARButton {
44907
45335
  button.style.display = '';
44908
45336
 
44909
45337
  button.style.cursor = 'auto';
44910
- button.style.left = 'calc(50% - 75px)';
45338
+ button.style.left = 'calc(66% - 50px)'; //'calc(50% - 75px)';
44911
45339
  button.style.width = '150px';
44912
45340
 
44913
45341
  button.onmouseenter = null;
@@ -45004,7 +45432,7 @@ class ARButton {
45004
45432
 
45005
45433
  }
45006
45434
 
45007
- message.style.left = 'calc(50% - 90px)';
45435
+ message.style.left = 'calc(66% - 90px)'; //'calc(50% - 90px)';
45008
45436
  message.style.width = '180px';
45009
45437
  message.style.textDecoration = 'none';
45010
45438
 
@@ -53386,9 +53814,17 @@ class ClickMenu {
53386
53814
  // },
53387
53815
  // clkMn1_chainalign: function() {
53388
53816
  me.myEventCls.onIds("#" + me.pre + "mn1_chainalign", "click", function(e) { me.icn3d;
53389
- me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains of 3D structures');
53817
+ me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains by structure alignment');
53390
53818
  });
53391
53819
 
53820
+ me.myEventCls.onIds("#" + me.pre + "mn1_chainalign2", "click", function(e) { me.icn3d;
53821
+ me.htmlCls.dialogCls.openDlg('dl_chainalign2', 'Align multiple chains by sequence alignment');
53822
+ });
53823
+
53824
+ me.myEventCls.onIds("#" + me.pre + "mn1_chainalign3", "click", function(e) { me.icn3d;
53825
+ me.htmlCls.dialogCls.openDlg('dl_chainalign3', 'Align multiple chains residue by residue');
53826
+ });
53827
+
53392
53828
  me.myEventCls.onIds("#" + me.pre + "mn1_mutation", "click", function(e) { me.icn3d;
53393
53829
  me.htmlCls.dialogCls.openDlg('dl_mutation', 'Show the mutations in 3D');
53394
53830
  });
@@ -53567,6 +54003,12 @@ class ClickMenu {
53567
54003
  thisClass.setLogCmd("export pqr", true);
53568
54004
  });
53569
54005
 
54006
+ me.myEventCls.onIds(["#" + me.pre + "delphipdbh", "#" + me.pre + "phipqr", "#" + me.pre + "phiurlpqr"], "click", function(e) { me.icn3d;
54007
+ let bPdb = true;
54008
+ me.htmlCls.setHtmlCls.exportPqr(bPdb);
54009
+ thisClass.setLogCmd("export pdbh", false);
54010
+ });
54011
+
53570
54012
  // clkMn1_exportStl: function() {
53571
54013
  me.myEventCls.onIds("#" + me.pre + "mn1_exportStl", "click", function(e) { let ic = me.icn3d;
53572
54014
  thisClass.setLogCmd("export stl file", false);
@@ -55934,11 +56376,12 @@ class SetMenu {
55934
56376
 
55935
56377
  html += "<li><span>Retrieve by ID</span>";
55936
56378
  html += "<ul>";
56379
+
56380
+ html += me.htmlCls.setHtmlCls.getLink('mn1_mmdbafid', 'PDB/MMDB/AlphaFold IDs' + me.htmlCls.wifiStr);
55937
56381
  html += me.htmlCls.setHtmlCls.getLink('mn1_mmdbid', 'MMDB ID ' + me.htmlCls.wifiStr);
55938
56382
  html += me.htmlCls.setHtmlCls.getLink('mn1_mmtfid', 'MMTF ID ' + me.htmlCls.wifiStr);
55939
56383
  html += me.htmlCls.setHtmlCls.getLink('mn1_pdbid', 'PDB ID ' + me.htmlCls.wifiStr);
55940
56384
  html += me.htmlCls.setHtmlCls.getLink('mn1_afid', 'AlphaFold UniProt ID ' + me.htmlCls.wifiStr);
55941
- html += me.htmlCls.setHtmlCls.getLink('mn1_mmdbafid', 'MMDB or AlphaFold IDs' + me.htmlCls.wifiStr);
55942
56385
  if(!me.cfg.simplemenu) {
55943
56386
  html += me.htmlCls.setHtmlCls.getLink('mn1_opmid', 'OPM PDB ID ' + me.htmlCls.wifiStr);
55944
56387
  html += me.htmlCls.setHtmlCls.getLink('mn1_mmcifid', 'mmCIF ID ' + me.htmlCls.wifiStr);
@@ -55981,15 +56424,22 @@ class SetMenu {
55981
56424
  html += "</li>";
55982
56425
  html += "<li><span>Align</span>";
55983
56426
  html += "<ul>";
55984
- html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
55985
- //html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Structure to Structure ' + me.htmlCls.wifiStr);
56427
+
56428
+ html += "<li><span>Multiple Chains</span>";
56429
+ html += "<ul>";
56430
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign', 'by Structure Alignment ' + me.htmlCls.wifiStr);
56431
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign2', 'by Sequence Alignment ' + me.htmlCls.wifiStr);
56432
+ html += me.htmlCls.setHtmlCls.getRadio('mn1_chainalignRad', 'mn1_chainalign3', 'Residue by Residue');
56433
+ html += "</ul>";
56434
+ html += "</li>";
56435
+
55986
56436
  html += "<li><span>Structure to Structure</span>";
55987
56437
  html += "<ul>";
55988
56438
  html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Two PDB Structures ' + me.htmlCls.wifiStr);
55989
56439
  html += me.htmlCls.setHtmlCls.getLink('mn1_alignaf', 'Two AlphaFold Structures ' + me.htmlCls.wifiStr);
55990
56440
  html += "</ul>";
55991
56441
 
55992
- html += me.htmlCls.setHtmlCls.getLink('mn1_chainalign', 'Multiple Chains ' + me.htmlCls.wifiStr);
56442
+ html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
55993
56443
 
55994
56444
  html += "</ul>";
55995
56445
  html += "</li>";
@@ -56033,7 +56483,7 @@ class SetMenu {
56033
56483
  html += "</ul>";
56034
56484
  html += "</li>";
56035
56485
 
56036
- html += "<li><span>Save Files</span>";
56486
+ html += "<li><span>Save File</span>";
56037
56487
  html += "<ul>";
56038
56488
  //html += me.htmlCls.setHtmlCls.getLink('mn1_exportCanvas', 'iCn3D PNG Image');
56039
56489
 
@@ -56065,6 +56515,7 @@ class SetMenu {
56065
56515
  */
56066
56516
 
56067
56517
  html += me.htmlCls.setHtmlCls.getLink('mn1_exportPdbRes', 'PDB');
56518
+ html += me.htmlCls.setHtmlCls.getLink('delphipdbh', 'PDB with Hydrogens');
56068
56519
 
56069
56520
  if(me.cfg.cid === undefined) {
56070
56521
  html += me.htmlCls.setHtmlCls.getLink('mn1_exportSecondary', 'Secondary Structure');
@@ -56638,7 +57089,7 @@ class SetMenu {
56638
57089
 
56639
57090
  html += "<ul class='icn3d-mn-item'>";
56640
57091
 
56641
- html += "<li><span style='padding-left:1.5em;'>Unicolor</span>";
57092
+ html += "<li><span style='padding-left:1.5em!important;'>Unicolor</span>";
56642
57093
  html += "<ul>";
56643
57094
 
56644
57095
  html += "<li><span>Red</span>";
@@ -56845,7 +57296,7 @@ class SetMenu {
56845
57296
 
56846
57297
  if(me.cfg.cid === undefined) {
56847
57298
  //html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrRainbow', 'Rainbow (R-V)');
56848
- html += "<li><span style='padding-left:1.5em;'>Rainbow (R-V)</span>";
57299
+ html += "<li><span style='padding-left:1.5em!important;'>Rainbow (R-V)</span>";
56849
57300
  html += "<ul>";
56850
57301
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrRainbow', 'for Selection');
56851
57302
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrRainbowChain', 'for Chains');
@@ -56854,7 +57305,7 @@ class SetMenu {
56854
57305
 
56855
57306
  if(!me.cfg.simplemenu) {
56856
57307
  //html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSpectrum', 'Spectrum (V-R)');
56857
- html += "<li><span style='padding-left:1.5em;'>Spectrum (V-R)</span>";
57308
+ html += "<li><span style='padding-left:1.5em!important;'>Spectrum (V-R)</span>";
56858
57309
  html += "<ul>";
56859
57310
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSpectrum', 'for Selection');
56860
57311
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSpectrumChain', 'for Chains');
@@ -56862,7 +57313,7 @@ class SetMenu {
56862
57313
  html += "</ul>";
56863
57314
  }
56864
57315
 
56865
- html += "<li><span style='padding-left:1.5em;'>Secondary</span>";
57316
+ html += "<li><span style='padding-left:1.5em!important;'>Secondary</span>";
56866
57317
  html += "<ul>";
56867
57318
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSSGreen', 'Sheet in Green');
56868
57319
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrSSYellow', 'Sheet in Yellow');
@@ -56877,13 +57328,13 @@ class SetMenu {
56877
57328
 
56878
57329
  //html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrHydrophobic', 'Wimley-White<br><span style="padding-left:1.5em;">Hydrophobicity</span>');
56879
57330
 
56880
- html += "<li><span style='padding-left:1.5em;'>Hydrophobicity</span>";
57331
+ html += "<li><span style='padding-left:1.5em!important;'>Hydrophobicity</span>";
56881
57332
  html += "<ul>";
56882
57333
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrNormalizedHP', 'Normalized');
56883
57334
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrHydrophobic', 'Wimley-White');
56884
57335
  html += "</ul>";
56885
57336
 
56886
- html += "<li><span style='padding-left:1.5em;'>B-factor</span>";
57337
+ html += "<li><span style='padding-left:1.5em!important;'>B-factor</span>";
56887
57338
  html += "<ul>";
56888
57339
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrBfactor', 'Original');
56889
57340
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrBfactorNorm', 'Percentile');
@@ -56906,7 +57357,7 @@ class SetMenu {
56906
57357
 
56907
57358
  if(me.cfg.cid === undefined) {
56908
57359
  if(!me.cfg.simplemenu) {
56909
- html += "<li><span style='padding-left:1.5em;'>Defined Sets</span>";
57360
+ html += "<li><span style='padding-left:1.5em!important;'>Defined Sets</span>";
56910
57361
  html += "<ul>";
56911
57362
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrsets', 'Rainbow for Selected Sets<br>in "Analysis > Defined Sets"');
56912
57363
  html += "</ul>";
@@ -56915,7 +57366,7 @@ class SetMenu {
56915
57366
 
56916
57367
  //html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrResidue', 'Residue');
56917
57368
 
56918
- html += "<li><span style='padding-left:1.5em;'>Residue</span>";
57369
+ html += "<li><span style='padding-left:1.5em!important;'>Residue</span>";
56919
57370
  html += "<ul>";
56920
57371
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrResidue', 'Default');
56921
57372
  html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrResidueCustom', 'Custom');
@@ -57219,17 +57670,29 @@ class SetMenu {
57219
57670
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#about' target='_blank'>About iCn3D<span style='font-size:0.9em'> " + me.REVISION + "</span></a></li>";
57220
57671
 
57221
57672
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#gallery' target='_blank'>Live Gallery " + me.htmlCls.wifiStr + "</a></li>";
57673
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#videos' target='_blank'>iCn3D Videos</a></li>";
57674
+
57675
+ html += "<li><span>FAQ</span>";
57222
57676
 
57223
- html += "<li><span>Tutorial</span>";
57224
57677
  html += "<ul>";
57225
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#useicn3d' target='_blank'>Use iCn3D</a></li>";
57226
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#videos' target='_blank'>iCn3D Videos</a></li>";
57227
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#parameters' target='_blank'>URL Parameters</a></li>";
57228
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#commands' target='_blank'>Commands</a></li>";
57678
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#viewstru' target='_blank'><span>View structure</span></a></li>";
57679
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#tfstru' target='_blank'><span>Transform Structure</span></a></li>";
57680
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#selsubset' target='_blank'><span>Select Subsets</span></a></li>";
57681
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#changestylecolor' target='_blank'><span>Change Style/Color</span></a></li>";
57682
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#saveview' target='_blank'><span>Save Work</span></a></li>";
57683
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#showanno' target='_blank'><span>Show Annotations</span></a></li>";
57684
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#exportanno' target='_blank'><span>Export Annotations</span></a></li>";
57685
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#interanalysis' target='_blank'><span>Interactions Analysis</span></a></li>";
57686
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#mutationanalysis' target='_blank'><span>Mutation Analysis</span></a></li>";
57687
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#elecpot' target='_blank'><span>Electrostatic Pot.</span></a></li>";
57688
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#simivast' target='_blank'><span>Similar PDB</span></a></li>";
57689
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#simifoldseek' target='_blank'><span>Similar AlphaFold/PDB</span></a></li>";
57690
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#alignmul' target='_blank'><span>Align Multiple Structures</span></a></li>";
57691
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#batchanalysis' target='_blank'><span>Batch Analysis</span></a></li>";
57692
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#embedicn3d' target='_blank'><span>Embed iCn3D</span></a></li>";
57229
57693
  html += "</ul>";
57230
- html += "</li>";
57231
57694
 
57232
- html += liStr + "https://www.ncbi.nlm.nih.gov/structure' target='_blank'>Search Structure " + me.htmlCls.wifiStr + "</a></li>";
57695
+ //html += liStr + "https://www.ncbi.nlm.nih.gov/structure' target='_blank'>Search Structure " + me.htmlCls.wifiStr + "</a></li>";
57233
57696
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#citing' target='_blank'>Citing iCn3D</a></li>";
57234
57697
 
57235
57698
  html += "<li><span>Source Code</span>";
@@ -57243,7 +57706,10 @@ class SetMenu {
57243
57706
  if(!me.cfg.simplemenu) {
57244
57707
  html += "<li><span>Develop</span>";
57245
57708
  html += "<ul>";
57246
- html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#HowToUse' target='_blank'>How to Embed</a></li>";
57709
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#HowToUse' target='_blank'>Embed iCn3D</a></li>";
57710
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#parameters' target='_blank'>URL Parameters</a></li>";
57711
+ html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#commands' target='_blank'>Commands</a></li>";
57712
+
57247
57713
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#datastructure' target='_blank'>Data Structure</a></li>";
57248
57714
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#classstructure' target='_blank'>Class Structure</a></li>";
57249
57715
  html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#addclass' target='_blank'>Add New Classes</a></li>";
@@ -58011,8 +58477,8 @@ class SetDialog {
58011
58477
  html += "</div>";
58012
58478
 
58013
58479
  html += me.htmlCls.divStr + "dl_foldseek' class='" + dialogClass + "' style='max-width:500px'>";
58014
- 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>';
58015
- html += "Chain ID List: " + me.htmlCls.inputTextStr + "id='" + me.pre + "foldseekchainids' value='P69905_A,P01942_A,1HHO_A' size=30> ";
58480
+ 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>';
58481
+ html += "Chain ID List: " + me.htmlCls.inputTextStr + "id='" + me.pre + "foldseekchainids' value='P69905,P01942,1hho_A' size=30> ";
58016
58482
  html += me.htmlCls.buttonStr + "reload_foldseek'>Align</button>";
58017
58483
  html += "</div>";
58018
58484
 
@@ -58102,25 +58568,51 @@ class SetDialog {
58102
58568
  html += "<div style='width:550px'>";
58103
58569
  html += "All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID (e.g., P69905 for AlphaFold structures).<br/><br/>";
58104
58570
  html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
58105
- html += "<b>Optional 1</b>, full chains are used for structure alignment<br/><br/>";
58106
- html += "<b>Optional 2</b>, sequence alignment (followed by structure alignemnt) based on residue numbers in the First/Master chain: <br>" + me.htmlCls.inputTextStr + "id='" + me.pre + "resalignids' placeholder='1,5,10-50' size=50><br/><br/>";
58107
- html += "<b>Optional 3</b>, predefined alignment with the first chain as the master. The rest chains are aligned to the master chain. Each alignment is defined as \" | \"-separated residue lists in one line. \"10-50\" means a range of residues from 10 to 50.<br><textarea id='" + me.pre + "predefinedres' rows='5' style='width: 100%; height: " +(me.htmlCls.LOG_HEIGHT) + "px; padding: 0px; border: 0px;' placeholder='1,5,10-50 | 1,5,10-50 \n2,6,11-51 | 1,5,10-50'></textarea><br/><br/>";
58108
- //html += me.htmlCls.buttonStr + "reload_chainalign_asym'>Align Asymmetric Unit</button>" + me.htmlCls.buttonStr + "reload_chainalign' style='margin-left:30px'>Align Biological Unit</button><br/><br/>";
58109
- html += me.htmlCls.buttonStr + "reload_chainalign_tmalign'>Align with TM-align</button>" + me.htmlCls.buttonStr + "reload_chainalign_asym' style='margin-left:30px'>Align with VAST</button><br/><br/>";
58571
+ 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/>";
58572
+
58573
+ 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>";
58574
+ html += "</div></div>";
58575
+
58576
+ html += me.htmlCls.divStr + "dl_chainalign2' class='" + dialogClass + "'>";
58577
+ html += "<div style='width:550px'>";
58578
+ 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/>";
58579
+ html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids2' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
58580
+
58581
+ 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/>";
58582
+ html += me.htmlCls.buttonStr + "reload_chainalign_asym2' style='margin-top:3px;'><b>Align by Sequence Alignment</b></button><br/><br/>";
58583
+
58584
+ 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>";
58585
+ html += "</div></div>";
58586
+
58587
+ html += me.htmlCls.divStr + "dl_chainalign3' class='" + dialogClass + "'>";
58588
+ html += "<div style='width:550px'>";
58589
+ 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/>";
58590
+ html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids3' value='P69905,P01942,1HHO_A' size=50><br/><br/>";
58591
+
58592
+ 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/>";
58593
+ html += me.htmlCls.buttonStr + "reload_chainalign_asym3'><b>Align Residue by Residue</b></button><br/><br/>";
58110
58594
 
58111
58595
  html += "(Note: To align chains in custom PDB files, you could load them in \"File > Open File > PDB Files (appendable)\" and click \"Analysis > Defined Sets\". Finally select multiple chains in Defined Sets and click \"File > Realign Selection\".)<br><br>";
58112
58596
  html += "</div></div>";
58113
58597
 
58114
58598
  html += me.htmlCls.divStr + "dl_mutation' class='" + dialogClass + "'>";
58115
58599
  html += "<div style='width:500px'>";
58116
- html += 'Please specify the mutations with a comma separated mutation list. Each mutation can be specified as "[PDB ID]_[Chain ID]_[Residue Number]_[One Letter Mutatnt Residue]". E.g., the mutation of N501Y in the E chain of PDB 6M0J can be specified as "6M0J_E_501_Y". <br/><br/>';
58600
+ html += 'Please specify the mutations with a comma separated mutation list. Each mutation can be specified as "[PDB ID or AlphaFold UniProt ID]_[Chain ID]_[Residue Number]_[One Letter Mutatnt Residue]". E.g., the mutation of N501Y in the E chain of PDB 6M0J can be specified as "6M0J_E_501_Y". For AlphaFold structures, the "Chain ID" is "A".<br/><br/>';
58117
58601
  html += "<div style='display:inline-block; width:110px'>Mutations: </div>" + me.htmlCls.inputTextStr + "id='" + me.pre + "mutationids' value='6M0J_E_484_K,6M0J_E_501_Y,6M0J_E_417_N' size=50><br/><br/>";
58118
58602
 
58119
- html += "<b>Data Source</b>: <select id='" + me.pre + "idsource'>";
58120
- html += "<option value='mmdbid' selected>PDB ID</option>";
58121
- html += "<option value='afid'>AlphaFold UniProt ID</option>";
58122
- html += "</select><br/><br/>";
58123
-
58603
+ // html += "<b>Data Source</b>: <select id='" + me.pre + "idsource'>";
58604
+ // html += "<option value='mmdbid' selected>PDB ID</option>";
58605
+ // html += "<option value='afid'>AlphaFold UniProt ID</option>";
58606
+ // html += "</select><br/><br/>";
58607
+
58608
+ html += '<b>ID Type</b>: ';
58609
+ html += '<input type="radio" name="' + me.pre + 'idsource" id="' + me.pre + 'type_mmdbid" value="mmdbid" checked>PDB ID';
58610
+ html += '<input type="radio" name="' + me.pre + 'idsource" id="' + me.pre + 'type_afid" value="afid" style="margin-left:20px">AlphaFold UniProt ID<br><br>';
58611
+
58612
+ html += '<b>Show Mutation in</b>: ';
58613
+ html += '<input type="radio" name="' + me.pre + 'pdbsource" id="' + me.pre + 'showin_currentpage" value="currentpage">Current Page';
58614
+ html += '<input type="radio" name="' + me.pre + 'pdbsource" id="' + me.pre + 'showin_newpage" value="newpage" style="margin-left:20px" checked>New Page<br><br>';
58615
+
58124
58616
  html += me.htmlCls.buttonStr + "reload_mutation_3d' title='Show the mutations in 3D using the scap program'>3D with scap</button>";
58125
58617
  html += me.htmlCls.buttonStr + "reload_mutation_inter' style='margin-left:20px' title='Show the mutations in 3D and the change of interactions'>Interactions</button>";
58126
58618
  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>";
@@ -58204,7 +58696,7 @@ class SetDialog {
58204
58696
  html += "</div>";
58205
58697
 
58206
58698
  html += me.htmlCls.divStr + "dl_yournote' class='" + dialogClass + "'>";
58207
- html += "Your note will be saved in the HTML file when you click \"File > Save Files > iCn3D PNG Image\".<br><br>";
58699
+ html += "Your note will be saved in the HTML file when you click \"File > Save File > iCn3D PNG Image\".<br><br>";
58208
58700
  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>";
58209
58701
  html += me.htmlCls.buttonStr + "applyyournote'>Save</button>";
58210
58702
  html += "</div>";
@@ -58959,10 +59451,17 @@ class SetDialog {
58959
59451
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_custom'>Custom" + me.htmlCls.space2 + "</span></td>";
58960
59452
  html += tmpStr2 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_3dd'>3D Domains" + me.htmlCls.space2 + "</span></td>";
58961
59453
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_snp'>SNPs" + me.htmlCls.space2 + "</span></td>";
58962
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_interact'>Interactions" + me.htmlCls.space2 + "</span></td>";
59454
+
59455
+ // if(me.cfg.mmdbid != undefined || me.cfg.pdbid != undefined || me.cfg.mmtfid != undefined || me.cfg.mmcifid != undefined) { // PDB
59456
+ // html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ptm' disabled>PTM (UniProt)" + me.htmlCls.space2 + "</span></td>";
59457
+ // }
59458
+ // else {
59459
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ptm'>PTM (UniProt)" + me.htmlCls.space2 + "</span></td>";
59460
+ // }
58963
59461
  html += "<td></td>";
58964
59462
  html += "</tr><tr>";
58965
59463
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ssbond'>Disulfide Bonds" + me.htmlCls.space2 + "</span></td>";
59464
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_interact'>Interactions" + me.htmlCls.space2 + "</span></td>";
58966
59465
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_crosslink'>Cross-Linkages" + me.htmlCls.space2 + "</span></td>";
58967
59466
  if(me.cfg.opmid !== undefined) {
58968
59467
  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>";
@@ -59001,6 +59500,17 @@ class Events {
59001
59500
  }
59002
59501
  }
59003
59502
 
59503
+ convertUniProtInChains(alignment) { let me = this.icn3dui; me.icn3d;
59504
+ let idArray = alignment.split(',');
59505
+ let alignment_final = '';
59506
+ for(let i = 0, il = idArray.length; i < il; ++i) {
59507
+ alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59508
+ if(i < il - 1) alignment_final += ',';
59509
+ }
59510
+
59511
+ return alignment_final;
59512
+ }
59513
+
59004
59514
  searchSeq() { let me = this.icn3dui, ic = me.icn3d;
59005
59515
  let select = $("#" + me.pre + "search_seq").val();
59006
59516
  if(isNaN(select) && select.indexOf('$') == -1 && select.indexOf('.') == -1 && select.indexOf(':') == -1 && select.indexOf('@') == -1) {
@@ -59097,7 +59607,7 @@ class Events {
59097
59607
 
59098
59608
  saveHtml(id) { let me = this.icn3dui, ic = me.icn3d;
59099
59609
  let html = '';
59100
- html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/lib/jquery-ui-1.12.1.min.css">\n';
59610
+ html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/lib/jquery-ui-1.13.2.min.css">\n';
59101
59611
  html += '<link rel="stylesheet" href="https:///structure.ncbi.nlm.nih.gov/icn3d/icn3d_full_ui.css">\n';
59102
59612
  html += $("#" + id).html();
59103
59613
  let idArray = id.split('_');
@@ -59107,24 +59617,6 @@ class Events {
59107
59617
  ic.saveFileCls.saveFile(structureStr + '-' + idStr + '.html', 'html', encodeURIComponent(html));
59108
59618
  }
59109
59619
 
59110
- getAlignParas() { let me = this.icn3dui; me.icn3d;
59111
- let alignment = $("#" + me.pre + "chainalignids").val();
59112
- let idArray = alignment.split(',');
59113
- let alignment_final = '';
59114
- for(let i = 0, il = idArray.length; i < il; ++i) {
59115
- alignment_final += (idArray[i].indexOf('_') != -1) ? idArray[i] : idArray[i] + '_A'; // AlphaFold ID
59116
- if(i < il - 1) alignment_final += ',';
59117
- }
59118
- let resalign = $("#" + me.pre + "resalignids").val();
59119
- let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
59120
- if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
59121
- var aaa = 1; //alert("Please make sure the number of chains and the lines of predefined residues are the same...");
59122
- return;
59123
- }
59124
-
59125
- return {"alignment": alignment_final, "resalign": resalign, "predefinedres": predefinedres};
59126
- }
59127
-
59128
59620
  //Hold all functions related to click events.
59129
59621
  allEventFunctions() { let me = this.icn3dui, ic = me.icn3d;
59130
59622
  let thisClass = this;
@@ -59281,6 +59773,8 @@ class Events {
59281
59773
  // },
59282
59774
  // clickRealignonseqalign: function() {
59283
59775
  me.myEventCls.onIds("#" + me.pre + "mn2_realignonseqalign", "click", function(e) { let ic = me.icn3d;
59776
+ if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
59777
+
59284
59778
  if(Object.keys(ic.structures).length < 2) {
59285
59779
  var aaa = 1; //alert("At least two structuresare required for alignment...");
59286
59780
  return;
@@ -59296,15 +59790,14 @@ class Events {
59296
59790
  if($("#" + me.pre + "atomsCustomRealign").length) {
59297
59791
  $("#" + me.pre + "atomsCustomRealign").html(definedAtomsHtml);
59298
59792
  }
59299
- //if($("#" + me.pre + "atomsCustomRealign2").length) {
59300
- // $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
59301
- //}
59302
- if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
59793
+
59303
59794
  $("#" + me.pre + "atomsCustomRealign").resizable();
59304
59795
  //$("#" + me.pre + "atomsCustomRealign2").resizable();
59305
59796
  });
59306
59797
 
59307
59798
  me.myEventCls.onIds("#" + me.pre + "mn2_realignonstruct", "click", function(e) { let ic = me.icn3d;
59799
+ if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
59800
+
59308
59801
  if(Object.keys(ic.structures).length < 2) {
59309
59802
  var aaa = 1; //alert("At least two structuresare required for alignment...");
59310
59803
  return;
@@ -59319,10 +59812,7 @@ class Events {
59319
59812
  if($("#" + me.pre + "atomsCustomRealignByStruct").length) {
59320
59813
  $("#" + me.pre + "atomsCustomRealignByStruct").html(definedAtomsHtml);
59321
59814
  }
59322
- //if($("#" + me.pre + "atomsCustomRealign2").length) {
59323
- // $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
59324
- //}
59325
- if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
59815
+
59326
59816
  $("#" + me.pre + "atomsCustomRealignByStruct").resizable();
59327
59817
  //$("#" + me.pre + "atomsCustomRealign2").resizable();
59328
59818
  });
@@ -59359,10 +59849,7 @@ class Events {
59359
59849
  ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
59360
59850
  }
59361
59851
 
59362
- // save the current selection
59363
- //ic.selectionCls.saveSelectionPrep();
59364
- //let name = 'realignSetsByStruct';
59365
- //ic.selectionCls.saveSelection(name, name);
59852
+ me.cfg.aligntool = 'vast';
59366
59853
 
59367
59854
  ic.realignParserCls.realignOnStructAlign();
59368
59855
  if(nameArray.length > 0) {
@@ -59494,8 +59981,16 @@ class Events {
59494
59981
  me.myEventCls.onIds("#" + me.pre + "reload_foldseek", "click", function(e) { me.icn3d;
59495
59982
  e.preventDefault();
59496
59983
  if(!me.cfg.notebook) dialog.dialog( "close" );
59497
- me.htmlCls.clickMenuCls.setLogCmd("load chainalignment " + $("#" + me.pre + "foldseekchainids").val(), true);
59498
- window.open(hostUrl + '?chainalign=' + $("#" + me.pre + "foldseekchainids").val(), '_self');
59984
+
59985
+ // me.htmlCls.clickMenuCls.setLogCmd("load chainalignment " + $("#" + me.pre + "foldseekchainids").val(), true);
59986
+ // window.open(hostUrl + '?chainalign=' + $("#" + me.pre + "foldseekchainids").val(), '_self');
59987
+
59988
+
59989
+ let alignment = $("#" + me.pre + "foldseekchainids").val();
59990
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
59991
+
59992
+ me.htmlCls.clickMenuCls.setLogCmd("load chainalignment " + alignment_final, true);
59993
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&aligntool=tmalign&showalignseq=1&bu=0', '_self');
59499
59994
  });
59500
59995
 
59501
59996
  me.myEventCls.onIds("#" + me.pre + "reload_mmtf", "click", function(e) { me.icn3d;
@@ -59631,85 +60126,197 @@ class Events {
59631
60126
  });
59632
60127
  // },
59633
60128
  // clickReload_chainalign: function() {
59634
- me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { me.icn3d;
60129
+ /*
60130
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { let ic = me.icn3d;
59635
60131
  e.preventDefault();
59636
60132
  if(!me.cfg.notebook) dialog.dialog( "close" );
59637
60133
 
59638
- let result = thisClass.getAlignParas();
60134
+ let alignment = $("#" + me.pre + "chainalignids").val();
60135
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
60136
+ let resalign = $("#" + me.pre + "resalignids").val();
60137
+ let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
60138
+ if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
60139
+ var aaa = 1; //alert("Please make sure the number of chains and the lines of predefined residues are the same...");
60140
+ return;
60141
+ }
59639
60142
 
59640
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " | residues " + result.resalign + " | resdef " + result.predefinedres, false);
59641
- window.open(hostUrl + '?chainalign=' + result.alignment + '&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1', '_blank');
60143
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " | residues " + resalign + " | resdef " + predefinedres, false);
60144
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=' + predefinedres + '&showalignseq=1', '_blank');
59642
60145
  });
60146
+ */
59643
60147
 
59644
60148
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym", "click", function(e) { me.icn3d;
59645
60149
  e.preventDefault();
59646
60150
  if(!me.cfg.notebook) dialog.dialog( "close" );
59647
60151
 
59648
- let result = thisClass.getAlignParas();
60152
+ let alignment = $("#" + me.pre + "chainalignids").val();
60153
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
59649
60154
 
59650
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " on asymmetric unit | residues " + result.resalign + " | resdef " + result.predefinedres, false);
59651
- window.open(hostUrl + '?chainalign=' + result.alignment + '&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1&bu=0', '_blank');
60155
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef ", false);
60156
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=&resdef=&showalignseq=1&bu=0', '_blank');
59652
60157
  });
59653
60158
 
60159
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym2", "click", function(e) { me.icn3d;
60160
+ e.preventDefault();
60161
+ if(!me.cfg.notebook) dialog.dialog( "close" );
60162
+
60163
+ let alignment = $("#" + me.pre + "chainalignids2").val();
60164
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
60165
+ let resalign = $("#" + me.pre + "resalignids").val();
60166
+
60167
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues " + resalign + " | resdef ", false);
60168
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=' + resalign + '&resdef=&showalignseq=1&bu=0', '_blank');
60169
+ });
60170
+
60171
+ me.myEventCls.onIds("#" + me.pre + "reload_chainalign_asym3", "click", function(e) { me.icn3d;
60172
+ e.preventDefault();
60173
+ if(!me.cfg.notebook) dialog.dialog( "close" );
60174
+
60175
+ let alignment = $("#" + me.pre + "chainalignids3").val();
60176
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
60177
+
60178
+ let predefinedres = $("#" + me.pre + "predefinedres").val().trim().replace(/\n/g, '; ');
60179
+ if(predefinedres && alignment_final.split(',').length - 1 != predefinedres.split('; ').length) {
60180
+ var aaa = 1; //alert("Please make sure the number of chains and the lines of predefined residues are the same...");
60181
+ return;
60182
+ }
60183
+
60184
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef " + predefinedres, false);
60185
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&resnum=&resdef=' + predefinedres + '&showalignseq=1&bu=0', '_blank');
60186
+ });
60187
+
59654
60188
  me.myEventCls.onIds("#" + me.pre + "reload_chainalign_tmalign", "click", function(e) { me.icn3d;
59655
60189
  e.preventDefault();
59656
60190
  if(!me.cfg.notebook) dialog.dialog( "close" );
59657
60191
 
59658
- let result = thisClass.getAlignParas();
60192
+ let alignment = $("#" + me.pre + "chainalignids").val();
60193
+ let alignment_final = thisClass.convertUniProtInChains(alignment);
59659
60194
 
59660
- me.htmlCls.clickMenuCls.setLogCmd("load chains " + result.alignment + " on asymmetric unit | residues " + result.resalign + " | resdef " + result.predefinedres + " | align tmalign", false);
59661
- window.open(hostUrl + '?chainalign=' + result.alignment + '&aligntool=tmalign&resnum=' + result.resalign + '&resdef=' + result.predefinedres + '&showalignseq=1&bu=0', '_blank');
60195
+ me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment_final + " on asymmetric unit | residues | resdef | align tmalign", false);
60196
+ window.open(hostUrl + '?chainalign=' + alignment_final + '&aligntool=tmalign&resnum=&resdef=&showalignseq=1&bu=0', '_blank');
59662
60197
  });
59663
60198
 
59664
- me.myEventCls.onIds("#" + me.pre + "reload_mutation_3d", "click", function(e) { me.icn3d;
60199
+ me.myEventCls.onIds("#" + me.pre + "reload_mutation_3d", "click", function(e) { let ic = me.icn3d;
59665
60200
  e.preventDefault();
59666
60201
  if(!me.cfg.notebook) dialog.dialog( "close" );
59667
60202
  let mutationids = $("#" + me.pre + "mutationids").val();
59668
- let idsource = $("#" + me.pre + "idsource").val();
59669
- let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
59670
- me.htmlCls.clickMenuCls.setLogCmd("3d of mutation " + mutationids, false);
59671
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?mmdbid=' + mmdbid + '&command=scap 3d ' + mutationids + '; select displayed set', '_blank');
59672
- window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap 3d ' + mutationids + '; select displayed set', '_blank');
60203
+ //let idsource = $("#" + me.pre + "idsource").val();
60204
+ let idsource, pdbsource;
60205
+ if($("#" + me.pre + "type_mmdbid").is(":checked")) {
60206
+ idsource = 'mmdbid';
60207
+ }
60208
+ else {
60209
+ idsource = 'afid';
60210
+ }
60211
+ if($("#" + me.pre + "showin_currentpage").is(":checked")) {
60212
+ pdbsource = 'currentpage';
60213
+ }
60214
+ else {
60215
+ pdbsource = 'newpage';
60216
+ }
60217
+
60218
+ if(pdbsource == 'currentpage') {
60219
+ let snp = mutationids;
60220
+
60221
+ ic.scapCls.retrieveScap(snp);
60222
+ me.htmlCls.clickMenuCls.setLogCmd('scap 3d ' + snp, true);
60223
+ me.htmlCls.clickMenuCls.setLogCmd("select displayed set", true);
60224
+ }
60225
+ else {
60226
+ let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
60227
+ me.htmlCls.clickMenuCls.setLogCmd("3d of mutation " + mutationids, false);
60228
+ window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap 3d ' + mutationids + '; select displayed set', '_blank');
60229
+ }
59673
60230
  });
59674
60231
 
59675
- me.myEventCls.onIds("#" + me.pre + "reload_mutation_pdb", "click", function(e) { me.icn3d;
60232
+ me.myEventCls.onIds("#" + me.pre + "reload_mutation_pdb", "click", function(e) { let ic = me.icn3d;
59676
60233
  e.preventDefault();
59677
60234
  if(!me.cfg.notebook) dialog.dialog( "close" );
59678
60235
  let mutationids = $("#" + me.pre + "mutationids").val();
59679
- let idsource = $("#" + me.pre + "idsource").val();
59680
- let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
59681
- me.htmlCls.clickMenuCls.setLogCmd("pdb of mutation " + mutationids, false);
59682
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?mmdbid=' + mmdbid + '&command=scap pdb ' + mutationids + '; select displayed set', '_blank');
59683
- window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap pdb ' + mutationids + '; select displayed set', '_blank');
60236
+ //let idsource = $("#" + me.pre + "idsource").val();
60237
+ let idsource, pdbsource;
60238
+ if($("#" + me.pre + "type_mmdbid").is(":checked")) {
60239
+ idsource = 'mmdbid';
60240
+ }
60241
+ else {
60242
+ idsource = 'afid';
60243
+ }
60244
+ if($("#" + me.pre + "showin_currentpage").is(":checked")) {
60245
+ pdbsource = 'currentpage';
60246
+ }
60247
+ else {
60248
+ pdbsource = 'newpage';
60249
+ }
60250
+
60251
+ if(pdbsource == 'currentpage') {
60252
+ let snp = mutationids;
60253
+
60254
+ let bPdb = true;
60255
+ ic.scapCls.retrieveScap(snp, undefined, bPdb);
60256
+ me.htmlCls.clickMenuCls.setLogCmd('scap pdb ' + snp, true);
60257
+ }
60258
+ else {
60259
+ let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
60260
+ me.htmlCls.clickMenuCls.setLogCmd("pdb of mutation " + mutationids, false);
60261
+ window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap pdb ' + mutationids + '; select displayed set', '_blank');
60262
+ }
59684
60263
  });
59685
60264
 
59686
60265
  me.myEventCls.onIds("#" + me.pre + "reload_mutation_inter", "click", function(e) { let ic = me.icn3d;
59687
60266
  e.preventDefault();
59688
60267
  if(!me.cfg.notebook) dialog.dialog( "close" );
59689
60268
  let mutationids = $("#" + me.pre + "mutationids").val();
59690
- let idsource = $("#" + me.pre + "idsource").val();
59691
-
59692
- let mutationArray = mutationids.split(',');
59693
- let residArray = [];
59694
- for(let i = 0, il = mutationArray.length; i < il; ++i) {
59695
- let pos = mutationArray[i].lastIndexOf('_');
59696
- let resid = mutationArray[i].substr(0, pos);
59697
- residArray.push(resid);
60269
+ //let idsource = $("#" + me.pre + "idsource").val();
60270
+ let idsource, pdbsource;
60271
+ if($("#" + me.pre + "type_mmdbid").is(":checked")) {
60272
+ idsource = 'mmdbid';
60273
+ }
60274
+ else {
60275
+ idsource = 'afid';
59698
60276
  }
60277
+ if($("#" + me.pre + "showin_currentpage").is(":checked")) {
60278
+ pdbsource = 'currentpage';
60279
+ }
60280
+ else {
60281
+ pdbsource = 'newpage';
60282
+ }
59699
60283
 
59700
- let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
60284
+ if(pdbsource == 'currentpage') {
60285
+ let snp = mutationids;
59701
60286
 
59702
- // if no structures are loaded yet
59703
- if(!ic.structures) {
59704
- ic.structures = {};
59705
- ic.structures[mmdbid] = 1;
60287
+ let bInteraction = true;
60288
+ ic.scapCls.retrieveScap(snp, bInteraction);
60289
+ me.htmlCls.clickMenuCls.setLogCmd('scap interaction ' + snp, true);
60290
+
60291
+ let idArray = snp.split('_'); //stru_chain_resi_snp
60292
+ let select = '.' + idArray[1] + ':' + idArray[2];
60293
+ let name = 'snp_' + idArray[1] + '_' + idArray[2];
60294
+ me.htmlCls.clickMenuCls.setLogCmd("select " + select + " | name " + name, true);
60295
+ 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);
60296
+ me.htmlCls.clickMenuCls.setLogCmd("adjust dialog dl_linegraph", true);
60297
+ me.htmlCls.clickMenuCls.setLogCmd("select displayed set", true);
59706
60298
  }
59707
- ic.resid2specCls.residueids2spec(residArray);
60299
+ else {
60300
+ let mutationArray = mutationids.split(',');
60301
+ let residArray = [];
60302
+ for(let i = 0, il = mutationArray.length; i < il; ++i) {
60303
+ let pos = mutationArray[i].lastIndexOf('_');
60304
+ let resid = mutationArray[i].substr(0, pos);
60305
+ residArray.push(resid);
60306
+ }
59708
60307
 
59709
- me.htmlCls.clickMenuCls.setLogCmd("interaction change of mutation " + mutationids, false);
59710
- //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');
59711
- //window.open(me.htmlCls.baseUrl + 'icn3d/full.html?mmdbid=' + mmdbid + '&command=scap interaction ' + mutationids, '_blank');
59712
- window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap interaction ' + mutationids, '_blank');
60308
+ let mmdbid = mutationids.substr(0, mutationids.indexOf('_'));
60309
+
60310
+ // if no structures are loaded yet
60311
+ if(!ic.structures) {
60312
+ ic.structures = {};
60313
+ ic.structures[mmdbid] = 1;
60314
+ }
60315
+ ic.resid2specCls.residueids2spec(residArray);
60316
+
60317
+ me.htmlCls.clickMenuCls.setLogCmd("interaction change of mutation " + mutationids, false);
60318
+ window.open(hostUrl + '?' + idsource + '=' + mmdbid + '&command=scap interaction ' + mutationids, '_blank');
60319
+ }
59713
60320
  });
59714
60321
 
59715
60322
  // },
@@ -60765,6 +61372,27 @@ class Events {
60765
61372
  let color = $("#" + me.pre + "colorcustom").val();
60766
61373
  picker.set('#' + color).enter();
60767
61374
  });
61375
+
61376
+ let picker2 = new CP(document.querySelector("#" + me.pre + "labelcolorall"));
61377
+ picker2.on("change", function(color) {
61378
+ this.target.value = color;
61379
+ });
61380
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "input", function() {
61381
+ let color = $("#" + me.pre + "labelcolorall").val();
61382
+ picker2.set('#' + color).enter();
61383
+ });
61384
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "keyup", function() {
61385
+ let color = $("#" + me.pre + "labelcolorall").val();
61386
+ picker2.set('#' + color).enter();
61387
+ });
61388
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "paste", function() {
61389
+ let color = $("#" + me.pre + "labelcolorall").val();
61390
+ picker2.set('#' + color).enter();
61391
+ });
61392
+ me.myEventCls.onIds("#" + me.pre + "labelcolorall", "cut", function() {
61393
+ let color = $("#" + me.pre + "labelcolorall").val();
61394
+ picker2.set('#' + color).enter();
61395
+ });
60768
61396
  // },
60769
61397
  // clickApplypick_stabilizer_rm: function() {
60770
61398
  me.myEventCls.onIds("#" + me.pre + "applypick_stabilizer_rm", "click", function(e) { let ic = me.icn3d;
@@ -62039,7 +62667,7 @@ class SetHtml {
62039
62667
  return html;
62040
62668
  }
62041
62669
 
62042
- exportPqr() { let me = this.icn3dui, ic = me.icn3d;
62670
+ exportPqr(bPdb) { let me = this.icn3dui, ic = me.icn3d;
62043
62671
  let ionHash = {};
62044
62672
  let atomHash = {};
62045
62673
  /*
@@ -62071,13 +62699,15 @@ class SetHtml {
62071
62699
  }
62072
62700
  }
62073
62701
 
62702
+ let fileExt = (bPdb) ? 'pdb' : 'pqr';
62074
62703
  if(me.cfg.cid) {
62075
62704
  let pqrStr = '';
62076
62705
  /// pqrStr += ic.saveFileCls.getPDBHeader();
62077
- pqrStr += ic.saveFileCls.getAtomPDB(atomHash, true) + ic.saveFileCls.getAtomPDB(ionHash, true);
62706
+ let bPqr = (bPdb) ? false : true;
62707
+ pqrStr += ic.saveFileCls.getAtomPDB(atomHash, bPqr) + ic.saveFileCls.getAtomPDB(ionHash, bPqr);
62078
62708
 
62079
62709
  let file_pref =(ic.inputid) ? ic.inputid : "custom";
62080
- ic.saveFileCls.saveFile(file_pref + '_icn3d.pqr', 'text', [pqrStr]);
62710
+ ic.saveFileCls.saveFile(file_pref + '_icn3d.' + fileExt, 'text', [pqrStr]);
62081
62711
  }
62082
62712
  else {
62083
62713
  let bCalphaOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms));
@@ -62113,8 +62743,40 @@ class SetHtml {
62113
62743
  success: function(data) {
62114
62744
  let pqrStr = data;
62115
62745
 
62746
+ if(bPdb) {
62747
+ let lineArray = pqrStr.split('\n');
62748
+
62749
+ let pdbStr = '';
62750
+ for(let i = 0, il = lineArray.length; i < il; ++i) {
62751
+ let line = lineArray[i];
62752
+ if(line.substr(0, 6) == 'ATOM ' || line.substr(0, 6) == 'HETATM') {
62753
+ let atomName = line.substr(12, 4).trim();
62754
+ let elem;
62755
+ if(line.substr(0, 6) == 'ATOM ') {
62756
+ elem = atomName.substr(0, 1);
62757
+ }
62758
+ else {
62759
+ let twochar = atomName.substr(0, 2);
62760
+ if(me.parasCls.vdwRadii.hasOwnProperty(twochar)) {
62761
+ elem = twochar;
62762
+ }
62763
+ else {
62764
+ elem = atomName.substr(0, 1);
62765
+ }
62766
+ }
62767
+
62768
+ pdbStr += line.substr(0, 54) + ' ' + elem.padStart(2, ' ') + '\n';
62769
+ }
62770
+ else {
62771
+ pdbStr += line + '\n';
62772
+ }
62773
+ }
62774
+
62775
+ pqrStr = pdbStr;
62776
+ }
62777
+
62116
62778
  let file_pref =(ic.inputid) ? ic.inputid : "custom";
62117
- ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.pqr', 'text', [pqrStr]);
62779
+ ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.' + fileExt, 'text', [pqrStr]);
62118
62780
  },
62119
62781
  error : function(xhr, textStatus, errorThrown ) {
62120
62782
  this.tryCount++;
@@ -62479,7 +63141,8 @@ class Html {
62479
63141
  this.simulation = undefined;
62480
63142
 
62481
63143
  //this.baseUrl = "https://structure.ncbi.nlm.nih.gov/";
62482
- this.baseUrl = "https://www.ncbi.nlm.nih.gov/Structure/";
63144
+ this.baseUrl = (window && window.location && window.location.hostname == 'structure.ncbi.nlm.nih.gov')
63145
+ ? "https://structure.ncbi.nlm.nih.gov/Structure/" : "https://www.ncbi.nlm.nih.gov/Structure/";
62483
63146
  this.divStr = "<div id='" + this.icn3dui.pre;
62484
63147
  this.divNowrapStr = "<div style='white-space:nowrap'>";
62485
63148
  this.spanNowrapStr = "<span style='white-space:nowrap'>";
@@ -65336,7 +65999,7 @@ class iCn3D {
65336
65999
  if(bWebGL){
65337
66000
  //https://discourse.threejs.org/t/three-js-r128-ext-frag-depth-and-angle-instanced-arrays-extensions-are-not-supported/26037
65338
66001
  //this.renderer = new THREE.WebGL1Renderer({
65339
- if ( bWebGL2 && bVR) {
66002
+ if ( bWebGL2 && bVR) {
65340
66003
  this.renderer = new THREE.WebGLRenderer({
65341
66004
  canvas: this.oriContainer.get(0), //this.container.get(0),
65342
66005
  antialias: true,
@@ -65703,6 +66366,7 @@ class iCn3D {
65703
66366
 
65704
66367
  this.annoCddSiteCls = new AnnoCddSite(this);
65705
66368
  this.annoContactCls = new AnnoContact(this);
66369
+ this.annoPTMCls = new AnnoPTM(this);
65706
66370
  this.annoCrossLinkCls = new AnnoCrossLink(this);
65707
66371
  this.annoDomainCls = new AnnoDomain(this);
65708
66372
  this.annoSnpClinVarCls = new AnnoSnpClinVar(this);
@@ -65950,7 +66614,7 @@ iCn3D.prototype.resetConfig = function () { let ic = this, me = ic.icn3dui;
65950
66614
  }
65951
66615
 
65952
66616
  if(me.cfg.blast_rep_id !== undefined) this.opts['color'] = 'conservation';
65953
- if(me.cfg.mmdbafid !== undefined) this.opts['color'] = 'structure';
66617
+ if(me.cfg.mmdbafid !== undefined && ic.structures) ic.opts['color'] = (Object.keys(ic.structures).length == 1) ? 'chain' : 'structure';
65954
66618
 
65955
66619
  if(me.cfg.options !== undefined) $.extend(this.opts, me.cfg.options);
65956
66620
  };
@@ -65967,7 +66631,7 @@ class iCn3DUI {
65967
66631
  //even when multiple iCn3D viewers are shown together.
65968
66632
  this.pre = this.cfg.divid + "_";
65969
66633
 
65970
- this.REVISION = '3.13.0';
66634
+ this.REVISION = '3.14.3';
65971
66635
 
65972
66636
  // In nodejs, iCn3D defines "window = {navigator: {}}"
65973
66637
  this.bNode = (Object.keys(window).length < 2) ? true : false;