icn3d 3.34.1 → 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
 
@@ -15614,8 +15615,8 @@ class Events {
15614
15615
  hostUrl = (pos == -1) ? hostUrl : hostUrl.substr(0, pos);
15615
15616
 
15616
15617
  // some URLs from VAST search are like https://www.ncbi.nlm.nih.gov/Structure/vast/icn3d/
15617
- if(hostUrl == 'https://www.ncbi.nlm.nih.gov/Structure/vast/icn3d/') {
15618
- hostUrl = 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/';
15618
+ if(hostUrl.indexOf('/vast/icn3d/')) {
15619
+ hostUrl = hostUrl.replace(/\/vast\/icn3d\//g, '/icn3d/');
15619
15620
  }
15620
15621
 
15621
15622
  ic.definedSetsCls.clickCustomAtoms();
@@ -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
 
@@ -38594,15 +38608,16 @@ class SetColor {
38594
38608
  atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
38595
38609
 
38596
38610
  for (let i in atoms) {
38597
- let atom = ic.atoms[i];
38598
- if(!atom.het) ++cnt;
38611
+ ic.atoms[i];
38612
+ // if(!atom.het) ++cnt;
38613
+ ++cnt;
38599
38614
  }
38600
38615
 
38601
38616
  let lastTerSerialInv = (cnt > 1) ? 1 / (cnt - 1) : 1;
38602
38617
  for (let i in atoms) {
38603
38618
  let atom = ic.atoms[i];
38604
- //atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(2 / 3 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
38605
- atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
38619
+ // atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
38620
+ atom.color = me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
38606
38621
 
38607
38622
  ic.atomPrevColors[i] = atom.color;
38608
38623
  }
@@ -38616,14 +38631,16 @@ class SetColor {
38616
38631
  atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
38617
38632
 
38618
38633
  for (let i in atoms) {
38619
- let atom = ic.atoms[i];
38620
- if(!atom.het) ++cnt;
38634
+ ic.atoms[i];
38635
+ // if(!atom.het) ++cnt;
38636
+ ++cnt;
38621
38637
  }
38622
38638
 
38623
38639
  let lastTerSerialInv = (cnt > 1) ? 1 / (cnt - 1) : 1;
38624
38640
  for (let i in atoms) {
38625
38641
  let atom = ic.atoms[i];
38626
- atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
38642
+ // atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
38643
+ atom.color = me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
38627
38644
 
38628
38645
  ic.atomPrevColors[i] = atom.color;
38629
38646
  }
@@ -40073,6 +40090,7 @@ class AnnoCddSite {
40073
40090
  if(me.bNode) {
40074
40091
  if(!ic.resid2cdd) ic.resid2cdd = {};
40075
40092
  if(!ic.resid2site) ic.resid2site = {};
40093
+ if(!ic.chainid2cdd) ic.chainid2cdd = {};
40076
40094
  }
40077
40095
 
40078
40096
  for(let i = 0, il = dataArray.length; i < il; ++i) {
@@ -40095,6 +40113,8 @@ class AnnoCddSite {
40095
40113
  let html3 = html;
40096
40114
  let domainArray = cddData.doms;
40097
40115
  if(me.bNode && !ic.resid2cdd[chnid]) ic.resid2cdd[chnid] = [];
40116
+ if(me.bNode && !ic.chainid2cdd[chnid]) ic.chainid2cdd[chnid] = [];
40117
+
40098
40118
  let result = thisClass.setDomainFeature(domainArray, chnid, 'domain', html, html2, html3);
40099
40119
 
40100
40120
  ic.chainid2pssmid[chnid] = {pssmid2name: result.pssmid2name, pssmid2fromArray: result.pssmid2fromArray, pssmid2toArray: result.pssmid2toArray};
@@ -40386,6 +40406,10 @@ class AnnoCddSite {
40386
40406
 
40387
40407
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html += ic.showSeqCls.insertMulGap(ic.seqStartLen[chnid], '-');
40388
40408
 
40409
+ if(me.bNode && type == 'domain') {
40410
+ ic.chainid2cdd[chnid].push(fulltitle + "_from_" + fromArray + "_to_" + toArray);
40411
+ }
40412
+
40389
40413
  for(let i = 0, il = ic.giSeq[chnid].length; i < il; ++i) {
40390
40414
  html += ic.showSeqCls.insertGap(chnid, i, '-');
40391
40415
 
@@ -42422,7 +42446,7 @@ class AnnoSnpClinVar {
42422
42446
  }
42423
42447
 
42424
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>";
42425
- 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>";
42426
42450
  }
42427
42451
  else {
42428
42452
  if(bCoord && !me.cfg.hidelicense) {
@@ -42504,7 +42528,7 @@ class AnnoSnpClinVar {
42504
42528
  }
42505
42529
 
42506
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>";
42507
- 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>";
42508
42532
  if(j < jl - 1) {
42509
42533
  snpTitle += '<br><br>';
42510
42534
  }
@@ -44696,7 +44720,8 @@ class AddTrack {
44696
44720
  $("#" + ic.pre + "tt_custom_" + chnid).append("<div id='" + ic.pre + "tt_custom_" + chnid + "_" + simpTitle + "'></div>");
44697
44721
  $("#" + ic.pre + "tt_custom_" + chnid + "_" + simpTitle).width(divLength);
44698
44722
 
44699
- 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">';
44700
44725
  let htmlExon = html;
44701
44726
  let html2 = html;
44702
44727
  let html3 = html;
@@ -45991,6 +46016,7 @@ class AddTrack {
45991
46016
  let title =(trackTitleArray[j].length < 20) ? trackTitleArray[j] : trackTitleArray[j].substr(0, 20) + '...';
45992
46017
  let bMsa = true;
45993
46018
  let exonArray = (acc2exons) ? acc2exons[trackTitleArray[j]] : undefined;
46019
+
45994
46020
  this.showNewTrack(chainid, title, text, undefined, undefined, type, undefined, bMsa, fromArray, toArray, seqStartLen, exonArray, offsetArray);
45995
46021
  }
45996
46022
 
@@ -46202,6 +46228,7 @@ class AddTrack {
46202
46228
  await thisClass.showMsaTracks(chainid, seqFirst, trackTitleArray, trackSeqArray, startpos, type, acc2exons);
46203
46229
 
46204
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);
46205
46232
  }
46206
46233
 
46207
46234
  async addMsaTracks(chainid, startpos, type, fastaList) { let ic = this.icn3d, me = ic.icn3dui;
@@ -47342,7 +47369,8 @@ class ShowAnno {
47342
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>");
47343
47370
  $("#" + ic.pre + "anno_" + name).append("<br><hr><br>");
47344
47371
  // sequence, detailed view
47345
- 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">';
47346
47374
  let chainType = 'Chem.', chainTypeFull = 'Chemical';
47347
47375
  //htmlTmp += '<div class="icn3d-seqTitle2" anno="sequence"><span style="white-space:nowrap;" title="' + chainTypeFull + ' ' + name + '">' + chainType + ' ' + name + '</span></div>';
47348
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>';
@@ -47379,6 +47407,8 @@ class ShowAnno {
47379
47407
  }
47380
47408
 
47381
47409
  async processSeqData(chainid_seq) { let ic = this.icn3d, me = ic.icn3dui;
47410
+ ic.bAnnoShown = true;
47411
+
47382
47412
  for(let chnid in ic.protein_chainid) {
47383
47413
  let chnidBase = ic.protein_chainid[chnid];
47384
47414
  //if(chainid_seq.hasOwnProperty(chnid)) {
@@ -47896,11 +47926,17 @@ class ShowSeq {
47896
47926
  html += '</div>';
47897
47927
  html += '</div>'; // corresponds to above: html += '<div class="icn3d-dl_sequence">';
47898
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
+ // }
47899
47935
  if(me.cfg.blast_rep_id === chnid) {
47900
- 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">';
47901
47937
  }
47902
47938
  else {
47903
- htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
47939
+ htmlTmp = '<div class="icn3d-dl_sequence">';
47904
47940
  }
47905
47941
  let chainType = 'Protein', chainTypeFull = 'Protein';
47906
47942
  if(type !== undefined) {
@@ -51467,7 +51503,7 @@ class ViewInterPairs {
51467
51503
  if(index2xy) {
51468
51504
  let serialArray1 = resid1Ori.substr(pos1 + 1).split(',');
51469
51505
 
51470
- 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);
51471
51507
  svgHtmlNode += result.node;
51472
51508
  svgHtmlLine += result.line;
51473
51509
  }
@@ -51569,9 +51605,12 @@ class ViewInterPairs {
51569
51605
  let resids = resid1 + '|' + resid2;
51570
51606
 
51571
51607
  let serialArray1 = resids2distCnt[resids].serialArray1;
51572
-
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;
51573
51612
  let bNotDrawNode = (i == 0) ? false : true;
51574
- 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);
51575
51614
  svgHtmlNode += result.node;
51576
51615
  svgHtmlLine += result.line;
51577
51616
  prevX2 = result.x2;
@@ -52958,16 +52997,17 @@ class ChainalignParser {
52958
52997
  // calculate secondary structures with applyCommandDssp
52959
52998
  //$.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
52960
52999
  await ic.pdbParserCls.applyCommandDssp(true);
52961
-
53000
+ //!!!
53001
+ /*
52962
53002
  // original version =============
52963
53003
  // align PDB chains
52964
53004
  for(let index in ic.pdbChainIndexHash) {
52965
53005
  //ic.pdbChainIndexHash[index] = mmdbid_q_tmp + "_" + ic.chain_q + "_" + ic.mmdbid_t + "_" + ic.chain_t;
52966
53006
  let idArray = ic.pdbChainIndexHash[index].split('_');
52967
53007
  mmdbid_q = idArray[0];
52968
- idArray[1];
53008
+ let chain_q = idArray[1];
52969
53009
  mmdbid_t = idArray[2];
52970
- idArray[3];
53010
+ let chain_t = idArray[3];
52971
53011
 
52972
53012
  thisClass.transformStructure(mmdbid_q, index-1, 'query');
52973
53013
  }
@@ -52977,7 +53017,7 @@ class ChainalignParser {
52977
53017
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
52978
53018
  let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
52979
53019
 
52980
- let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(' | ') : [];
53020
+ let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(',') : [];
52981
53021
 
52982
53022
  for(let index in ic.afChainIndexHash) {
52983
53023
  let idArray = ic.afChainIndexHash[index].split('_');
@@ -52989,25 +53029,26 @@ class ChainalignParser {
52989
53029
  let chain_t = idArray[3];
52990
53030
  let chainid_t = mmdbid_t + '_' + chain_t;
52991
53031
 
52992
- let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t).hAtoms : ic.chains[chainid_t];
52993
- let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q).hAtoms : ic.chains[chainid_q];
53032
+ // let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t, true).hAtoms : ic.chains[chainid_t];
53033
+ // let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q, true).hAtoms : ic.chains[chainid_q];
53034
+ let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[0]], chainid_t, true).hAtoms : ic.chains[chainid_t];
53035
+ let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[index]], chainid_q, true).hAtoms : ic.chains[chainid_q];
52994
53036
  // end of original version =============
52995
-
52996
- /*
53037
+ */
53038
+
52997
53039
  // new version to be done for VASTsrv ==============
52998
53040
  // dynamically align pairs in all chainids
52999
53041
  let ajaxArray = [], indexArray = [], struArray = [];
53000
53042
  let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
53001
53043
  let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
53002
53044
 
53003
- let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(' | ') : [];
53045
+ let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(',') : [];
53004
53046
 
53005
53047
  // dynamically align pairs in all chainids
53006
- let atomSet_t = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainidArray[0]).hAtoms : ic.chains[chainidArray[0]];
53048
+ let atomSet_t = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[0]], chainidArray[0], true).hAtoms : ic.chains[chainidArray[0]];
53007
53049
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
53008
- let atomSet_q = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainidArray[index]).hAtoms : ic.chains[chainidArray[index]];
53050
+ let atomSet_q = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[index]], chainidArray[index], true).hAtoms : ic.chains[chainidArray[index]];
53009
53051
  // end of new version to be done for VASTsrv ==============
53010
- */
53011
53052
 
53012
53053
  let alignAjax;
53013
53054
  if(me.cfg.aligntool != 'tmalign') {
@@ -53235,10 +53276,11 @@ class ChainalignParser {
53235
53276
 
53236
53277
  // chainid1 is target
53237
53278
  aligType = 'target';
53238
- this.transformStructure(target, index, aligType);
53279
+ let bForce = true;
53280
+ this.transformStructure(target, index, aligType, bForce);
53239
53281
 
53240
53282
  aligType = 'query';
53241
- this.transformStructure(query, index, aligType);
53283
+ this.transformStructure(query, index, aligType, bForce);
53242
53284
 
53243
53285
  allChainidHash[chainidArray[0]] = 1;
53244
53286
  allChainidHash[chainidArray[1]] = 1;
@@ -53916,8 +53958,12 @@ class ChainalignParser {
53916
53958
 
53917
53959
  if(bQuery && me.cfg.matchedchains) {
53918
53960
  // $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
53919
- let bRealign = true, bPredefined = true;
53920
- await ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
53961
+ // let bRealign = true, bPredefined = true;
53962
+ // await ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
53963
+
53964
+ ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(ic.chainidArray);
53965
+ await ic.realignParserCls.realignOnStructAlign();
53966
+
53921
53967
  // reset annotations
53922
53968
  $("#" + ic.pre + "dl_annotations").html("");
53923
53969
  ic.bAnnoShown = false;
@@ -58488,7 +58534,7 @@ class RealignParser {
58488
58534
  }
58489
58535
  }
58490
58536
 
58491
- getSeqCoorResid(resiArray, chainid) { let ic = this.icn3d, me = ic.icn3dui;
58537
+ getSeqCoorResid(resiArray, chainid, bNCBI) { let ic = this.icn3d, me = ic.icn3dui;
58492
58538
  let seq = '', coorArray = [], residArray = [];
58493
58539
  let hAtoms = {};
58494
58540
 
@@ -58496,15 +58542,7 @@ class RealignParser {
58496
58542
  if(resiArray[j].indexOf('-') != -1) {
58497
58543
  let startEnd = resiArray[j].split('-');
58498
58544
  for(let k = parseInt(startEnd[0]); k <= parseInt(startEnd[1]); ++k) {
58499
- // from VAST neighbor page, use NCBI residue number
58500
- //if(me.cfg.usepdbnum === false) k += base - 1;
58501
-
58502
- //let seqIndex = k - base;
58503
- let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
58504
- // if(ic.bNCBI) {
58505
- // let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
58506
- // if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
58507
- // }
58545
+ let seqIndex = (bNCBI) ? k : ic.setSeqAlignCls.getPosFromResi(chainid, k);
58508
58546
 
58509
58547
  // don't align solvent or chemicals
58510
58548
  if(!ic.chainsSeq[chainid] || !ic.chainsSeq[chainid][seqIndex] || me.parasCls.b62ResArray.indexOf(ic.chainsSeq[chainid][seqIndex].name.toUpperCase()) == -1) continue;
@@ -58516,20 +58554,14 @@ class RealignParser {
58516
58554
  residArray.push(chainid + '_' + k);
58517
58555
  }
58518
58556
  }
58557
+ else if(resiArray[j] == 0) { // 0 means the whole chain
58558
+ let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.chains[chainid]);
58559
+ residArray = Object.keys(residueHash);
58560
+ }
58519
58561
  else { // one residue
58520
-
58521
- //let k = parseInt(resiArray[j]);
58522
58562
  let k = resiArray[j];
58523
- // from VAST neighbor page, use NCBI residue number
58524
- //if(me.cfg.usepdbnum === false) k += base - 1;
58525
-
58526
- //let seqIndex = k - base;
58527
- let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
58528
58563
 
58529
- // if(ic.bNCBI) {
58530
- // let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
58531
- // if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
58532
- // }
58564
+ let seqIndex = (bNCBI) ? k : ic.setSeqAlignCls.getPosFromResi(chainid, k);
58533
58565
 
58534
58566
  if(!ic.chainsSeq[chainid][seqIndex]) continue;
58535
58567
 
@@ -60234,10 +60266,7 @@ class ParserUtils {
60234
60266
  // display the structure right away. load the mns and sequences later
60235
60267
  setTimeout(async function(){
60236
60268
  if(ic.bInitial) {
60237
- // if(!ic.bAnnoShown || ic.bResetAnno) {
60238
- // if(me.cfg.showsets) {
60239
- // ic.definedSetsCls.showSets();
60240
- // }
60269
+ // if(ic.bInitial && (!ic.bAnnoShown || ic.bResetAnno)) {
60241
60270
  if(me.cfg.align !== undefined || me.cfg.chainalign !== undefined) {
60242
60271
  // expand the toolbar
60243
60272
  let id = ic.pre + 'selection';
@@ -66376,6 +66405,7 @@ class ApplyCommand {
66376
66405
  let scale = command.substr(pos + 1);
66377
66406
 
66378
66407
  $("#" + me.ligplotid + "_scale").val(scale);
66408
+ ic.ligplotScale = parseFloat(scale);
66379
66409
 
66380
66410
  $("#" + me.ligplotid).attr("width",(ic.ligplotWidth * parseFloat(scale)).toString() + "px");
66381
66411
  }
@@ -66604,6 +66634,7 @@ class ApplyCommand {
66604
66634
  }
66605
66635
  else if(command.indexOf('glycans cartoon') == 0) {
66606
66636
  let value = command.substr(command.lastIndexOf(' ') + 1);
66637
+
66607
66638
  if(value == 'yes') {
66608
66639
  ic.bGlycansCartoon = true;
66609
66640
  }
@@ -67066,21 +67097,21 @@ class DefinedSets {
67066
67097
 
67067
67098
  setProtNuclLigInMenu() { let ic = this.icn3d; ic.icn3dui;
67068
67099
  // Initially, add proteins, nucleotides, chemicals, ions, water into the menu "custom selections"
67069
- if(Object.keys(ic.proteins).length > 0) {
67100
+ if(ic.proteins && Object.keys(ic.proteins).length > 0) {
67070
67101
  //ic.defNames2Atoms['proteins'] = Object.keys(ic.proteins);
67071
67102
  ic.defNames2Residues['proteins'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.proteins));
67072
67103
  ic.defNames2Descr['proteins'] = 'proteins';
67073
67104
  ic.defNames2Command['proteins'] = 'select :proteins';
67074
67105
  }
67075
67106
 
67076
- if(Object.keys(ic.nucleotides).length > 0) {
67107
+ if(ic.nucleotides && Object.keys(ic.nucleotides).length > 0) {
67077
67108
  //ic.defNames2Atoms['nucleotides'] = Object.keys(ic.nucleotides);
67078
67109
  ic.defNames2Residues['nucleotides'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.nucleotides));
67079
67110
  ic.defNames2Descr['nucleotides'] = 'nucleotides';
67080
67111
  ic.defNames2Command['nucleotides'] = 'select :nucleotides';
67081
67112
  }
67082
67113
 
67083
- if(Object.keys(ic.chemicals).length > 0) {
67114
+ if(ic.chemicals && Object.keys(ic.chemicals).length > 0) {
67084
67115
  //ic.defNames2Atoms['chemicals'] = Object.keys(ic.chemicals);
67085
67116
  if(ic.bOpm) {
67086
67117
  let chemicalResHash = {}, memResHash = {};
@@ -67114,14 +67145,14 @@ class DefinedSets {
67114
67145
  }
67115
67146
  }
67116
67147
 
67117
- if(Object.keys(ic.ions).length > 0) {
67148
+ if(ic.ions && Object.keys(ic.ions).length > 0) {
67118
67149
  //ic.defNames2Atoms['ions'] = Object.keys(ic.ions);
67119
67150
  ic.defNames2Residues['ions'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.ions));
67120
67151
  ic.defNames2Descr['ions'] = 'ions';
67121
67152
  ic.defNames2Command['ions'] = 'select :ions';
67122
67153
  }
67123
67154
 
67124
- if(Object.keys(ic.water).length > 0) {
67155
+ if(ic.water && Object.keys(ic.water).length > 0) {
67125
67156
  //ic.defNames2Atoms['water'] = Object.keys(ic.water);
67126
67157
  ic.defNames2Residues['water'] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.water));
67127
67158
  ic.defNames2Descr['water'] = 'water';
@@ -67252,7 +67283,7 @@ class DefinedSets {
67252
67283
  }
67253
67284
 
67254
67285
  // select whole structure
67255
- if(Object.keys(ic.structures) == 1) {
67286
+ if(ic.structures && Object.keys(ic.structures) == 1) {
67256
67287
  let structure = Object.keys(ic.structures)[0];
67257
67288
 
67258
67289
  ic.defNames2Residues[structure] = Object.keys(ic.residues);
@@ -67260,7 +67291,7 @@ class DefinedSets {
67260
67291
 
67261
67292
  ic.defNames2Command[structure] = 'select $' + structure;
67262
67293
  }
67263
- else {
67294
+ else if(ic.residues) {
67264
67295
  let resArray = Object.keys(ic.residues);
67265
67296
  let structResHash = {};
67266
67297
  for(let i = 0, il = resArray.length; i < il; ++i) {
@@ -68339,7 +68370,7 @@ class LoadScript {
68339
68370
 
68340
68371
  let chainid = paraArray[1].substr(8);
68341
68372
  let geneid = paraArray[2].substr(7);
68342
- let startpos = paraArray[3].substr(9);
68373
+ let startpos = parseInt(paraArray[3].substr(9));
68343
68374
  let type = paraArray[4].substr(5);
68344
68375
 
68345
68376
  if($("#" + ic.pre + "anno_custom")[0]) {
@@ -68530,9 +68561,10 @@ class LoadScript {
68530
68561
 
68531
68562
  if(command.indexOf('load') !== -1) { // 'load pdb [pdbid]'
68532
68563
  let load_parameters = command.split(' | ');
68533
-
68534
68564
  let loadStr = load_parameters[0];
68535
- if(load_parameters.length > 1) {
68565
+
68566
+ // do not reset me.cfg.inpara from "command=..." part if it was not empty
68567
+ if(load_parameters.length > 1 && !me.cfg.inpara) {
68536
68568
  let firstSpacePos = load_parameters[load_parameters.length - 1].indexOf(' ');
68537
68569
  me.cfg.inpara = load_parameters[load_parameters.length - 1].substr(firstSpacePos + 1);
68538
68570
  if(me.cfg.inpara === 'undefined') {
@@ -75657,6 +75689,12 @@ class Diagram2d {
75657
75689
  thisClass.clickInteraction(this);
75658
75690
  });
75659
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
+
75660
75698
  $(document).on("click", "#" + ic.pre + "dl_alignerrormap .icn3d-node", function(e) { thisClass.icn3d;
75661
75699
  e.stopImmediatePropagation();
75662
75700
 
@@ -76905,7 +76943,7 @@ class Ligplot {
76905
76943
  }
76906
76944
 
76907
76945
 
76908
- 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;
76909
76947
  let xOffset = 1, yOffset = -1;
76910
76948
  let bondLen = (interactionType == 'hbond' || interactionType == 'contact' || interactionType == 'halogen') ? ic.len4ang : ic.len4ang * 1.5; // real distance should be bout 120, not 80
76911
76949
  let shortBondLen = ic.len4ang / 2;
@@ -77017,6 +77055,26 @@ class Ligplot {
77017
77055
  // sometimes the same ligand atom is used in both Hbond and contact. THus we add "interactionType"
77018
77056
  let idpair = resid2Real + '--' + serialArray1.join('-') + interactionType;
77019
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
+
77020
77078
  let id = resid2Real;
77021
77079
  if(bNotDrawNode || ic.resid2ToXy.hasOwnProperty(id)) {
77022
77080
  x2 = (ic.resid2ToXy.hasOwnProperty(id)) ? ic.resid2ToXy[id].x2 : prevX2;
@@ -77033,11 +77091,12 @@ class Ligplot {
77033
77091
  }
77034
77092
  }
77035
77093
 
77036
- 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';
77037
77097
  }
77038
77098
  else {
77039
- node +='<g>';
77040
- node += '<title>' + resName2 + '</title>';
77099
+ node +='<g><title>' + resName2 + '</title>';
77041
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 + '"/>';
77042
77101
  let boxWidth = 28, boxHeight = 14;
77043
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 + '"/>';
@@ -77045,7 +77104,9 @@ class Ligplot {
77045
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>';
77046
77105
  node += '</g>\n';
77047
77106
 
77048
- 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';
77049
77110
 
77050
77111
  if(interactionType != 'contact') {
77051
77112
  if(!ic.resid2ToXy.hasOwnProperty(resid2Real)) ic.resid2ToXy[resid2Real] = {x2: x2, y2: y2};
@@ -77065,26 +77126,29 @@ class Ligplot {
77065
77126
  start: function( e, ui ) {
77066
77127
  let oriX= parseFloat(e.target.getAttribute('x'));
77067
77128
  let oriY = parseFloat(e.target.getAttribute('y'));
77068
-
77069
77129
  e.target.setAttribute('x', oriX);
77070
77130
  e.target.setAttribute('y', oriY);
77071
77131
  },
77072
77132
  drag: function( e, ui ) {
77073
- let offsetX = $("#" + me.ligplotid).offset().left + ic.len4ang; // ic.len4ang was defined in svg viewbox
77074
- 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;
77075
77137
 
77076
77138
  let id = e.target.getAttribute('resid');
77077
- let x = (e.clientX - offsetX);
77078
- let y = (e.clientY - offsetY);
77139
+ let x = (e.clientX - offsetX) / ligplotScale;
77140
+ let y = (e.clientY - offsetY) / ligplotScale;
77079
77141
 
77080
77142
  let oriX = parseFloat(e.target.getAttribute('x'));
77081
77143
  let oriY = parseFloat(e.target.getAttribute('y'));
77082
77144
 
77083
77145
  // change for each step
77084
- let dx = (x - oriX) / ic.resizeRatioX;
77085
- 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);
77086
77150
 
77087
- // move the text label
77151
+ // move the node
77088
77152
  oriX = parseFloat($("#" + id + "_node").attr('x'));
77089
77153
  oriY = parseFloat($("#" + id + "_node").attr('y'));
77090
77154
 
@@ -81910,7 +81974,7 @@ class iCn3DUI {
81910
81974
  //even when multiple iCn3D viewers are shown together.
81911
81975
  this.pre = this.cfg.divid + "_";
81912
81976
 
81913
- this.REVISION = '3.34.0';
81977
+ this.REVISION = '3.34.1';
81914
81978
 
81915
81979
  // In nodejs, iCn3D defines "window = {navigator: {}}"
81916
81980
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -82100,7 +82164,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
82100
82164
  await ic.realignParserCls.realignChainOnSeqAlign(undefined, chainidArray, bRealign, bPredefined);
82101
82165
  }
82102
82166
  }
82103
- else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
82167
+ // else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
82168
+ else if(me.cfg.matchedchains !== undefined) {
82104
82169
  let stru_t = Object.keys(ic.structures)[0];
82105
82170
 
82106
82171
  let chain_t = stru_t + '_' + me.cfg.masterchain;
@@ -82128,7 +82193,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
82128
82193
  ic.chainidArray = [chain_t].concat(chainidArray);
82129
82194
  ic.chainidArray = ic.chainalignParserCls.addPostfixForChainids(ic.chainidArray);
82130
82195
 
82131
- me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
82196
+ // me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
82132
82197
 
82133
82198
  ic.loadCmd = 'vast_search_chainid ' + ic.chainidArray;
82134
82199
  me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
@@ -82354,7 +82419,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
82354
82419
  ic.bChainAlign = true;
82355
82420
  ic.inputid = me.cfg.chainalign;
82356
82421
  let resrangeStr = (me.cfg.resrange) ? ' | resrange ' + me.cfg.resrange : '';
82357
- ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + me.cfg.resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara + resrangeStr;
82422
+ let resdef = (me.cfg.resdef) ? me.cfg.resdef : '';
82423
+ ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara + resrangeStr;
82358
82424
  me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
82359
82425
  await ic.chainalignParserCls.downloadChainalignment(me.cfg.chainalign);
82360
82426
  }