icn3d 3.23.4 → 3.23.5

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.module.js CHANGED
@@ -7940,6 +7940,12 @@ class ClickMenu {
7940
7940
  thisClass.setLogCmd('color confidence', true);
7941
7941
  });
7942
7942
 
7943
+ me.myEventCls.onIds("#" + me.pre + "mn4_clrIgstrand", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
7944
+ //ic.legendClick = 6;
7945
+ ic.setOptionCls.setOption('color', 'ig strand');
7946
+ thisClass.setLogCmd('color ig strand', true);
7947
+ });
7948
+
7943
7949
 
7944
7950
  me.myEventCls.onIds("#" + me.pre + "mn4_clrArea", "click", function(e) { me.icn3d; //e.preventDefault();
7945
7951
  me.htmlCls.dialogCls.openDlg('dl_colorbyarea', "Color based on residue's solvent accessibility");
@@ -10255,6 +10261,8 @@ class SetMenu {
10255
10261
  //if(!me.cfg.mmtfid && !me.cfg.pdbid && !me.cfg.opmid && !me.cfg.mmdbid && !me.cfg.gi && !me.cfg.uniprotid && !me.cfg.blast_rep_id && !me.cfg.cid && !me.cfg.mmcifid && !me.cfg.align && !me.cfg.chainalign) {
10256
10262
  html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'AlphaFold<br><span style="padding-left:1.5em;">Confidence</span>', undefined, 1, 1);
10257
10263
  //}
10264
+
10265
+ html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
10258
10266
  }
10259
10267
  else {
10260
10268
  //if(!me.cfg.hidelicense) html += this.getRadio('mn4_clr', 'mn1_delphi2', 'DelPhi<br><span style="padding-left:1.5em;">Potential ' + me.htmlCls.licenseStr + '</span>');
@@ -10473,12 +10481,12 @@ class SetMenu {
10473
10481
  html += this.getMenuText('mn6_igrefwrap', 'Ref. Number', undefined, undefined, 1);
10474
10482
 
10475
10483
  html += "<ul>";
10476
- /*
10484
+
10477
10485
  html += this.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
10478
10486
  html += this.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
10479
10487
 
10480
10488
  html += this.getMenuSep();
10481
- */
10489
+
10482
10490
  html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
10483
10491
  html += "</ul>";
10484
10492
  html += "</li>";
@@ -11578,7 +11586,7 @@ class SetDialog {
11578
11586
  html += me.htmlCls.divStr + "dl_mmdbafid' class='" + dialogClass + "' style='max-width:600px'>";
11579
11587
  html += "List of PDB, MMDB, or AlphaFold UniProt structures: " + me.htmlCls.inputTextStr + "id='" + me.pre + "mmdbafid' placeholder='e.g., 1HHO,4N7N,P69905,P01942' size=30> <br><br>";
11580
11588
  html += "<div style='display:inline-block; width:20px'></div>" + me.htmlCls.buttonStr + "reload_mmdbaf' style='width:150px'>Load Biological Unit</button>" + me.htmlCls.buttonStr + "reload_mmdbaf_asym' style='margin-left:30px; width:250px'>Load Asymmetric Unit (All Chains)</button>" + "<br/><br/>";
11581
- html += "<div style='display:inline-block; width:20px'>or</div>" + me.htmlCls.buttonStr + "reload_mmdbaf_append' style='width:150px'>Append Biological Unit</button>" + me.htmlCls.buttonStr + "reload_mmdbaf_asym_append' style='margin-left:30px; width:250px'>Append Asymmetric ; Unit (All Chains)</button>" + "<br/><br/>";
11589
+ html += "<div style='display:inline-block; width:20px'>or</div>" + me.htmlCls.buttonStr + "reload_mmdbaf_append' style='width:150px'>Append Biological Unit</button>" + me.htmlCls.buttonStr + "reload_mmdbaf_asym_append' style='margin-left:30px; width:250px'>Append Asymmetric Unit (All Chains)</button>" + "<br/><br/>";
11582
11590
 
11583
11591
  html += '<b>Note</b>: The "<b>biological unit</b>" is the <b>biochemically active form of a biomolecule</b>, <div style="width:20px; margin:6px 0 0 20px; display:inline-block;"><span id="'
11584
11592
  + me.pre + 'asu_bu2_expand" class="ui-icon ui-icon-plus icn3d-expand icn3d-link" style="width:15px;" title="Expand"></span><span id="'
@@ -12712,9 +12720,16 @@ class Events {
12712
12720
  else {
12713
12721
  ic.loadCmd = 'load mmdbaf0 ' + me.cfg.mmdbafid;
12714
12722
  }
12715
- me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
12723
+ me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
12724
+
12725
+ let bStructures = (ic.structures && Object.keys(ic.structures).length > 0) ? true : false;
12716
12726
 
12717
12727
  await ic.chainalignParserCls.downloadMmdbAf(me.cfg.mmdbafid);
12728
+
12729
+ if(bStructures) {
12730
+ if(ic.bSetChainsAdvancedMenu) ic.definedSetsCls.showSets();
12731
+ if(ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
12732
+ }
12718
12733
  }
12719
12734
  }
12720
12735
  }
@@ -35267,6 +35282,35 @@ class SetColor {
35267
35282
 
35268
35283
  break;
35269
35284
 
35285
+ case 'ig strand':
35286
+ if(ic.bShowRefnum) {
35287
+ for(let resid in ic.resid2refnum) {
35288
+ let refnumLabel = ic.resid2refnum[resid];
35289
+ let color;
35290
+ if(!refnumLabel) {
35291
+ color = me.parasCls.thr(me.htmlCls.GREYB);
35292
+ }
35293
+ else {
35294
+ let refnumStr = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').substr(1); // C', C''
35295
+ let currStrand = refnumLabel.replace(new RegExp(refnumStr,'g'), '');
35296
+ color = ic.showSeqCls.getRefnumColor(currStrand);
35297
+
35298
+ if(ic.residIgLoop.hasOwnProperty(resid)) {
35299
+ color = me.parasCls.thr(me.htmlCls.GREYB);
35300
+ }
35301
+ }
35302
+
35303
+ for (let i in ic.residues[resid]) {
35304
+ let atom = ic.atoms[i];
35305
+ atom.color = me.parasCls.thr(color);
35306
+
35307
+ ic.atomPrevColors[i] = atom.color;
35308
+ }
35309
+ }
35310
+ }
35311
+
35312
+ break;
35313
+
35270
35314
  case 'residue custom':
35271
35315
  for (let i in atoms) {
35272
35316
  let atom = ic.atoms[i];
@@ -35928,6 +35972,9 @@ class SetOption {
35928
35972
  else if(colorType == 'hydrophobic') {
35929
35973
  colorLabel = 'Hydrophobicity';
35930
35974
  }
35975
+ else if(colorType == 'ig strand') {
35976
+ colorLabel = 'Ig Strand';
35977
+ }
35931
35978
 
35932
35979
  let html = "Color by <b>" + colorLabel + "</b><br><br>";
35933
35980
 
@@ -35948,6 +35995,9 @@ class SetOption {
35948
35995
  else if (colorType == 'charge'){
35949
35996
  html += this.getColorLegendForCharge(ic.hAtoms);
35950
35997
  }
35998
+ else if (colorType == 'ig strand'){
35999
+ html += this.getColorLegendForIgstrand(ic.hAtoms);
36000
+ }
35951
36001
  //else if (ic.legendClick == 4){
35952
36002
  else if (colorType == 'normalized hydrophobic' || colorType == 'hydrophobic') {
35953
36003
  let bOriResn = true;
@@ -36171,6 +36221,40 @@ class SetOption {
36171
36221
 
36172
36222
  return html;
36173
36223
  }
36224
+
36225
+ getColorLegendForIgstrand(atomHash) { let ic = this.icn3d; ic.icn3dui;
36226
+ let html = '';
36227
+
36228
+ const name2color = {
36229
+ "A^ Strand": "FF00FF",
36230
+ "A Strand": "663399",
36231
+ "A* Strand": "FFC0CB",
36232
+ "A Strand": "9370db",
36233
+ "B Strand": "ba55d3",
36234
+ "C Strand": "0000FF",
36235
+ "C' Strand": "6495ED",
36236
+ "C'' Strand": "006400",
36237
+ "D Strand": "00FF00",
36238
+ "E Strand": "FFFF00",
36239
+ "F Strand": "FFA500",
36240
+ "G Strand": "FF0000",
36241
+ "G* Strand": "8B0000",
36242
+ "Loop": "CCCCCC"
36243
+ };
36244
+
36245
+ html += "<div>";
36246
+ for (let name in name2color) {
36247
+ let color = name2color[name];
36248
+ html += "<span>";
36249
+ html += "<div style='width: 10px; height: 10px; background-color:#" + color + "; border: 0px;display:inline-block;' ></div> ";
36250
+ html += name;
36251
+ html += "</span><br>";
36252
+ }
36253
+
36254
+ html += "</div>";
36255
+
36256
+ return html;
36257
+ }
36174
36258
  }
36175
36259
 
36176
36260
  /**
@@ -41289,6 +41373,14 @@ class ShowAnno {
41289
41373
  } // align seq to structure
41290
41374
  }
41291
41375
  ic.bAnnoShown = true;
41376
+
41377
+ if(ic.bShowRefnum) {
41378
+ ic.opts.color = 'ig strand';
41379
+ ic.setColorCls.setColorByOptions(ic.opts, ic.atoms);
41380
+
41381
+ ic.selectionCls.selectAll_base();
41382
+ ic.hlUpdateCls.updateHlAll();
41383
+ }
41292
41384
  }
41293
41385
 
41294
41386
  async showAnnoSeqData(nucleotide_chainid, chemical_chainid, chemical_set) { let ic = this.icn3d, me = ic.icn3dui;
@@ -42579,6 +42671,7 @@ class ShowSeq {
42579
42671
  else {
42580
42672
  if(bShowRefnum && currStrand != ' ') {
42581
42673
  html += this.getRefnumHtml(residueid, refnumStr, refnumStr_ori, refnumLabel, currStrand, bLoop, bHidelabel);
42674
+ if(bLoop) ic.residIgLoop[residueid] = 1;
42582
42675
  }
42583
42676
  else {
42584
42677
  html += '<span></span>';
@@ -42626,6 +42719,7 @@ class ShowSeq {
42626
42719
 
42627
42720
  if(bShowRefnum && currStrand != ' ') {
42628
42721
  html += this.getRefnumHtml(residueid, refnumStr, refnumStr_ori, refnumLabel, currStrand, bLoop, bHidelabel);
42722
+ if(bLoop) ic.residIgLoop[residueid] = 1;
42629
42723
  }
42630
42724
  else {
42631
42725
  html += '<span></span>';
@@ -42758,48 +42852,48 @@ class ShowSeq {
42758
42852
  return html;
42759
42853
  }
42760
42854
 
42761
- getRefnumColor(currStrand) { let ic = this.icn3d; ic.icn3dui;
42762
- if(currStrand == "A^") { // deep sky blue
42763
- return '#9900ff'; //'#00BFFF';
42855
+ getRefnumColor(currStrand) { let ic = this.icn3d, me = ic.icn3dui;
42856
+ if(currStrand == "A^") { //magenta // deep sky blue
42857
+ return '#FF00FF'; //'#9900ff'; //'#00BFFF';
42764
42858
  }
42765
- else if(currStrand == "A") { // blue
42766
- return '#9900ff'; //'#0000FF';
42859
+ else if(currStrand == "A") { //rebecca purple // blue
42860
+ return '#663399'; //'#9900ff'; //'#0000FF';
42767
42861
  }
42768
- else if(currStrand == "A*") { // sky blue
42769
- return '#9900ff'; //'#87CEEB';
42862
+ else if(currStrand == "A*") { //pink // sky blue
42863
+ return '#FFC0CB'; //'#9900ff'; //'#87CEEB';
42770
42864
  }
42771
- else if(currStrand == "A'") { // steel blue
42772
- return '#9900ff'; //'#4682B4';
42865
+ else if(currStrand == "A'") { //medium purple // steel blue
42866
+ return '#9370db'; //'#9900ff'; //'#4682B4';
42773
42867
  }
42774
- else if(currStrand == "B") { // cyan
42775
- return '#4a86e8'; //'#00FFFF';
42868
+ else if(currStrand == "B") { //medium orchid // cyan
42869
+ return '#ba55d3'; //'#0000FF'; //'#4a86e8'; //'#00FFFF';
42776
42870
  }
42777
- else if(currStrand == "C") { // green
42778
- return '#76d6ff'; //'#00FF00';
42871
+ else if(currStrand == "C") { //blue // green
42872
+ return '#0000FF'; //'#76d6ff'; //'#00FF00';
42779
42873
  }
42780
- else if(currStrand == "C'") { // yellow
42781
- return '#00b050'; //'#FFFF00';
42874
+ else if(currStrand == "C'") { //corn blue // yellow
42875
+ return '#6495ED'; //'#006400'; //'#00b050'; //'#FFFF00';
42782
42876
  }
42783
- else if(currStrand == "C''") { // orange
42784
- return '#00ff00'; //'#FFA500';
42877
+ else if(currStrand == "C''") { //dark green // orange
42878
+ return '#006400'; //'#00ff00'; //'#FFA500';
42785
42879
  }
42786
- else if(currStrand == "D") { // brown
42787
- return '#fffb00'; //'#A52A2A';
42880
+ else if(currStrand == "D") { //green // brown
42881
+ return '#00FF00'; //'#fffb00'; //'#A52A2A';
42788
42882
  }
42789
- else if(currStrand == "E") { // pink
42790
- return '#ffd966'; //'#FFC0CB';
42883
+ else if(currStrand == "E") { //yellow // pink
42884
+ return '#F0E68C'; //'#ff9900'; //'#ffd966'; //'#FFC0CB';
42791
42885
  }
42792
- else if(currStrand == "F") { // magenta
42793
- return '#ff9900'; //'#FF00FF';
42886
+ else if(currStrand == "F") { //orange // magenta
42887
+ return '#FFA500'; //'#FF00FF'; //'#ff9900'; //'#FF00FF';
42794
42888
  }
42795
- else if(currStrand == "G") { // red
42796
- return '#ff2600'; //'#FF0000';
42889
+ else if(currStrand == "G") { //red // red
42890
+ return '#FF0000'; //'#ff2600'; //'#FF0000';
42797
42891
  }
42798
- else if(currStrand == "G*") { // salmon
42799
- return '#ff2600'; //'#FA8072';
42892
+ else if(currStrand == "G*") { //dark red // salmon
42893
+ return '#8B0000'; //'#ff2600'; //'#FA8072';
42800
42894
  }
42801
42895
  else {
42802
- return '#000';
42896
+ return me.htmlCls.GREYB;
42803
42897
  }
42804
42898
  }
42805
42899
 
@@ -48041,7 +48135,18 @@ class ChainalignParser {
48041
48135
  }
48042
48136
 
48043
48137
  // ic.deferredMmdbaf = $.Deferred(function() {
48044
- let structArray = idlist.split(',');
48138
+ let structArrayTmp = idlist.split(',');
48139
+
48140
+ let structArray = [];
48141
+ // remove redundant structures
48142
+ for(let i = 0, il = structArrayTmp.length; i < il; ++i) {
48143
+ if(!ic.structures.hasOwnProperty(structArrayTmp[i].toUpperCase())) {
48144
+ structArray.push(structArrayTmp[i]);
48145
+ }
48146
+ }
48147
+
48148
+ if(structArray.length == 0) return;
48149
+
48045
48150
  ic.structArray = ic.structArray.concat(structArray);
48046
48151
 
48047
48152
  let ajaxArray = [];
@@ -59528,6 +59633,10 @@ class LoadScript {
59528
59633
 
59529
59634
  // load pdb, mmcif, mmdb, cid
59530
59635
  let id = loadStr.substr(loadStr.lastIndexOf(' ') + 1);
59636
+
59637
+ // skip loading the structure if it was loaded before
59638
+ if(ic.structures.hasOwnProperty(id)) return;
59639
+
59531
59640
  ic.inputid = id;
59532
59641
  if(command.indexOf('load mmtf') !== -1) {
59533
59642
  me.cfg.mmtfid = id;
@@ -59602,7 +59711,7 @@ class LoadScript {
59602
59711
  else if(command.indexOf('load alignment') !== -1) {
59603
59712
  me.cfg.align = id;
59604
59713
 
59605
- if(me.cfg.inpara.indexOf('atype=2') == -1) {
59714
+ if(me.cfg.inpara || me.cfg.inpara.indexOf('atype=2') == -1) {
59606
59715
  await ic.alignParserCls.downloadAlignment(me.cfg.align);
59607
59716
  }
59608
59717
  else {
@@ -70158,7 +70267,7 @@ class iCn3D {
70158
70267
  this.optsOri = {};
70159
70268
  this.optsOri['camera'] = 'perspective'; //perspective, orthographic
70160
70269
  this.optsOri['background'] = 'black'; //transparent, black, grey, white
70161
- this.optsOri['color'] = 'chain'; //spectrum, secondary structure, charge, hydrophobic, conserved, chain, residue, atom, b factor, red, green, blue, magenta, yellow, cyan, white, grey, custom
70270
+ this.optsOri['color'] = 'chain'; //spectrum, secondary structure, charge, hydrophobic, conserved, chain, residue, atom, b factor, red, green, blue, magenta, yellow, cyan, white, grey, custom, ig strand
70162
70271
  this.optsOri['proteins'] = 'ribbon'; //ribbon, strand, cylinder and plate, schematic, c alpha trace, backbone, b factor tube, lines, stick, ball and stick, sphere, nothing
70163
70272
  this.optsOri['sidec'] = 'nothing'; //lines2, stick2, ball and stick2, sphere2, nothing
70164
70273
  this.optsOri['nucleotides'] = 'nucleotide cartoon'; //nucleotide cartoon, o3 trace, backbone, schematic, lines, stick,
@@ -70425,6 +70534,7 @@ iCn3D.prototype.init_base = function (bKeepCmd) {
70425
70534
 
70426
70535
  this.chainsMapping = {}; // structure_chain name -> residue id hash such as {'structure_chain_resi1': 'reference residue such as K10', ...}
70427
70536
  this.resid2refnum = {}; // residue id -> reference number, e.g., {'1WIO_A_16': '2150', ...}
70537
+ this.residIgLoop = {}; // residue ids in the loop regions of ig domain
70428
70538
  this.refnum2residArray = {}; // reference number -> array of residue id, e.g., {'2150': ['1WIO_A_16', ...], ...}
70429
70539
  this.bShowRefnum = false;
70430
70540
 
@@ -70597,7 +70707,7 @@ class iCn3DUI {
70597
70707
  //even when multiple iCn3D viewers are shown together.
70598
70708
  this.pre = this.cfg.divid + "_";
70599
70709
 
70600
- this.REVISION = '3.23.1';
70710
+ this.REVISION = '3.23.2';
70601
70711
 
70602
70712
  // In nodejs, iCn3D defines "window = {navigator: {}}"
70603
70713
  this.bNode = (Object.keys(window).length < 2) ? true : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.23.4",
3
+ "version": "3.23.5",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {