icn3d 3.32.0 → 3.33.0

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
@@ -10588,6 +10588,13 @@ class ClickMenu {
10588
10588
  ic.drawCls.draw();
10589
10589
  });
10590
10590
 
10591
+ me.myEventCls.onIds("#" + me.pre + "mn6_addlabelIg", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
10592
+ ic.residueLabelsCls.addIgLabels(ic.hAtoms);
10593
+ ic.selectionCls.saveSelectionIfSelected();
10594
+ thisClass.setLogCmd('add ig labels', true);
10595
+ ic.drawCls.draw();
10596
+ });
10597
+
10591
10598
  me.myEventCls.onIds("#" + me.pre + "mn6_addlabelChains", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
10592
10599
  ic.analysisCls.addChainLabels(ic.hAtoms);
10593
10600
  ic.selectionCls.saveSelectionIfSelected();
@@ -11684,7 +11691,7 @@ class SetMenu {
11684
11691
  // html += this.getLink('mn1_pdbfile', 'PDB File');
11685
11692
  // html += this.getLink('mn1_pdbfile_app', 'PDB File (append)');
11686
11693
  html += this.getLink('mn1_pdbfile_app', 'PDB Files (appendable)', 1, 2);
11687
- html += this.getLink('mn1_mmciffile', 'mmCIF File (appendable)', undefined, 2);
11694
+ html += this.getLink('mn1_mmciffile', 'mmCIF Files (appendable)', undefined, 2);
11688
11695
  html += this.getLink('mn1_mol2file', 'Mol2 File', undefined, 2);
11689
11696
  html += this.getLink('mn1_sdffile', 'SDF File', undefined, 2);
11690
11697
  html += this.getLink('mn1_xyzfile', 'XYZ File', undefined, 2);
@@ -11812,15 +11819,12 @@ class SetMenu {
11812
11819
  html += this.getLink('mn1_exportSecondary', 'Secondary Structure', undefined, 2);
11813
11820
  }
11814
11821
 
11815
- //!!!
11816
- /*
11817
11822
  html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
11818
11823
  html += "<ul>";
11819
11824
  html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
11820
11825
  html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
11821
11826
  html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
11822
11827
  html += "</ul>";
11823
- */
11824
11828
 
11825
11829
  html += "<li><br/></li>";
11826
11830
 
@@ -12663,9 +12667,8 @@ class SetMenu {
12663
12667
  html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'pLDDT', undefined, 1, 1);
12664
12668
  //}
12665
12669
 
12666
- //!!!
12667
- // html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
12668
- // html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
12670
+ html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
12671
+ html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
12669
12672
  }
12670
12673
  else {
12671
12674
  //if(!me.cfg.hidelicense) html += this.getRadio('mn4_clr', 'mn1_delphi2', 'DelPhi<br><span style="padding-left:1.5em;">Potential ' + me.htmlCls.licenseStr + '</span>');
@@ -12795,8 +12798,10 @@ class SetMenu {
12795
12798
  if(me.cfg.cid === undefined) {
12796
12799
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
12797
12800
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
12798
- //!!!
12799
- // html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
12801
+
12802
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
12803
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelIg', 'per Ig Domain', undefined, 1, 2);
12804
+
12800
12805
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
12801
12806
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
12802
12807
  }
@@ -12889,17 +12894,13 @@ class SetMenu {
12889
12894
  html += this.getMenuText('mn6_igrefwrap', 'Ref. Number', undefined, undefined, 1);
12890
12895
 
12891
12896
  html += "<ul>";
12892
- //!!!
12893
- /*
12897
+
12894
12898
  html += this.getLink('mn6_igrefYes', 'Show Ig for Selection', undefined, 2);
12895
12899
  html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
12896
12900
  html += this.getLink('mn6_alignrefTpl', 'Align w/ Specified Template', undefined, 2);
12897
12901
  html += this.getLink('mn6_igrefNo', 'Reset Ig Ref. Number', undefined, 2);
12898
12902
 
12899
12903
  html += this.getMenuSep();
12900
- */
12901
-
12902
-
12903
12904
 
12904
12905
  html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
12905
12906
  html += "</ul>";
@@ -12989,6 +12990,7 @@ class SetMenu {
12989
12990
  html += this.getMenuUrl('faq_simialphapdb', me.htmlCls.baseUrl + "icn3d/icn3d.html#simifoldseek", "Similar AlphaFold/PDB", 1, 2);
12990
12991
  html += this.getMenuUrl('faq_alnstru', me.htmlCls.baseUrl + "icn3d/icn3d.html#alignmul", "Align Multiple Structures", 1, 2);
12991
12992
  html += this.getMenuUrl('faq_batchanal', me.htmlCls.baseUrl + "icn3d/icn3d.html#batchanalysis", "Batch Analysis", 1, 2);
12993
+ html += this.getMenuUrl('faq_batchanal', me.htmlCls.baseUrl + "icn3d/icn3d.html#igrefnum", "Assign Ig Ref. Numbers", 1, 2);
12992
12994
  html += this.getMenuUrl('faq_embedicn3d', me.htmlCls.baseUrl + "icn3d/icn3d.html#embedicn3d", "Embed iCn3D", 1, 2);
12993
12995
  html += "</ul>";
12994
12996
  html += "</li>";
@@ -15177,13 +15179,10 @@ class SetDialog {
15177
15179
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_interact'>Interactions" + me.htmlCls.space2 + "</span></td>";
15178
15180
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_crosslink'>Cross-Linkages" + me.htmlCls.space2 + "</span></td>";
15179
15181
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_transmem'>Transmembrane" + me.htmlCls.space2 + "</span></td>";
15180
- //!!!
15181
- /*
15182
+
15182
15183
  html += "<td></td>";
15183
15184
  html += "</tr><tr>";
15184
15185
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ig'>Ig Domains" + me.htmlCls.space2 + "</span></td>";
15185
- */
15186
-
15187
15186
 
15188
15187
  html += "<td></td>";
15189
15188
  html += "</tr></table></div></div>";
@@ -34854,6 +34853,33 @@ class ResidueLabels {
34854
34853
  ic.hlObjectsCls.removeHlObjects();
34855
34854
  }
34856
34855
 
34856
+ //Add labels for each Ig domain
34857
+ addIgLabels(atoms) { let ic = this.icn3d, me = ic.icn3dui;
34858
+ if(me.bNode) return;
34859
+
34860
+ let size = 60; //18;
34861
+
34862
+ ic.labels['ig'] = [];
34863
+ let chainidHash = ic.firstAtomObjCls.getChainsFromAtoms(atoms);
34864
+
34865
+ for(let chainid in ic.igLabel2Pos) {
34866
+ if(!chainidHash.hasOwnProperty(chainid)) continue;
34867
+
34868
+ for(let text in ic.igLabel2Pos[chainid]) {
34869
+ let label = {}; // Each label contains 'position', 'text', 'color', 'background'
34870
+ label.position = ic.igLabel2Pos[chainid][text];
34871
+ label.text = text;
34872
+
34873
+ label.size = size;
34874
+ label.color = '#00FFFF';
34875
+
34876
+ ic.labels['ig'].push(label);
34877
+ }
34878
+ }
34879
+
34880
+ ic.hlObjectsCls.removeHlObjects();
34881
+ }
34882
+
34857
34883
  addNonCarbonAtomLabels(atoms) { let ic = this.icn3d, me = ic.icn3dui;
34858
34884
  if(me.bNode) return;
34859
34885
 
@@ -41124,6 +41150,8 @@ class AnnoIg {
41124
41150
  let igCnt = ic.chain2igArray[chnid].length;
41125
41151
  let fromArray = [], toArray = [];
41126
41152
  let posindex2domainindex = {};
41153
+ if(!ic.igLabel2Pos) ic.igLabel2Pos = {};
41154
+ ic.igLabel2Pos[chnid] = {};
41127
41155
  for(let i = 0; i < igCnt; ++i) {
41128
41156
  let igElem = ic.chain2igArray[chnid][i];
41129
41157
  fromArray = fromArray.concat(igElem.startPosArray);
@@ -41133,6 +41161,18 @@ class AnnoIg {
41133
41161
  let pos = igElem.startPosArray[j];
41134
41162
  posindex2domainindex[pos] = i;
41135
41163
  }
41164
+
41165
+ let resi1 = ic.ParserUtilsCls.getResi(chnid, igElem.startPosArray[0]);
41166
+ let resid1 = chnid + "_" + resi1;
41167
+ let calpha1 = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid1]);
41168
+
41169
+ let resi2 = ic.ParserUtilsCls.getResi(chnid, igElem.endPosArray[igElem.endPosArray.length - 1]);
41170
+ let resid2 = chnid + "_" + resi2;
41171
+ let calpha2 = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid2]);
41172
+
41173
+ let label = chnid.substr(chnid.lastIndexOf('_') + 1) + '-Ig' + (i+1).toString();
41174
+
41175
+ ic.igLabel2Pos[chnid][label] = calpha1.coord.clone().add(calpha2.coord).multiplyScalar(0.5);
41136
41176
  }
41137
41177
 
41138
41178
  // let htmlCnt = '<span class="icn3d-residueNum" title="Ig domain count">' + igCnt.toString() + ' Igs</span>';
@@ -41183,6 +41223,7 @@ class AnnoIg {
41183
41223
  if(igArray.length == 0) return {html: html, html2: html2, html3: html3}
41184
41224
  let rangeArray = [], titleArray = [], fullTitleArray = [], domainArray = [];
41185
41225
 
41226
+ let chain = chnid.substr(chnid.lastIndexOf('_') + 1);
41186
41227
  for(let i = 0, il = igArray.length; i < il; ++i) {
41187
41228
  let domainid = igArray[i].domainid;
41188
41229
  if(!ic.domainid2info) continue;
@@ -41194,7 +41235,7 @@ class AnnoIg {
41194
41235
 
41195
41236
  let igType = (parseFloat(tmscore) < ic.refnumCls.TMThresholdIgType ) ? 'Ig' : ic.ref2igtype[info.refpdbname];
41196
41237
  titleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + ')');
41197
- fullTitleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + '), template: ' + info.refpdbname + ', type: ' + ic.ref2igtype[info.refpdbname] + ', Seq. identity: ' + parseFloat(info.seqid).toFixed(2) + ', aligned residues: ' + info.nresAlign);
41238
+ fullTitleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + '), template: ' + info.refpdbname + ', type: ' + ic.ref2igtype[info.refpdbname] + ', Seq. identity: ' + parseFloat(info.seqid).toFixed(2) + ', aligned residues: ' + info.nresAlign + ', label in 3D: ' + chain + '-Ig' + (i+1).toString());
41198
41239
 
41199
41240
  domainArray.push(igType);
41200
41241
 
@@ -48464,7 +48505,7 @@ class HlUpdate {
48464
48505
  }
48465
48506
 
48466
48507
  //Remove the highlight in the 2D interaction diagram.
48467
- removeHl2D() { let ic = this.icn3d; ic.icn3dui;
48508
+ removeHl2D(bRemoveChainOnly) { let ic = this.icn3d; ic.icn3dui;
48468
48509
  // clear nodes in 2d dgm
48469
48510
  $("#" + ic.pre + "dl_2ddgm rect").attr('stroke', '#000000');
48470
48511
  $("#" + ic.pre + "dl_2ddgm circle").attr('stroke', '#000000');
@@ -48478,6 +48519,22 @@ class HlUpdate {
48478
48519
  $("#" + ic.pre + "dl_2ddgm svg line").attr('stroke', '#000000');
48479
48520
  $("#" + ic.pre + "dl_2ddgm line").attr('stroke-width', 1);
48480
48521
  }
48522
+
48523
+ if(!bRemoveChainOnly) {
48524
+ // clear nodes in 2d interaction network
48525
+ // $("#" + ic.pre + "dl_linegraph rect").attr('stroke', '#000000');
48526
+ $("#" + ic.pre + "dl_linegraph circle").attr('stroke', '#000000');
48527
+
48528
+ // $("#" + ic.pre + "dl_linegraph rect").attr('stroke-width', 1);
48529
+ $("#" + ic.pre + "dl_linegraph circle").attr('stroke-width', 1);
48530
+
48531
+ // clear nodes in 2d interaction graph
48532
+ $("#" + ic.pre + "dl_scatterplot rect").attr('stroke', '#000000');
48533
+ $("#" + ic.pre + "dl_scatterplot circle").attr('stroke', '#000000');
48534
+
48535
+ $("#" + ic.pre + "dl_scatterplot rect").attr('stroke-width', 1);
48536
+ $("#" + ic.pre + "dl_scatterplot circle").attr('stroke-width', 1);
48537
+ }
48481
48538
  }
48482
48539
 
48483
48540
  //Remove the selection in the menu of defined sets.
@@ -48575,7 +48632,7 @@ class HlUpdate {
48575
48632
  // update highlight in 2D window
48576
48633
  //Update the highlight of 2D interaction diagram according to the current highlighted atoms.
48577
48634
  updateHl2D(chainArray2d) { let ic = this.icn3d, me = ic.icn3dui;
48578
- this.removeHl2D();
48635
+ this.removeHl2D(true);
48579
48636
 
48580
48637
  if(ic.hAtoms && ic.atoms && Object.keys(ic.hAtoms).length == Object.keys(ic.atoms).length) return;
48581
48638
 
@@ -49002,6 +49059,8 @@ class LineGraph {
49002
49059
  && ic.chainsMapping[chainid2] && ic.chainsMapping[chainid2][resid2]) {
49003
49060
  mapping1 = (nodeA.s == "a") ? ic.chainsMapping[chainid1][resid1] : ic.chainsMapping[chainid2][resid2];
49004
49061
  mapping2 = (nodeA.s == "a") ? ic.chainsMapping[chainid2][resid2] : ic.chainsMapping[chainid1][resid1];
49062
+
49063
+ let bIgRef = (mapping1.length > 4 && !isNaN(parseInt(mapping1.substr(-4, 4)))) || (mapping2.length > 4 && !isNaN(parseInt(mapping2.substr(-4, 4))));
49005
49064
 
49006
49065
  let mappingid = mapping1 + '_' + mapping2 + '_' + link.c; // link.c determines the interaction type
49007
49066
 
@@ -49013,7 +49072,7 @@ class LineGraph {
49013
49072
  linkDiff.source += separatorDiff + ic.chainsMapping[chainid1][resid1];
49014
49073
  linkDiff.target += separatorDiff + ic.chainsMapping[chainid2][resid2];
49015
49074
 
49016
- if(linkedNodeCnt[mappingid] == structureArray.length && linkedNodeInterDiffBool[mappingid] == 0) {
49075
+ if(linkedNodeCnt[mappingid] == structureArray.length && (bIgRef || linkedNodeInterDiffBool[mappingid] == 0)) {
49017
49076
  linkArraySplitCommon[index].push(linkCommon);
49018
49077
  }
49019
49078
  else {
@@ -63936,7 +63995,7 @@ class Vastplus {
63936
63995
  let chainid = chainidArray[i];
63937
63996
  let atoms = me.hashUtilsCls.intHash(ic.hAtoms, ic.chains[chainid]);
63938
63997
  let firstAtom = ic.firstAtomObjCls.getFirstAtomObj(atoms);
63939
- structHash[firstAtom.structure] = 1;
63998
+ if(firstAtom) structHash[firstAtom.structure] = 1;
63940
63999
  }
63941
64000
  }
63942
64001
 
@@ -64958,6 +65017,11 @@ class ApplyCommand {
64958
65017
 
64959
65018
  ic.drawCls.draw();
64960
65019
  }
65020
+ else if(command == 'add ig labels') {
65021
+ ic.residueLabelsCls.addIgLabels(ic.hAtoms);
65022
+
65023
+ ic.drawCls.draw();
65024
+ }
64961
65025
  else if(command == 'add atom labels') {
64962
65026
  ic.residueLabelsCls.addAtomLabels(ic.hAtoms);
64963
65027
 
@@ -66284,6 +66348,7 @@ class ApplyCommand {
66284
66348
  else if(cmd.indexOf('hide annotation') == 0) return seqAnnoStr + ': checkboxes off';
66285
66349
  else if(cmd == 'add residue labels') return labelStr + 'per Residue';
66286
66350
  else if(cmd == 'add residue number labels') return labelStr + 'per Residue & Number';
66351
+ else if(cmd == 'add Ig domain labels') return labelStr + 'per Ig Domain';
66287
66352
  else if(cmd == 'add atom labels') return labelStr + 'per Atom';
66288
66353
  else if(cmd == 'add chain labels') return labelStr + 'per Chain';
66289
66354
  else if(cmd == 'add terminal labels') return labelStr + 'N- & C- Termini';
@@ -80788,7 +80853,7 @@ class iCn3DUI {
80788
80853
  //even when multiple iCn3D viewers are shown together.
80789
80854
  this.pre = this.cfg.divid + "_";
80790
80855
 
80791
- this.REVISION = '3.32.0';
80856
+ this.REVISION = '3.33.0';
80792
80857
 
80793
80858
  // In nodejs, iCn3D defines "window = {navigator: {}}"
80794
80859
  this.bNode = (Object.keys(window).length < 2) ? true : false;