icn3d 3.34.2 → 3.34.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
@@ -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};
@@ -40389,6 +40406,10 @@ class AnnoCddSite {
40389
40406
 
40390
40407
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html += ic.showSeqCls.insertMulGap(ic.seqStartLen[chnid], '-');
40391
40408
 
40409
+ if(me.bNode && type == 'domain') {
40410
+ ic.chainid2cdd[chnid].push(fulltitle + "_from_" + fromArray + "_to_" + toArray);
40411
+ }
40412
+
40392
40413
  for(let i = 0, il = ic.giSeq[chnid].length; i < il; ++i) {
40393
40414
  html += ic.showSeqCls.insertGap(chnid, i, '-');
40394
40415
 
@@ -42425,7 +42446,7 @@ class AnnoSnpClinVar {
42425
42446
  }
42426
42447
 
42427
42448
  //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>";
42449
+ 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
42450
  }
42430
42451
  else {
42431
42452
  if(bCoord && !me.cfg.hidelicense) {
@@ -42507,7 +42528,7 @@ class AnnoSnpClinVar {
42507
42528
  }
42508
42529
 
42509
42530
  //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>";
42531
+ 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
42532
  if(j < jl - 1) {
42512
42533
  snpTitle += '<br><br>';
42513
42534
  }
@@ -44699,7 +44720,8 @@ class AddTrack {
44699
44720
  $("#" + ic.pre + "tt_custom_" + chnid).append("<div id='" + ic.pre + "tt_custom_" + chnid + "_" + simpTitle + "'></div>");
44700
44721
  $("#" + ic.pre + "tt_custom_" + chnid + "_" + simpTitle).width(divLength);
44701
44722
 
44702
- let html = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
44723
+ // let html = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
44724
+ let html = '<div class="icn3d-dl_sequence">';
44703
44725
  let htmlExon = html;
44704
44726
  let html2 = html;
44705
44727
  let html3 = html;
@@ -45994,6 +46016,7 @@ class AddTrack {
45994
46016
  let title =(trackTitleArray[j].length < 20) ? trackTitleArray[j] : trackTitleArray[j].substr(0, 20) + '...';
45995
46017
  let bMsa = true;
45996
46018
  let exonArray = (acc2exons) ? acc2exons[trackTitleArray[j]] : undefined;
46019
+
45997
46020
  this.showNewTrack(chainid, title, text, undefined, undefined, type, undefined, bMsa, fromArray, toArray, seqStartLen, exonArray, offsetArray);
45998
46021
  }
45999
46022
 
@@ -46205,6 +46228,7 @@ class AddTrack {
46205
46228
  await thisClass.showMsaTracks(chainid, seqFirst, trackTitleArray, trackSeqArray, startpos, type, acc2exons);
46206
46229
 
46207
46230
  me.htmlCls.clickMenuCls.setLogCmd("add exon track | chainid " + chainid + " | geneid " + geneid + " | startpos " + startpos + " | type " + type, true);
46231
+ me.htmlCls.clickMenuCls.setLogCmd("set annotation custom", true);
46208
46232
  }
46209
46233
 
46210
46234
  async addMsaTracks(chainid, startpos, type, fastaList) { let ic = this.icn3d, me = ic.icn3dui;
@@ -47345,7 +47369,8 @@ class ShowAnno {
47345
47369
  $("#" + 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
47370
  $("#" + ic.pre + "anno_" + name).append("<br><hr><br>");
47347
47371
  // sequence, detailed view
47348
- let htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47372
+ // let htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47373
+ let htmlTmp = '<div class="icn3d-dl_sequence">';
47349
47374
  let chainType = 'Chem.', chainTypeFull = 'Chemical';
47350
47375
  //htmlTmp += '<div class="icn3d-seqTitle2" anno="sequence"><span style="white-space:nowrap;" title="' + chainTypeFull + ' ' + name + '">' + chainType + ' ' + name + '</span></div>';
47351
47376
  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 +47407,8 @@ class ShowAnno {
47382
47407
  }
47383
47408
 
47384
47409
  async processSeqData(chainid_seq) { let ic = this.icn3d, me = ic.icn3dui;
47410
+ ic.bAnnoShown = true;
47411
+
47385
47412
  for(let chnid in ic.protein_chainid) {
47386
47413
  let chnidBase = ic.protein_chainid[chnid];
47387
47414
  //if(chainid_seq.hasOwnProperty(chnid)) {
@@ -47899,11 +47926,17 @@ class ShowSeq {
47899
47926
  html += '</div>';
47900
47927
  html += '</div>'; // corresponds to above: html += '<div class="icn3d-dl_sequence">';
47901
47928
  html3 += '</div></div>';
47929
+ // if(me.cfg.blast_rep_id === chnid) {
47930
+ // htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence" style="border: solid 1px #000">';
47931
+ // }
47932
+ // else {
47933
+ // htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47934
+ // }
47902
47935
  if(me.cfg.blast_rep_id === chnid) {
47903
- htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence" style="border: solid 1px #000">';
47936
+ htmlTmp = '<div class="icn3d-dl_sequence" style="border: solid 1px #000">';
47904
47937
  }
47905
47938
  else {
47906
- htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47939
+ htmlTmp = '<div class="icn3d-dl_sequence">';
47907
47940
  }
47908
47941
  let chainType = 'Protein', chainTypeFull = 'Protein';
47909
47942
  if(type !== undefined) {
@@ -51470,7 +51503,7 @@ class ViewInterPairs {
51470
51503
  if(index2xy) {
51471
51504
  let serialArray1 = resid1Ori.substr(pos1 + 1).split(',');
51472
51505
 
51473
- let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter);
51506
+ let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, dist);
51474
51507
  svgHtmlNode += result.node;
51475
51508
  svgHtmlLine += result.line;
51476
51509
  }
@@ -51572,9 +51605,12 @@ class ViewInterPairs {
51572
51605
  let resids = resid1 + '|' + resid2;
51573
51606
 
51574
51607
  let serialArray1 = resids2distCnt[resids].serialArray1;
51575
-
51608
+ let dist1_dist2_atom1_atom2 = resids2distCnt[resids].dist1_dist2_atom1_atom2;
51609
+ let dist1 = dist1_dist2_atom1_atom2[0]; // min dist
51610
+ dist1_dist2_atom1_atom2[1]; // c-alpha dist
51611
+ // let dist = (dist1 < dist2) ? dist1 : dist2;
51576
51612
  let bNotDrawNode = (i == 0) ? false : true;
51577
- let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, bNotDrawNode, prevX2, prevY2);
51613
+ let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, dist1, bNotDrawNode, prevX2, prevY2);
51578
51614
  svgHtmlNode += result.node;
51579
51615
  svgHtmlLine += result.line;
51580
51616
  prevX2 = result.x2;
@@ -60230,10 +60266,7 @@ class ParserUtils {
60230
60266
  // display the structure right away. load the mns and sequences later
60231
60267
  setTimeout(async function(){
60232
60268
  if(ic.bInitial) {
60233
- // if(!ic.bAnnoShown || ic.bResetAnno) {
60234
- // if(me.cfg.showsets) {
60235
- // ic.definedSetsCls.showSets();
60236
- // }
60269
+ // if(ic.bInitial && (!ic.bAnnoShown || ic.bResetAnno)) {
60237
60270
  if(me.cfg.align !== undefined || me.cfg.chainalign !== undefined) {
60238
60271
  // expand the toolbar
60239
60272
  let id = ic.pre + 'selection';
@@ -66372,6 +66405,7 @@ class ApplyCommand {
66372
66405
  let scale = command.substr(pos + 1);
66373
66406
 
66374
66407
  $("#" + me.ligplotid + "_scale").val(scale);
66408
+ ic.ligplotScale = parseFloat(scale);
66375
66409
 
66376
66410
  $("#" + me.ligplotid).attr("width",(ic.ligplotWidth * parseFloat(scale)).toString() + "px");
66377
66411
  }
@@ -66600,6 +66634,7 @@ class ApplyCommand {
66600
66634
  }
66601
66635
  else if(command.indexOf('glycans cartoon') == 0) {
66602
66636
  let value = command.substr(command.lastIndexOf(' ') + 1);
66637
+
66603
66638
  if(value == 'yes') {
66604
66639
  ic.bGlycansCartoon = true;
66605
66640
  }
@@ -67062,21 +67097,21 @@ class DefinedSets {
67062
67097
 
67063
67098
  setProtNuclLigInMenu() { let ic = this.icn3d; ic.icn3dui;
67064
67099
  // Initially, add proteins, nucleotides, chemicals, ions, water into the menu "custom selections"
67065
- if(Object.keys(ic.proteins).length > 0) {
67100
+ if(ic.proteins && Object.keys(ic.proteins).length > 0) {
67066
67101
  //ic.defNames2Atoms['proteins'] = Object.keys(ic.proteins);
67067
67102
  ic.defNames2Residues['proteins'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.proteins));
67068
67103
  ic.defNames2Descr['proteins'] = 'proteins';
67069
67104
  ic.defNames2Command['proteins'] = 'select :proteins';
67070
67105
  }
67071
67106
 
67072
- if(Object.keys(ic.nucleotides).length > 0) {
67107
+ if(ic.nucleotides && Object.keys(ic.nucleotides).length > 0) {
67073
67108
  //ic.defNames2Atoms['nucleotides'] = Object.keys(ic.nucleotides);
67074
67109
  ic.defNames2Residues['nucleotides'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.nucleotides));
67075
67110
  ic.defNames2Descr['nucleotides'] = 'nucleotides';
67076
67111
  ic.defNames2Command['nucleotides'] = 'select :nucleotides';
67077
67112
  }
67078
67113
 
67079
- if(Object.keys(ic.chemicals).length > 0) {
67114
+ if(ic.chemicals && Object.keys(ic.chemicals).length > 0) {
67080
67115
  //ic.defNames2Atoms['chemicals'] = Object.keys(ic.chemicals);
67081
67116
  if(ic.bOpm) {
67082
67117
  let chemicalResHash = {}, memResHash = {};
@@ -67110,14 +67145,14 @@ class DefinedSets {
67110
67145
  }
67111
67146
  }
67112
67147
 
67113
- if(Object.keys(ic.ions).length > 0) {
67148
+ if(ic.ions && Object.keys(ic.ions).length > 0) {
67114
67149
  //ic.defNames2Atoms['ions'] = Object.keys(ic.ions);
67115
67150
  ic.defNames2Residues['ions'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.ions));
67116
67151
  ic.defNames2Descr['ions'] = 'ions';
67117
67152
  ic.defNames2Command['ions'] = 'select :ions';
67118
67153
  }
67119
67154
 
67120
- if(Object.keys(ic.water).length > 0) {
67155
+ if(ic.water && Object.keys(ic.water).length > 0) {
67121
67156
  //ic.defNames2Atoms['water'] = Object.keys(ic.water);
67122
67157
  ic.defNames2Residues['water'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.water));
67123
67158
  ic.defNames2Descr['water'] = 'water';
@@ -67248,7 +67283,7 @@ class DefinedSets {
67248
67283
  }
67249
67284
 
67250
67285
  // select whole structure
67251
- if(Object.keys(ic.structures) == 1) {
67286
+ if(ic.structures && Object.keys(ic.structures) == 1) {
67252
67287
  let structure = Object.keys(ic.structures)[0];
67253
67288
 
67254
67289
  ic.defNames2Residues[structure] = Object.keys(ic.residues);
@@ -67256,7 +67291,7 @@ class DefinedSets {
67256
67291
 
67257
67292
  ic.defNames2Command[structure] = 'select $' + structure;
67258
67293
  }
67259
- else {
67294
+ else if(ic.residues) {
67260
67295
  let resArray = Object.keys(ic.residues);
67261
67296
  let structResHash = {};
67262
67297
  for(let i = 0, il = resArray.length; i < il; ++i) {
@@ -68335,7 +68370,7 @@ class LoadScript {
68335
68370
 
68336
68371
  let chainid = paraArray[1].substr(8);
68337
68372
  let geneid = paraArray[2].substr(7);
68338
- let startpos = paraArray[3].substr(9);
68373
+ let startpos = parseInt(paraArray[3].substr(9));
68339
68374
  let type = paraArray[4].substr(5);
68340
68375
 
68341
68376
  if($("#" + ic.pre + "anno_custom")[0]) {
@@ -75654,6 +75689,12 @@ class Diagram2d {
75654
75689
  thisClass.clickInteraction(this);
75655
75690
  });
75656
75691
 
75692
+ $(document).on("click", "#" + ic.pre + "dl_ligplot .icn3d-interaction", function(e) { thisClass.icn3d;
75693
+ e.stopImmediatePropagation();
75694
+
75695
+ thisClass.clickInteraction(this);
75696
+ });
75697
+
75657
75698
  $(document).on("click", "#" + ic.pre + "dl_alignerrormap .icn3d-node", function(e) { thisClass.icn3d;
75658
75699
  e.stopImmediatePropagation();
75659
75700
 
@@ -76902,7 +76943,7 @@ class Ligplot {
76902
76943
  }
76903
76944
 
76904
76945
 
76905
- getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, bNotDrawNode, prevX2, prevY2) { let ic = this.icn3d, me = ic.icn3dui;
76946
+ getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, dist, bNotDrawNode, prevX2, prevY2) { let ic = this.icn3d, me = ic.icn3dui;
76906
76947
  let xOffset = 1, yOffset = -1;
76907
76948
  let bondLen = (interactionType == 'hbond' || interactionType == 'contact' || interactionType == 'halogen') ? ic.len4ang : ic.len4ang * 1.5; // real distance should be bout 120, not 80
76908
76949
  let shortBondLen = ic.len4ang / 2;
@@ -77014,6 +77055,26 @@ class Ligplot {
77014
77055
  // sometimes the same ligand atom is used in both Hbond and contact. THus we add "interactionType"
77015
77056
  let idpair = resid2Real + '--' + serialArray1.join('-') + interactionType;
77016
77057
 
77058
+ let interactionTypeStr;
77059
+ if(interactionType == 'hbond') {
77060
+ interactionTypeStr = 'H-Bonds';
77061
+ }
77062
+ else if(interactionType == 'ionic') {
77063
+ interactionTypeStr = 'Salt Bridge/Ionic';
77064
+ }
77065
+ else if(interactionType == 'halogen') {
77066
+ interactionTypeStr = 'Halogen Bonds';
77067
+ }
77068
+ else if(interactionType == 'pi-cation') {
77069
+ interactionTypeStr = '&pi;-Cation';
77070
+ }
77071
+ else if(interactionType == 'pi-stacking') {
77072
+ interactionTypeStr = '&pi;-Stacking';
77073
+ }
77074
+ else if(interactionType == 'contact') {
77075
+ interactionTypeStr = 'Contacts';
77076
+ }
77077
+
77017
77078
  let id = resid2Real;
77018
77079
  if(bNotDrawNode || ic.resid2ToXy.hasOwnProperty(id)) {
77019
77080
  x2 = (ic.resid2ToXy.hasOwnProperty(id)) ? ic.resid2ToXy[id].x2 : prevX2;
@@ -77030,11 +77091,12 @@ class Ligplot {
77030
77091
  }
77031
77092
  }
77032
77093
 
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';
77094
+ line +='<g><title>Interaction type: ' + interactionTypeStr + '; Distance: ' + parseFloat(dist).toFixed(1) + ' &#197;</title>';
77095
+ 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';
77096
+ line += '</g>\n';
77034
77097
  }
77035
77098
  else {
77036
- node +='<g>';
77037
- node += '<title>' + resName2 + '</title>';
77099
+ node +='<g><title>' + resName2 + '</title>';
77038
77100
  // 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
77101
  let boxWidth = 28, boxHeight = 14;
77040
77102
  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 +77104,9 @@ class Ligplot {
77042
77104
  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
77105
  node += '</g>\n';
77044
77106
 
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';
77107
+ line +='<g><title>Interaction type: ' + interactionTypeStr + '; Distance: ' + parseFloat(dist).toFixed(1) + ' &#197;</title>';
77108
+ 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"/>';
77109
+ line += '</g>\n';
77046
77110
 
77047
77111
  if(interactionType != 'contact') {
77048
77112
  if(!ic.resid2ToXy.hasOwnProperty(resid2Real)) ic.resid2ToXy[resid2Real] = {x2: x2, y2: y2};
@@ -77062,26 +77126,29 @@ class Ligplot {
77062
77126
  start: function( e, ui ) {
77063
77127
  let oriX= parseFloat(e.target.getAttribute('x'));
77064
77128
  let oriY = parseFloat(e.target.getAttribute('y'));
77065
-
77066
77129
  e.target.setAttribute('x', oriX);
77067
77130
  e.target.setAttribute('y', oriY);
77068
77131
  },
77069
77132
  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;
77133
+ let ligplotScale = (ic.ligplotScale) ? ic.ligplotScale : 1;
77134
+
77135
+ let offsetX = $("#" + me.ligplotid).offset().left + ic.len4ang * ligplotScale; // ic.len4ang was defined in svg viewbox
77136
+ let offsetY = $("#" + me.ligplotid).offset().top + ic.len4ang * ligplotScale;
77072
77137
 
77073
77138
  let id = e.target.getAttribute('resid');
77074
- let x = (e.clientX - offsetX);
77075
- let y = (e.clientY - offsetY);
77139
+ let x = (e.clientX - offsetX) / ligplotScale;
77140
+ let y = (e.clientY - offsetY) / ligplotScale;
77076
77141
 
77077
77142
  let oriX = parseFloat(e.target.getAttribute('x'));
77078
77143
  let oriY = parseFloat(e.target.getAttribute('y'));
77079
77144
 
77080
77145
  // change for each step
77081
- let dx = (x - oriX) / ic.resizeRatioX;
77082
- let dy = (y - oriY) / ic.resizeRatioY;
77146
+ // let dx = (x - oriX) / ic.resizeRatioX;
77147
+ // let dy = (y - oriY) / ic.resizeRatioY;
77148
+ let dx = (x - oriX);
77149
+ let dy = (y - oriY);
77083
77150
 
77084
- // move the text label
77151
+ // move the node
77085
77152
  oriX = parseFloat($("#" + id + "_node").attr('x'));
77086
77153
  oriY = parseFloat($("#" + id + "_node").attr('y'));
77087
77154