icn3d 3.34.2 → 3.34.4

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
@@ -14129,10 +14129,10 @@ class SetDialog {
14129
14129
 
14130
14130
  html += me.htmlCls.divStr + "dl_blast_rep_id' style='max-width:600px;' class='" + dialogClass + "'>";
14131
14131
  html += this.addNotebookTitle('dl_blast_rep_id', 'Align sequence to structure');
14132
- html += "Enter a Sequence ID (or FASTA sequence) and the aligned protein accession, which can be found using the <a href='https://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch' target='_blank'>BLAST</a> search with the Sequence ID or FASTA sequence as input. If the protein accession is not a PDB chain, the corresponding AlphaFold UniProt structure is used.<br><br> ";
14133
- html += "<b>Sequence ID</b>(NCBI protein accession of a sequence): " + me.htmlCls.inputTextStr + "id='" + me.pre + "query_id' value='NP_001108451.1' size=8><br> ";
14132
+ html += "Enter a protein sequence ID (or FASTA sequence) and the aligned protein accession, which can be found using the <a href='https://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch' target='_blank'>BLAST</a> search with the protein sequence ID or FASTA sequence as input. If the protein accession is not a PDB chain, the corresponding AlphaFold UniProt structure is used.<br><br> ";
14133
+ html += "<b>Protein Sequence ID</b>(NCBI protein accession of a sequence): " + me.htmlCls.inputTextStr + "id='" + me.pre + "query_id' value='NP_001108451.1' size=8><br> ";
14134
14134
  html += "or FASTA sequence: <br><textarea id='" + me.pre + "query_fasta' rows='5' style='width: 100%; height: " +(me.htmlCls.LOG_HEIGHT) + "px; padding: 0px; border: 0px;'></textarea><br><br>";
14135
- html += "<b>NCBI protein accession</b> (or a chain of a PDB): " + me.htmlCls.inputTextStr + "id='" + me.pre + "blast_rep_id' value='1TSR_A' size=8><br> ";
14135
+ html += "<b>Aligned Protein Accession</b> (or a chain of a PDB): " + me.htmlCls.inputTextStr + "id='" + me.pre + "blast_rep_id' value='1TSR_A' size=8><br> ";
14136
14136
  //html += me.htmlCls.buttonStr + "reload_blast_rep_id'>Load</button>";
14137
14137
  html += me.htmlCls.buttonStr + "reload_blast_rep_id'>Align with BLAST</button> " + me.htmlCls.wifiStr
14138
14138
  + me.htmlCls.buttonStr + "reload_alignsw' style='margin-left:30px'>Align with Global Smith-Waterman</button>"
@@ -14543,7 +14543,7 @@ class SetDialog {
14543
14543
  html += me.htmlCls.divStr + "dl_ligplot' sty2D Interaction for One Ligand/Residule='background-color:white' class='" + dialogClass + "'>";
14544
14544
  html += this.addNotebookTitle('dl_ligplot', 'e with Atom Details');
14545
14545
 
14546
- html += me.htmlCls.divNowrapStr + "<b>Note</b>: Nodes can be dragged or clicked. Hold Ctrl key to select multiple nodes. " + me.htmlCls.space3;
14546
+ html += me.htmlCls.divNowrapStr + "<b>Note</b>: Nodes/Residues can be dragged. Both nodes and dashed lines/interactions can be clicked to select residues. " + me.htmlCls.space3;
14547
14547
 
14548
14548
  html += '<div style="width:20px; margin-top:6px; display:inline-block;"><span id="'
14549
14549
  + me.pre + 'dl_ligplotcolor_expand" class="ui-icon ui-icon-plus icn3d-expand icn3d-link" style="display:none; width:15px;" title="Expand"></span><span id="'
@@ -14552,7 +14552,8 @@ class SetDialog {
14552
14552
  html += me.htmlCls.divStr + "dl_ligplotcolor' style='inline-block;'>";
14553
14553
 
14554
14554
  // html += "The real interaction distances are not in scale, and are about twice the distances of dashed line segments.<br>Some \"Contact\" lines are only shown partially to simplify the view.<br>";
14555
- html += "Color legend for interactions (dashed lines): <br>";
14555
+ // html += "Mouseover the dashed lines to see interaction types and distances.<br>";
14556
+ html += "<b>Color legend</b> for interactions (dashed lines): <br>";
14556
14557
 
14557
14558
  html += me.htmlCls.setHtmlCls.setColorHints();
14558
14559
 
@@ -16436,7 +16437,11 @@ class Events {
16436
16437
  me.myEventCls.onIds("#" + me.pre + "reload_blast_rep_id", "click", function(e) { let ic = me.icn3d;
16437
16438
  e.preventDefault();
16438
16439
  if(!me.cfg.notebook) dialog.dialog( "close" );
16439
- let query_id = $("#" + me.pre + "query_id").val();
16440
+ let query_id = $("#" + me.pre + "query_id").val().trim();
16441
+ if(query_id.substr(1, 2) == 'M_') { // e.g., NM_..., XM_...
16442
+ var aaa = 1; //alert("You are inputting a nucleotide accession " + query_id + ". Please use a protein accession instead.");
16443
+ return;
16444
+ }
16440
16445
  let query_fasta = encodeURIComponent($("#" + me.pre + "query_fasta").val());
16441
16446
  let blast_rep_id = $("#" + me.pre + "blast_rep_id").val();
16442
16447
  thisClass.setLogCmd("load seq_struct_ids " + query_id + "," + blast_rep_id, false);
@@ -16503,7 +16508,11 @@ class Events {
16503
16508
  me.myEventCls.onIds("#" + me.pre + "reload_alignsw", "click", function(e) { let ic = me.icn3d;
16504
16509
  e.preventDefault();
16505
16510
  if(!me.cfg.notebook) dialog.dialog( "close" );
16506
- let query_id = $("#" + me.pre + "query_id").val();
16511
+ let query_id = $("#" + me.pre + "query_id").val().trim();
16512
+ if(query_id.substr(1, 2) == 'M_') { // e.g., NM_..., XM_...
16513
+ var aaa = 1; //alert("You are inputting a nucleotide accession " + query_id + ". Please use a protein accession instead.");
16514
+ return;
16515
+ }
16507
16516
  let query_fasta = encodeURIComponent($("#" + me.pre + "query_fasta").val());
16508
16517
  let blast_rep_id = $("#" + me.pre + "blast_rep_id").val();
16509
16518
  thisClass.setLogCmd("load seq_struct_ids_smithwm " + query_id + "," + blast_rep_id, false);
@@ -16519,7 +16528,11 @@ class Events {
16519
16528
  me.myEventCls.onIds("#" + me.pre + "reload_alignswlocal", "click", function(e) { let ic = me.icn3d;
16520
16529
  e.preventDefault();
16521
16530
  if(!me.cfg.notebook) dialog.dialog( "close" );
16522
- let query_id = $("#" + me.pre + "query_id").val();
16531
+ let query_id = $("#" + me.pre + "query_id").val().trim();
16532
+ if(query_id.substr(1, 2) == 'M_') { // e.g., NM_..., XM_...
16533
+ var aaa = 1; //alert("You are inputting a nucleotide accession " + query_id + ". Please use a protein accession instead.");
16534
+ return;
16535
+ }
16523
16536
  let query_fasta = encodeURIComponent($("#" + me.pre + "query_fasta").val());
16524
16537
  let blast_rep_id = $("#" + me.pre + "blast_rep_id").val();
16525
16538
  thisClass.setLogCmd("load seq_struct_ids_local_smithwm " + query_id + "," + blast_rep_id, false);
@@ -17390,6 +17403,7 @@ class Events {
17390
17403
 
17391
17404
  let scale = $("#" + me.ligplotid + "_scale").val();
17392
17405
  $("#" + me.ligplotid).attr("width",(ic.ligplotWidth * parseFloat(scale)).toString() + "px");
17406
+ ic.ligplotScale = parseFloat(scale);
17393
17407
  thisClass.setLogCmd("ligplot scale " + scale, true);
17394
17408
  });
17395
17409
 
@@ -18640,7 +18654,7 @@ class SetHtml {
18640
18654
 
18641
18655
  html += me.htmlCls.divNowrapStr + '<span style="margin-left:33px; color:#00FF00; font-weight:bold">Green</span>: H-Bonds; ';
18642
18656
  html += '<span style="color:#00FFFF; font-weight:bold">Cyan</span>: Salt Bridge/Ionic; ';
18643
- html += '<span style="font-weight:bold">Grey</span>: contacts</div>';
18657
+ html += '<span style="font-weight:bold">Grey</span>: Contacts</div>';
18644
18658
  html += me.htmlCls.divNowrapStr + '<span style="margin-left:33px; color:#FF00FF; font-weight:bold">Magenta</span>: Halogen Bonds; ';
18645
18659
  html += '<span style="color:#FF0000; font-weight:bold">Red</span>: &pi;-Cation; ';
18646
18660
  html += '<span style="color:#0000FF; font-weight:bold">Blue</span>: &pi;-Stacking</div>';
@@ -33911,7 +33925,7 @@ class ApplyDisplay {
33911
33925
  atomsObj = {};
33912
33926
  } // end if(bHighlight === 1)
33913
33927
 
33914
- if(ic.bInitial) {
33928
+ if(ic.bInitial && ic.bMembrane === undefined) {
33915
33929
  if(me.htmlCls.setHtmlCls.getCookie('membrane') != '') {
33916
33930
  let bMembrane = parseInt(me.htmlCls.setHtmlCls.getCookie('membrane'));
33917
33931
 
@@ -34205,7 +34219,7 @@ class ApplyOther {
34205
34219
  }
34206
34220
  }
34207
34221
 
34208
- if(ic.bInitial) {
34222
+ if(ic.bInitial && ic.bGlycansCartoon === undefined) {
34209
34223
  if(me.htmlCls.setHtmlCls.getCookie('glycan') != '') {
34210
34224
  let bGlycansCartoon = parseInt(me.htmlCls.setHtmlCls.getCookie('glycan'));
34211
34225
 
@@ -40076,6 +40090,7 @@ class AnnoCddSite {
40076
40090
  if(me.bNode) {
40077
40091
  if(!ic.resid2cdd) ic.resid2cdd = {};
40078
40092
  if(!ic.resid2site) ic.resid2site = {};
40093
+ if(!ic.chainid2cdd) ic.chainid2cdd = {};
40079
40094
  }
40080
40095
 
40081
40096
  for(let i = 0, il = dataArray.length; i < il; ++i) {
@@ -40098,6 +40113,8 @@ class AnnoCddSite {
40098
40113
  let html3 = html;
40099
40114
  let domainArray = cddData.doms;
40100
40115
  if(me.bNode && !ic.resid2cdd[chnid]) ic.resid2cdd[chnid] = [];
40116
+ if(me.bNode && !ic.chainid2cdd[chnid]) ic.chainid2cdd[chnid] = [];
40117
+
40101
40118
  let result = thisClass.setDomainFeature(domainArray, chnid, 'domain', html, html2, html3);
40102
40119
 
40103
40120
  ic.chainid2pssmid[chnid] = {pssmid2name: result.pssmid2name, pssmid2fromArray: result.pssmid2fromArray, pssmid2toArray: result.pssmid2toArray};
@@ -40254,6 +40271,20 @@ class AnnoCddSite {
40254
40271
  ic.bAjaxCddSite = true;
40255
40272
  }
40256
40273
 
40274
+ getResiArrayStr(resiNCBIArray, chainid) { let ic = this.icn3d; ic.icn3dui;
40275
+ let resiArrayStr = '';
40276
+ for(let i = 0, il = resiNCBIArray.length; i < il; ++i) {
40277
+ let resiNCBI = resiNCBIArray[i];
40278
+ let residNCBI = chainid + '_' + resiNCBI;
40279
+ let resid = ic.ncbi2resid[residNCBI];
40280
+ let resi = resid.split('_')[2];
40281
+ if(i > 0) resiArrayStr += ',';
40282
+ resiArrayStr += resi;
40283
+ }
40284
+
40285
+ return resiArrayStr;
40286
+ }
40287
+
40257
40288
  setDomainFeature(domainArray, chnid, type, html, html2, html3, acc2domain, titleArray, fullTitleArray) { let ic = this.icn3d, me = ic.icn3dui;
40258
40289
 
40259
40290
  let bNonDomainFeat = (type != 'domain' && type != 'feat') ? true : false;
@@ -40389,6 +40420,12 @@ class AnnoCddSite {
40389
40420
 
40390
40421
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html += ic.showSeqCls.insertMulGap(ic.seqStartLen[chnid], '-');
40391
40422
 
40423
+ if(me.bNode && type == 'domain') {
40424
+ let fromStr = this.getResiArrayStr(fromArray, chnid);
40425
+ let toStr = this.getResiArrayStr(toArray, chnid);
40426
+ ic.chainid2cdd[chnid].push(fulltitle + "_from_" + fromStr + "_to_" + toStr);
40427
+ }
40428
+
40392
40429
  for(let i = 0, il = ic.giSeq[chnid].length; i < il; ++i) {
40393
40430
  html += ic.showSeqCls.insertGap(chnid, i, '-');
40394
40431
 
@@ -42425,7 +42462,7 @@ class AnnoSnpClinVar {
42425
42462
  }
42426
42463
 
42427
42464
  //snpTitle += "<br>Links: <span class='" + ic.pre + "snpin3d icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP in 3D with scap</span>, <span class='" + ic.pre + "snpinter icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP Interactions in 3D</span>, <span class='" + ic.pre + "snppdb icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP PDB</span>, <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' target='_blank'>ClinVar</a>, <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</a>";
42428
- snpTitle += "<br>Links: <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' target='_blank'>ClinVar</a>, <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</a>";
42465
+ snpTitle += "<br>Links: <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' style='color:blue' target='_blank'>ClinVar</a>, <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' style='color:blue' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</a>";
42429
42466
  }
42430
42467
  else {
42431
42468
  if(bCoord && !me.cfg.hidelicense) {
@@ -42507,7 +42544,7 @@ class AnnoSnpClinVar {
42507
42544
  }
42508
42545
 
42509
42546
  //snpTitle += "<br>Links: <span class='" + ic.pre + "snpin3d icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP in 3D with scap</span>, <span class='" + ic.pre + "snpinter icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP Interactions in 3D</span>, <span class='" + ic.pre + "snppdb icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP PDB</span>, <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' target='_blank'>ClinVar</a>, <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</a>";
42510
- snpTitle += "<br>Links: <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' target='_blank'>ClinVar</a>, <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</a>";
42547
+ snpTitle += "<br>Links: <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' style='color:blue' target='_blank'>ClinVar</a>, <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' style='color:blue' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</a>";
42511
42548
  if(j < jl - 1) {
42512
42549
  snpTitle += '<br><br>';
42513
42550
  }
@@ -44699,7 +44736,8 @@ class AddTrack {
44699
44736
  $("#" + ic.pre + "tt_custom_" + chnid).append("<div id='" + ic.pre + "tt_custom_" + chnid + "_" + simpTitle + "'></div>");
44700
44737
  $("#" + ic.pre + "tt_custom_" + chnid + "_" + simpTitle).width(divLength);
44701
44738
 
44702
- let html = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
44739
+ // let html = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
44740
+ let html = '<div class="icn3d-dl_sequence">';
44703
44741
  let htmlExon = html;
44704
44742
  let html2 = html;
44705
44743
  let html3 = html;
@@ -45994,6 +46032,7 @@ class AddTrack {
45994
46032
  let title =(trackTitleArray[j].length < 20) ? trackTitleArray[j] : trackTitleArray[j].substr(0, 20) + '...';
45995
46033
  let bMsa = true;
45996
46034
  let exonArray = (acc2exons) ? acc2exons[trackTitleArray[j]] : undefined;
46035
+
45997
46036
  this.showNewTrack(chainid, title, text, undefined, undefined, type, undefined, bMsa, fromArray, toArray, seqStartLen, exonArray, offsetArray);
45998
46037
  }
45999
46038
 
@@ -46205,6 +46244,7 @@ class AddTrack {
46205
46244
  await thisClass.showMsaTracks(chainid, seqFirst, trackTitleArray, trackSeqArray, startpos, type, acc2exons);
46206
46245
 
46207
46246
  me.htmlCls.clickMenuCls.setLogCmd("add exon track | chainid " + chainid + " | geneid " + geneid + " | startpos " + startpos + " | type " + type, true);
46247
+ me.htmlCls.clickMenuCls.setLogCmd("set annotation custom", true);
46208
46248
  }
46209
46249
 
46210
46250
  async addMsaTracks(chainid, startpos, type, fastaList) { let ic = this.icn3d, me = ic.icn3dui;
@@ -47345,7 +47385,8 @@ class ShowAnno {
47345
47385
  $("#" + ic.pre + "anno_" + name).append("<div id='" + ic.pre + "giseq_" + name + "'><div id='" + ic.pre + "dt_giseq_" + name + "' style='display:none'></div><div id='" + ic.pre + "ov_giseq_" + name + "'></div></div>");
47346
47386
  $("#" + ic.pre + "anno_" + name).append("<br><hr><br>");
47347
47387
  // sequence, detailed view
47348
- let htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47388
+ // let htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47389
+ let htmlTmp = '<div class="icn3d-dl_sequence">';
47349
47390
  let chainType = 'Chem.', chainTypeFull = 'Chemical';
47350
47391
  //htmlTmp += '<div class="icn3d-seqTitle2" anno="sequence"><span style="white-space:nowrap;" title="' + chainTypeFull + ' ' + name + '">' + chainType + ' ' + name + '</span></div>';
47351
47392
  htmlTmp += '<div class="icn3d-seqTitle icn3d-link icn3d-blue" anno="sequence" gi="' + name + '" resn="' + name + '"><span style="white-space:nowrap;" title="' + chainTypeFull + ' ' + name + '">' + chainType + ' ' + name + '</span></div>';
@@ -47382,6 +47423,8 @@ class ShowAnno {
47382
47423
  }
47383
47424
 
47384
47425
  async processSeqData(chainid_seq) { let ic = this.icn3d, me = ic.icn3dui;
47426
+ ic.bAnnoShown = true;
47427
+
47385
47428
  for(let chnid in ic.protein_chainid) {
47386
47429
  let chnidBase = ic.protein_chainid[chnid];
47387
47430
  //if(chainid_seq.hasOwnProperty(chnid)) {
@@ -47899,11 +47942,17 @@ class ShowSeq {
47899
47942
  html += '</div>';
47900
47943
  html += '</div>'; // corresponds to above: html += '<div class="icn3d-dl_sequence">';
47901
47944
  html3 += '</div></div>';
47945
+ // if(me.cfg.blast_rep_id === chnid) {
47946
+ // htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence" style="border: solid 1px #000">';
47947
+ // }
47948
+ // else {
47949
+ // htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47950
+ // }
47902
47951
  if(me.cfg.blast_rep_id === chnid) {
47903
- htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence" style="border: solid 1px #000">';
47952
+ htmlTmp = '<div class="icn3d-dl_sequence" style="border: solid 1px #000">';
47904
47953
  }
47905
47954
  else {
47906
- htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47955
+ htmlTmp = '<div class="icn3d-dl_sequence">';
47907
47956
  }
47908
47957
  let chainType = 'Protein', chainTypeFull = 'Protein';
47909
47958
  if(type !== undefined) {
@@ -51470,7 +51519,7 @@ class ViewInterPairs {
51470
51519
  if(index2xy) {
51471
51520
  let serialArray1 = resid1Ori.substr(pos1 + 1).split(',');
51472
51521
 
51473
- let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter);
51522
+ let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, dist);
51474
51523
  svgHtmlNode += result.node;
51475
51524
  svgHtmlLine += result.line;
51476
51525
  }
@@ -51572,9 +51621,12 @@ class ViewInterPairs {
51572
51621
  let resids = resid1 + '|' + resid2;
51573
51622
 
51574
51623
  let serialArray1 = resids2distCnt[resids].serialArray1;
51575
-
51624
+ let dist1_dist2_atom1_atom2 = resids2distCnt[resids].dist1_dist2_atom1_atom2;
51625
+ let dist1 = dist1_dist2_atom1_atom2[0]; // min dist
51626
+ dist1_dist2_atom1_atom2[1]; // c-alpha dist
51627
+ // let dist = (dist1 < dist2) ? dist1 : dist2;
51576
51628
  let bNotDrawNode = (i == 0) ? false : true;
51577
- let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, bNotDrawNode, prevX2, prevY2);
51629
+ let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, dist1, bNotDrawNode, prevX2, prevY2);
51578
51630
  svgHtmlNode += result.node;
51579
51631
  svgHtmlLine += result.line;
51580
51632
  prevX2 = result.x2;
@@ -60230,10 +60282,7 @@ class ParserUtils {
60230
60282
  // display the structure right away. load the mns and sequences later
60231
60283
  setTimeout(async function(){
60232
60284
  if(ic.bInitial) {
60233
- // if(!ic.bAnnoShown || ic.bResetAnno) {
60234
- // if(me.cfg.showsets) {
60235
- // ic.definedSetsCls.showSets();
60236
- // }
60285
+ // if(ic.bInitial && (!ic.bAnnoShown || ic.bResetAnno)) {
60237
60286
  if(me.cfg.align !== undefined || me.cfg.chainalign !== undefined) {
60238
60287
  // expand the toolbar
60239
60288
  let id = ic.pre + 'selection';
@@ -66372,6 +66421,7 @@ class ApplyCommand {
66372
66421
  let scale = command.substr(pos + 1);
66373
66422
 
66374
66423
  $("#" + me.ligplotid + "_scale").val(scale);
66424
+ ic.ligplotScale = parseFloat(scale);
66375
66425
 
66376
66426
  $("#" + me.ligplotid).attr("width",(ic.ligplotWidth * parseFloat(scale)).toString() + "px");
66377
66427
  }
@@ -66600,6 +66650,7 @@ class ApplyCommand {
66600
66650
  }
66601
66651
  else if(command.indexOf('glycans cartoon') == 0) {
66602
66652
  let value = command.substr(command.lastIndexOf(' ') + 1);
66653
+
66603
66654
  if(value == 'yes') {
66604
66655
  ic.bGlycansCartoon = true;
66605
66656
  }
@@ -67062,21 +67113,21 @@ class DefinedSets {
67062
67113
 
67063
67114
  setProtNuclLigInMenu() { let ic = this.icn3d; ic.icn3dui;
67064
67115
  // Initially, add proteins, nucleotides, chemicals, ions, water into the menu "custom selections"
67065
- if(Object.keys(ic.proteins).length > 0) {
67116
+ if(ic.proteins && Object.keys(ic.proteins).length > 0) {
67066
67117
  //ic.defNames2Atoms['proteins'] = Object.keys(ic.proteins);
67067
67118
  ic.defNames2Residues['proteins'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.proteins));
67068
67119
  ic.defNames2Descr['proteins'] = 'proteins';
67069
67120
  ic.defNames2Command['proteins'] = 'select :proteins';
67070
67121
  }
67071
67122
 
67072
- if(Object.keys(ic.nucleotides).length > 0) {
67123
+ if(ic.nucleotides && Object.keys(ic.nucleotides).length > 0) {
67073
67124
  //ic.defNames2Atoms['nucleotides'] = Object.keys(ic.nucleotides);
67074
67125
  ic.defNames2Residues['nucleotides'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.nucleotides));
67075
67126
  ic.defNames2Descr['nucleotides'] = 'nucleotides';
67076
67127
  ic.defNames2Command['nucleotides'] = 'select :nucleotides';
67077
67128
  }
67078
67129
 
67079
- if(Object.keys(ic.chemicals).length > 0) {
67130
+ if(ic.chemicals && Object.keys(ic.chemicals).length > 0) {
67080
67131
  //ic.defNames2Atoms['chemicals'] = Object.keys(ic.chemicals);
67081
67132
  if(ic.bOpm) {
67082
67133
  let chemicalResHash = {}, memResHash = {};
@@ -67110,14 +67161,14 @@ class DefinedSets {
67110
67161
  }
67111
67162
  }
67112
67163
 
67113
- if(Object.keys(ic.ions).length > 0) {
67164
+ if(ic.ions && Object.keys(ic.ions).length > 0) {
67114
67165
  //ic.defNames2Atoms['ions'] = Object.keys(ic.ions);
67115
67166
  ic.defNames2Residues['ions'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.ions));
67116
67167
  ic.defNames2Descr['ions'] = 'ions';
67117
67168
  ic.defNames2Command['ions'] = 'select :ions';
67118
67169
  }
67119
67170
 
67120
- if(Object.keys(ic.water).length > 0) {
67171
+ if(ic.water && Object.keys(ic.water).length > 0) {
67121
67172
  //ic.defNames2Atoms['water'] = Object.keys(ic.water);
67122
67173
  ic.defNames2Residues['water'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.water));
67123
67174
  ic.defNames2Descr['water'] = 'water';
@@ -67248,7 +67299,7 @@ class DefinedSets {
67248
67299
  }
67249
67300
 
67250
67301
  // select whole structure
67251
- if(Object.keys(ic.structures) == 1) {
67302
+ if(ic.structures && Object.keys(ic.structures) == 1) {
67252
67303
  let structure = Object.keys(ic.structures)[0];
67253
67304
 
67254
67305
  ic.defNames2Residues[structure] = Object.keys(ic.residues);
@@ -67256,7 +67307,7 @@ class DefinedSets {
67256
67307
 
67257
67308
  ic.defNames2Command[structure] = 'select $' + structure;
67258
67309
  }
67259
- else {
67310
+ else if(ic.residues) {
67260
67311
  let resArray = Object.keys(ic.residues);
67261
67312
  let structResHash = {};
67262
67313
  for(let i = 0, il = resArray.length; i < il; ++i) {
@@ -68335,7 +68386,7 @@ class LoadScript {
68335
68386
 
68336
68387
  let chainid = paraArray[1].substr(8);
68337
68388
  let geneid = paraArray[2].substr(7);
68338
- let startpos = paraArray[3].substr(9);
68389
+ let startpos = parseInt(paraArray[3].substr(9));
68339
68390
  let type = paraArray[4].substr(5);
68340
68391
 
68341
68392
  if($("#" + ic.pre + "anno_custom")[0]) {
@@ -75654,6 +75705,12 @@ class Diagram2d {
75654
75705
  thisClass.clickInteraction(this);
75655
75706
  });
75656
75707
 
75708
+ $(document).on("click", "#" + ic.pre + "dl_ligplot .icn3d-interaction", function(e) { thisClass.icn3d;
75709
+ e.stopImmediatePropagation();
75710
+
75711
+ thisClass.clickInteraction(this);
75712
+ });
75713
+
75657
75714
  $(document).on("click", "#" + ic.pre + "dl_alignerrormap .icn3d-node", function(e) { thisClass.icn3d;
75658
75715
  e.stopImmediatePropagation();
75659
75716
 
@@ -76902,7 +76959,7 @@ class Ligplot {
76902
76959
  }
76903
76960
 
76904
76961
 
76905
- getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, bNotDrawNode, prevX2, prevY2) { let ic = this.icn3d, me = ic.icn3dui;
76962
+ getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, dist, bNotDrawNode, prevX2, prevY2) { let ic = this.icn3d, me = ic.icn3dui;
76906
76963
  let xOffset = 1, yOffset = -1;
76907
76964
  let bondLen = (interactionType == 'hbond' || interactionType == 'contact' || interactionType == 'halogen') ? ic.len4ang : ic.len4ang * 1.5; // real distance should be bout 120, not 80
76908
76965
  let shortBondLen = ic.len4ang / 2;
@@ -77014,6 +77071,26 @@ class Ligplot {
77014
77071
  // sometimes the same ligand atom is used in both Hbond and contact. THus we add "interactionType"
77015
77072
  let idpair = resid2Real + '--' + serialArray1.join('-') + interactionType;
77016
77073
 
77074
+ let interactionTypeStr;
77075
+ if(interactionType == 'hbond') {
77076
+ interactionTypeStr = 'H-Bonds';
77077
+ }
77078
+ else if(interactionType == 'ionic') {
77079
+ interactionTypeStr = 'Salt Bridge/Ionic';
77080
+ }
77081
+ else if(interactionType == 'halogen') {
77082
+ interactionTypeStr = 'Halogen Bonds';
77083
+ }
77084
+ else if(interactionType == 'pi-cation') {
77085
+ interactionTypeStr = '&pi;-Cation';
77086
+ }
77087
+ else if(interactionType == 'pi-stacking') {
77088
+ interactionTypeStr = '&pi;-Stacking';
77089
+ }
77090
+ else if(interactionType == 'contact') {
77091
+ interactionTypeStr = 'Contacts';
77092
+ }
77093
+
77017
77094
  let id = resid2Real;
77018
77095
  if(bNotDrawNode || ic.resid2ToXy.hasOwnProperty(id)) {
77019
77096
  x2 = (ic.resid2ToXy.hasOwnProperty(id)) ? ic.resid2ToXy[id].x2 : prevX2;
@@ -77030,11 +77107,12 @@ class Ligplot {
77030
77107
  }
77031
77108
  }
77032
77109
 
77033
- line += '<line id="' + idpair + '" x1="' + x1b.toFixed(2) + '" y1="' + y1b.toFixed(2) + '" x2="' + x2.toFixed(2) + '" y2="' + y2.toFixed(2) + '" x0="' + x1.toFixed(2) + '" y0="' + y1.toFixed(2) + '" short="' + bShort + '" opacity="1.0" stroke="' + lineColor + '" stroke-width="' + strokeWidth + '" stroke-dasharray="5,5"/>\n';
77110
+ line +='<g><title>Interaction type: ' + interactionTypeStr + '; Distance: ' + parseFloat(dist).toFixed(1) + ' &#197;</title>';
77111
+ line += '<line class="icn3d-interaction" id="' + idpair + '" resid1="' + resid1Real + '" resid2="' + resid2Real + '" x1="' + x1b.toFixed(2) + '" y1="' + y1b.toFixed(2) + '" x2="' + x2.toFixed(2) + '" y2="' + y2.toFixed(2) + '" x0="' + x1.toFixed(2) + '" y0="' + y1.toFixed(2) + '" short="' + bShort + '" opacity="1.0" stroke="' + lineColor + '" stroke-width="' + strokeWidth + '" stroke-dasharray="5,5"/>\n';
77112
+ line += '</g>\n';
77034
77113
  }
77035
77114
  else {
77036
- node +='<g>';
77037
- node += '<title>' + resName2 + '</title>';
77115
+ node +='<g><title>' + resName2 + '</title>';
77038
77116
  // node += '<circle class='icn3d-ctnode' cx="' + x2.toFixed(2) + '" cy="' + y2.toFixed(2) + '" r="10" fill="#' + textColor2 + '" stroke-width="1" stroke="' + textColor2 + '" resid="' + resid2Real + '"/>';
77039
77117
  let boxWidth = 28, boxHeight = 14;
77040
77118
  node += '<rect id="' + id + '_node" x="' + (x2 - boxWidth*0.5).toFixed(2) + '" y="' + (y2 - boxHeight*0.5).toFixed(2) + '" width="' + boxWidth + '" height="' + boxHeight + '" rx="2" ry="2" fill="#' + textColor2 + '" stroke-width="1" stroke="' + textColor2 + '" resid="' + resid2Real + '"/>';
@@ -77042,7 +77120,9 @@ class Ligplot {
77042
77120
  node += '<text class="icn3d-ctnode" resid="' + id + '" id="' + id + '" x="' + x2.toFixed(2) + '" y="' + y2.toFixed(2) + '" fill="#000" stroke="none" text-anchor="middle" alignment-baseline="central" style="font-size:10px">' + resName2 + '</text>';
77043
77121
  node += '</g>\n';
77044
77122
 
77045
- line += '<line id="' + idpair + '" x1="' + x1.toFixed(2) + '" y1="' + y1.toFixed(2) + '" x2="' + x2.toFixed(2) + '" y2="' + y2.toFixed(2) + '" opacity="1.0" stroke="' + lineColor + '" stroke-width="' + strokeWidth + '" stroke-dasharray="5,5"/>\n';
77123
+ line +='<g><title>Interaction type: ' + interactionTypeStr + '; Distance: ' + parseFloat(dist).toFixed(1) + ' &#197;</title>';
77124
+ line += '<line class="icn3d-interaction" id="' + idpair + '" resid1="' + resid1Real + '" resid2="' + resid2Real + '" x1="' + x1.toFixed(2) + '" y1="' + y1.toFixed(2) + '" x2="' + x2.toFixed(2) + '" y2="' + y2.toFixed(2) + '" opacity="1.0" stroke="' + lineColor + '" stroke-width="' + strokeWidth + '" stroke-dasharray="5,5"/>';
77125
+ line += '</g>\n';
77046
77126
 
77047
77127
  if(interactionType != 'contact') {
77048
77128
  if(!ic.resid2ToXy.hasOwnProperty(resid2Real)) ic.resid2ToXy[resid2Real] = {x2: x2, y2: y2};
@@ -77062,26 +77142,29 @@ class Ligplot {
77062
77142
  start: function( e, ui ) {
77063
77143
  let oriX= parseFloat(e.target.getAttribute('x'));
77064
77144
  let oriY = parseFloat(e.target.getAttribute('y'));
77065
-
77066
77145
  e.target.setAttribute('x', oriX);
77067
77146
  e.target.setAttribute('y', oriY);
77068
77147
  },
77069
77148
  drag: function( e, ui ) {
77070
- let offsetX = $("#" + me.ligplotid).offset().left + ic.len4ang; // ic.len4ang was defined in svg viewbox
77071
- let offsetY = $("#" + me.ligplotid).offset().top + ic.len4ang;
77149
+ let ligplotScale = (ic.ligplotScale) ? ic.ligplotScale : 1;
77150
+
77151
+ let offsetX = $("#" + me.ligplotid).offset().left + ic.len4ang * ligplotScale; // ic.len4ang was defined in svg viewbox
77152
+ let offsetY = $("#" + me.ligplotid).offset().top + ic.len4ang * ligplotScale;
77072
77153
 
77073
77154
  let id = e.target.getAttribute('resid');
77074
- let x = (e.clientX - offsetX);
77075
- let y = (e.clientY - offsetY);
77155
+ let x = (e.clientX - offsetX) / ligplotScale;
77156
+ let y = (e.clientY - offsetY) / ligplotScale;
77076
77157
 
77077
77158
  let oriX = parseFloat(e.target.getAttribute('x'));
77078
77159
  let oriY = parseFloat(e.target.getAttribute('y'));
77079
77160
 
77080
77161
  // change for each step
77081
- let dx = (x - oriX) / ic.resizeRatioX;
77082
- let dy = (y - oriY) / ic.resizeRatioY;
77162
+ // let dx = (x - oriX) / ic.resizeRatioX;
77163
+ // let dy = (y - oriY) / ic.resizeRatioY;
77164
+ let dx = (x - oriX);
77165
+ let dy = (y - oriY);
77083
77166
 
77084
- // move the text label
77167
+ // move the node
77085
77168
  oriX = parseFloat($("#" + id + "_node").attr('x'));
77086
77169
  oriY = parseFloat($("#" + id + "_node").attr('y'));
77087
77170