icn3d 3.28.2 → 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) {
@@ -41961,23 +41994,26 @@ class ShowAnno {
41961
41994
  let structure = chnid.substr(0, chnid.indexOf('_'));
41962
41995
  // UniProt or NCBI protein accession
41963
41996
  if(structure.length > 5) {
41964
- let refseqid, url;
41997
+ let url;
41965
41998
  if(ic.uniprot2acc && ic.uniprot2acc[structure]) {
41966
- refseqid = ic.uniprot2acc[structure];
41999
+ ic.uniprot2acc[structure];
41967
42000
  }
41968
42001
  else {
41969
- try {
41970
- if(!ic.uniprot2acc) ic.uniprot2acc = {};
41971
- url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?uniprot2refseq=" + structure;
41972
- let result = await me.getAjaxPromise(url, 'jsonp');
41973
- refseqid = (result && result.refseq) ? result.refseq : structure;
42002
+ ic.uniprot2acc = {};
41974
42003
 
41975
- ic.uniprot2acc[structure] = refseqid;
41976
- }
41977
- catch {
41978
- console.log("Problem in getting protein accession from UniProt ID...");
41979
- refseqid = structure;
41980
- }
42004
+ // try {
42005
+ // if(!ic.uniprot2acc) ic.uniprot2acc = {};
42006
+ // the following query is slow due to the missing index in DB
42007
+ // url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?uniprot2refseq=" + structure;
42008
+ // let result = await me.getAjaxPromise(url, 'jsonp');
42009
+ // refseqid = (result && result.refseq) ? result.refseq : structure;
42010
+
42011
+ // ic.uniprot2acc[structure] = refseqid;
42012
+ // }
42013
+ // catch {
42014
+ // console.log("Problem in getting protein accession from UniProt ID...")
42015
+ // refseqid = structure;
42016
+ // }
41981
42017
  }
41982
42018
 
41983
42019
  // get Gene info from protein name
@@ -49685,16 +49721,16 @@ class ChainalignParser {
49685
49721
  // try {
49686
49722
  let data = await me.getAjaxPromise(url, 'jsonp');
49687
49723
 
49688
- let mmdbid = data.mmdbid;
49689
- ic.selectedPdbid = mmdbid;
49690
-
49691
- if(!mmdbid) {
49724
+ if(!data || !data.mmdbid) {
49692
49725
  if(!ic.bCommandLoad) ic.init(); // remove all previously loaded data
49693
49726
  await thisClass.downloadChainalignmentPart2(data1, data2, undefined, chainidArray);
49694
49727
 
49695
49728
  /// if(ic.deferredOpm !== undefined) ic.deferredOpm.resolve();
49696
49729
  }
49697
49730
  else {
49731
+ let mmdbid = data.mmdbid;
49732
+ ic.selectedPdbid = mmdbid;
49733
+
49698
49734
  let url2 = "https://opm-assets.storage.googleapis.com/pdb/" + mmdbid.toLowerCase()+ ".pdb";
49699
49735
 
49700
49736
  // try {
@@ -60892,9 +60928,9 @@ class DefinedSets {
60892
60928
  this.setHAtomsFromSets(orArray, 'or');
60893
60929
 
60894
60930
  if(Object.keys(ic.hAtoms).length == 0) {
60895
- //ic.hAtoms = me.hashUtilsCls.cloneHash(ic.atoms);
60896
60931
  ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
60897
60932
  }
60933
+
60898
60934
  this.setHAtomsFromSets(andArray, 'and');
60899
60935
 
60900
60936
  this.setHAtomsFromSets(notArray, 'not');
@@ -62749,7 +62785,6 @@ class Selection {
62749
62785
  //ic.dAtoms = {};
62750
62786
 
62751
62787
  if(Object.keys(ic.hAtoms).length == 0) {
62752
- //this.selectAll_base();
62753
62788
  ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
62754
62789
  }
62755
62790
 
@@ -62790,9 +62825,12 @@ class Selection {
62790
62825
  }
62791
62826
 
62792
62827
  hideSelection() { let ic = this.icn3d, me = ic.icn3dui;
62793
- 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
+ }
62794
62832
 
62795
- ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
62833
+ ic.dAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
62796
62834
 
62797
62835
  let centerAtomsResults = ic.applyCenterCls.centerAtoms(me.hashUtilsCls.hash2Atoms(ic.dAtoms, ic.atoms));
62798
62836
  ic.maxD = centerAtomsResults.maxD;