icn3d 3.28.3 → 3.28.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
@@ -11612,10 +11612,10 @@ class SetDialog {
11612
11612
 
11613
11613
  html += "<b>Position of the first residue in Sequences & Annotations window</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "fasta_startpos2' value='1' size=2> <br><br>";
11614
11614
 
11615
- html += "Color Sequence by: <select id='" + me.pre + "colorseqby2'>";
11616
- html += me.htmlCls.optionStr + "'identity' selected>Identity</option>";
11617
- html += me.htmlCls.optionStr + "'conservation'>Conservation</option>";
11618
- html += "</select> <br><br>";
11615
+ // html += "Color Sequence by: <select id='" + me.pre + "colorseqby2'>";
11616
+ // html += me.htmlCls.optionStr + "'identity' selected>Identity</option>";
11617
+ // html += me.htmlCls.optionStr + "'conservation'>Conservation</option>";
11618
+ // html += "</select> <br><br>";
11619
11619
 
11620
11620
  html += me.htmlCls.buttonStr + "addtrack_button2c'>Show Isoforms & Exons</button>";
11621
11621
  html += "</div>";
@@ -30574,7 +30574,6 @@ class ApplySymd {
30574
30574
  }
30575
30575
  else { // bSymd, subset, and one chain
30576
30576
  if(Object.keys(ic.hAtoms).length == 0) {
30577
- //ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
30578
30577
  ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
30579
30578
  }
30580
30579
 
@@ -35560,6 +35559,9 @@ class SetOption {
35560
35559
  else if(colorType == 'ig protodomain') {
35561
35560
  colorLabel = 'Ig Protodomain';
35562
35561
  }
35562
+ else if(colorType == 'exon') {
35563
+ colorLabel = 'Exon';
35564
+ }
35563
35565
 
35564
35566
  let html = "Color by <b>" + colorLabel + "</b><br><br>";
35565
35567
 
@@ -35652,6 +35654,17 @@ class SetOption {
35652
35654
  else if (colorType == 'confidence') {
35653
35655
  html += me.htmlCls.clickMenuCls.setLegendHtml(true);
35654
35656
  }
35657
+ else if (colorType == 'exon') {
35658
+ ic.startColor = 'red';
35659
+ ic.midColor = 'white';
35660
+ ic.endColor = 'blue';
35661
+
35662
+ ic.startValue = 'Start';
35663
+ ic.midValue = 'Middle';
35664
+ ic.endValue = 'End';
35665
+
35666
+ html += me.htmlCls.clickMenuCls.setLegendHtml();
35667
+ }
35655
35668
  else {
35656
35669
  html = '';
35657
35670
  }
@@ -35660,6 +35673,9 @@ class SetOption {
35660
35673
  $("#" + me.pre + "dl_legend_html").html(html);
35661
35674
  me.htmlCls.dialogCls.openDlg('dl_legend', 'Color Legend');
35662
35675
  }
35676
+ else {
35677
+ $("#" + me.pre + "dl_legend").dialog("close");
35678
+ }
35663
35679
 
35664
35680
  // if(bClose) {
35665
35681
  // if(window.dialog && window.dialog.hasClass('ui-dialog-content')) window.dialog.dialog( "close" );
@@ -39456,8 +39472,10 @@ class AddTrack {
39456
39472
  let startpos = $("#" + ic.pre + "fasta_startpos2").val();
39457
39473
  if(!startpos) startpos = 1;
39458
39474
 
39459
- let colorseqby = $("#" + ic.pre + "colorseqby2").val();
39460
- let type =(colorseqby == 'identity') ? 'identity' : 'custom';
39475
+ //let colorseqby = $("#" + ic.pre + "colorseqby2").val();
39476
+ //let type =(colorseqby == 'identity') ? 'identity' : 'custom';
39477
+
39478
+ let type = 'identity';
39461
39479
 
39462
39480
  await thisClass.addExonTracks(chainid, geneid, startpos, type);
39463
39481
  });
@@ -39813,6 +39831,13 @@ class AddTrack {
39813
39831
  let tmpStrExon = 'style="background-color:' + pos2exonColor[cnt] + '"';
39814
39832
  htmlExon += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" title="' + c + pos + ', Exon ' + (pos2exonIndex[cnt] + 1) + ': ' + pos2genome[cnt] + '" class="icn3d-residue" ' + tmpStrExon + '>&nbsp;</span>';
39815
39833
 
39834
+ // set atom color
39835
+ for(let serial in ic.residues[chnid + '_' + pos]) {
39836
+ let atom = ic.atoms[serial];
39837
+ atom.color = me.parasCls.thr(pos2exonColor[cnt]);
39838
+ ic.atomPrevColors[serial] = atom.color;
39839
+ }
39840
+
39816
39841
  htmlTmp2 += ic.showSeqCls.insertGapOverview(chnid, i);
39817
39842
 
39818
39843
  // let emptyWidth =(me.cfg.blast_rep_id == chnid) ? Math.round(ic.seqAnnWidth * i /(ic.maxAnnoLength + ic.nTotalGap) - prevEmptyWidth - prevLineWidth) : Math.round(ic.seqAnnWidth * i / ic.maxAnnoLength - prevEmptyWidth - prevLineWidth);
@@ -40925,6 +40950,14 @@ class AddTrack {
40925
40950
  let exonArray = (acc2exons) ? acc2exons[trackTitleArray[j]] : undefined;
40926
40951
  this.showNewTrack(chainid, title, text, undefined, undefined, type, undefined, bMsa, fromArray, toArray, seqStartLen, exonArray);
40927
40952
  }
40953
+
40954
+ // update exon color
40955
+ ic.opts['color'] = 'exon';
40956
+ ic.legendTableCls.showColorLegend(ic.opts['color']);
40957
+
40958
+ ic.hlUpdateCls.updateHlAll();
40959
+ ic.drawCls.draw();
40960
+
40928
40961
  /*
40929
40962
  // set color for the master seq
40930
40963
  if(trackSeqArray.length > 0) {
@@ -49688,16 +49721,16 @@ class ChainalignParser {
49688
49721
  // try {
49689
49722
  let data = await me.getAjaxPromise(url, 'jsonp');
49690
49723
 
49691
- let mmdbid = data.mmdbid;
49692
- ic.selectedPdbid = mmdbid;
49693
-
49694
- if(!mmdbid) {
49724
+ if(!data || !data.mmdbid) {
49695
49725
  if(!ic.bCommandLoad) ic.init(); // remove all previously loaded data
49696
49726
  await thisClass.downloadChainalignmentPart2(data1, data2, undefined, chainidArray);
49697
49727
 
49698
49728
  /// if(ic.deferredOpm !== undefined) ic.deferredOpm.resolve();
49699
49729
  }
49700
49730
  else {
49731
+ let mmdbid = data.mmdbid;
49732
+ ic.selectedPdbid = mmdbid;
49733
+
49701
49734
  let url2 = "https://opm-assets.storage.googleapis.com/pdb/" + mmdbid.toLowerCase()+ ".pdb";
49702
49735
 
49703
49736
  // try {
@@ -60895,9 +60928,9 @@ class DefinedSets {
60895
60928
  this.setHAtomsFromSets(orArray, 'or');
60896
60929
 
60897
60930
  if(Object.keys(ic.hAtoms).length == 0) {
60898
- //ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
60899
60931
  ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
60900
60932
  }
60933
+
60901
60934
  this.setHAtomsFromSets(andArray, 'and');
60902
60935
 
60903
60936
  this.setHAtomsFromSets(notArray, 'not');
@@ -62752,7 +62785,6 @@ class Selection {
62752
62785
  //ic.dAtoms = {};
62753
62786
 
62754
62787
  if(Object.keys(ic.hAtoms).length == 0) {
62755
- //this.selectAll_base();
62756
62788
  ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
62757
62789
  }
62758
62790
 
@@ -62793,9 +62825,12 @@ class Selection {
62793
62825
  }
62794
62826
 
62795
62827
  hideSelection() { let ic = this.icn3d, me = ic.icn3dui;
62796
- ic.dAtoms = me.hashUtilsCls.exclHash(ic.dAtoms, ic.hAtoms);
62828
+ ic.hAtoms = me.hashUtilsCls.exclHash(ic.dAtoms, ic.hAtoms);
62829
+ if(Object.keys(ic.hAtoms).length == 0) {
62830
+ ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
62831
+ }
62797
62832
 
62798
- ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
62833
+ ic.dAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
62799
62834
 
62800
62835
  let centerAtomsResults = ic.applyCenterCls.centerAtoms(me.hashUtilsCls.hash2Atoms(ic.dAtoms, ic.atoms));
62801
62836
  ic.maxD = centerAtomsResults.maxD;