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.module.js CHANGED
@@ -11489,6 +11489,13 @@ class ClickMenu {
11489
11489
  ic.drawCls.draw();
11490
11490
  });
11491
11491
 
11492
+ me.myEventCls.onIds("#" + me.pre + "mn6_addlabelIg", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
11493
+ ic.residueLabelsCls.addIgLabels(ic.hAtoms);
11494
+ ic.selectionCls.saveSelectionIfSelected();
11495
+ thisClass.setLogCmd('add ig labels', true);
11496
+ ic.drawCls.draw();
11497
+ });
11498
+
11492
11499
  me.myEventCls.onIds("#" + me.pre + "mn6_addlabelChains", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
11493
11500
  ic.analysisCls.addChainLabels(ic.hAtoms);
11494
11501
  ic.selectionCls.saveSelectionIfSelected();
@@ -12585,7 +12592,7 @@ class SetMenu {
12585
12592
  // html += this.getLink('mn1_pdbfile', 'PDB File');
12586
12593
  // html += this.getLink('mn1_pdbfile_app', 'PDB File (append)');
12587
12594
  html += this.getLink('mn1_pdbfile_app', 'PDB Files (appendable)', 1, 2);
12588
- html += this.getLink('mn1_mmciffile', 'mmCIF File (appendable)', undefined, 2);
12595
+ html += this.getLink('mn1_mmciffile', 'mmCIF Files (appendable)', undefined, 2);
12589
12596
  html += this.getLink('mn1_mol2file', 'Mol2 File', undefined, 2);
12590
12597
  html += this.getLink('mn1_sdffile', 'SDF File', undefined, 2);
12591
12598
  html += this.getLink('mn1_xyzfile', 'XYZ File', undefined, 2);
@@ -12713,15 +12720,12 @@ class SetMenu {
12713
12720
  html += this.getLink('mn1_exportSecondary', 'Secondary Structure', undefined, 2);
12714
12721
  }
12715
12722
 
12716
- //!!!
12717
- /*
12718
12723
  html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
12719
12724
  html += "<ul>";
12720
12725
  html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
12721
12726
  html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
12722
12727
  html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
12723
12728
  html += "</ul>";
12724
- */
12725
12729
 
12726
12730
  html += "<li><br/></li>";
12727
12731
 
@@ -13564,9 +13568,8 @@ class SetMenu {
13564
13568
  html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'pLDDT', undefined, 1, 1);
13565
13569
  //}
13566
13570
 
13567
- //!!!
13568
- // html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
13569
- // html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
13571
+ html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
13572
+ html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
13570
13573
  }
13571
13574
  else {
13572
13575
  //if(!me.cfg.hidelicense) html += this.getRadio('mn4_clr', 'mn1_delphi2', 'DelPhi<br><span style="padding-left:1.5em;">Potential ' + me.htmlCls.licenseStr + '</span>');
@@ -13696,8 +13699,10 @@ class SetMenu {
13696
13699
  if(me.cfg.cid === undefined) {
13697
13700
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
13698
13701
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
13699
- //!!!
13700
- // html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
13702
+
13703
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
13704
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelIg', 'per Ig Domain', undefined, 1, 2);
13705
+
13701
13706
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
13702
13707
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
13703
13708
  }
@@ -13790,17 +13795,13 @@ class SetMenu {
13790
13795
  html += this.getMenuText('mn6_igrefwrap', 'Ref. Number', undefined, undefined, 1);
13791
13796
 
13792
13797
  html += "<ul>";
13793
- //!!!
13794
- /*
13798
+
13795
13799
  html += this.getLink('mn6_igrefYes', 'Show Ig for Selection', undefined, 2);
13796
13800
  html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
13797
13801
  html += this.getLink('mn6_alignrefTpl', 'Align w/ Specified Template', undefined, 2);
13798
13802
  html += this.getLink('mn6_igrefNo', 'Reset Ig Ref. Number', undefined, 2);
13799
13803
 
13800
13804
  html += this.getMenuSep();
13801
- */
13802
-
13803
-
13804
13805
 
13805
13806
  html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
13806
13807
  html += "</ul>";
@@ -13890,6 +13891,7 @@ class SetMenu {
13890
13891
  html += this.getMenuUrl('faq_simialphapdb', me.htmlCls.baseUrl + "icn3d/icn3d.html#simifoldseek", "Similar AlphaFold/PDB", 1, 2);
13891
13892
  html += this.getMenuUrl('faq_alnstru', me.htmlCls.baseUrl + "icn3d/icn3d.html#alignmul", "Align Multiple Structures", 1, 2);
13892
13893
  html += this.getMenuUrl('faq_batchanal', me.htmlCls.baseUrl + "icn3d/icn3d.html#batchanalysis", "Batch Analysis", 1, 2);
13894
+ html += this.getMenuUrl('faq_batchanal', me.htmlCls.baseUrl + "icn3d/icn3d.html#igrefnum", "Assign Ig Ref. Numbers", 1, 2);
13893
13895
  html += this.getMenuUrl('faq_embedicn3d', me.htmlCls.baseUrl + "icn3d/icn3d.html#embedicn3d", "Embed iCn3D", 1, 2);
13894
13896
  html += "</ul>";
13895
13897
  html += "</li>";
@@ -16078,13 +16080,10 @@ class SetDialog {
16078
16080
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_interact'>Interactions" + me.htmlCls.space2 + "</span></td>";
16079
16081
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_crosslink'>Cross-Linkages" + me.htmlCls.space2 + "</span></td>";
16080
16082
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_transmem'>Transmembrane" + me.htmlCls.space2 + "</span></td>";
16081
- //!!!
16082
- /*
16083
+
16083
16084
  html += "<td></td>";
16084
16085
  html += "</tr><tr>";
16085
16086
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ig'>Ig Domains" + me.htmlCls.space2 + "</span></td>";
16086
- */
16087
-
16088
16087
 
16089
16088
  html += "<td></td>";
16090
16089
  html += "</tr></table></div></div>";
@@ -35755,6 +35754,33 @@ class ResidueLabels {
35755
35754
  ic.hlObjectsCls.removeHlObjects();
35756
35755
  }
35757
35756
 
35757
+ //Add labels for each Ig domain
35758
+ addIgLabels(atoms) { let ic = this.icn3d, me = ic.icn3dui;
35759
+ if(me.bNode) return;
35760
+
35761
+ let size = 60; //18;
35762
+
35763
+ ic.labels['ig'] = [];
35764
+ let chainidHash = ic.firstAtomObjCls.getChainsFromAtoms(atoms);
35765
+
35766
+ for(let chainid in ic.igLabel2Pos) {
35767
+ if(!chainidHash.hasOwnProperty(chainid)) continue;
35768
+
35769
+ for(let text in ic.igLabel2Pos[chainid]) {
35770
+ let label = {}; // Each label contains 'position', 'text', 'color', 'background'
35771
+ label.position = ic.igLabel2Pos[chainid][text];
35772
+ label.text = text;
35773
+
35774
+ label.size = size;
35775
+ label.color = '#00FFFF';
35776
+
35777
+ ic.labels['ig'].push(label);
35778
+ }
35779
+ }
35780
+
35781
+ ic.hlObjectsCls.removeHlObjects();
35782
+ }
35783
+
35758
35784
  addNonCarbonAtomLabels(atoms) { let ic = this.icn3d, me = ic.icn3dui;
35759
35785
  if(me.bNode) return;
35760
35786
 
@@ -42025,6 +42051,8 @@ class AnnoIg {
42025
42051
  let igCnt = ic.chain2igArray[chnid].length;
42026
42052
  let fromArray = [], toArray = [];
42027
42053
  let posindex2domainindex = {};
42054
+ if(!ic.igLabel2Pos) ic.igLabel2Pos = {};
42055
+ ic.igLabel2Pos[chnid] = {};
42028
42056
  for(let i = 0; i < igCnt; ++i) {
42029
42057
  let igElem = ic.chain2igArray[chnid][i];
42030
42058
  fromArray = fromArray.concat(igElem.startPosArray);
@@ -42034,6 +42062,18 @@ class AnnoIg {
42034
42062
  let pos = igElem.startPosArray[j];
42035
42063
  posindex2domainindex[pos] = i;
42036
42064
  }
42065
+
42066
+ let resi1 = ic.ParserUtilsCls.getResi(chnid, igElem.startPosArray[0]);
42067
+ let resid1 = chnid + "_" + resi1;
42068
+ let calpha1 = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid1]);
42069
+
42070
+ let resi2 = ic.ParserUtilsCls.getResi(chnid, igElem.endPosArray[igElem.endPosArray.length - 1]);
42071
+ let resid2 = chnid + "_" + resi2;
42072
+ let calpha2 = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid2]);
42073
+
42074
+ let label = chnid.substr(chnid.lastIndexOf('_') + 1) + '-Ig' + (i+1).toString();
42075
+
42076
+ ic.igLabel2Pos[chnid][label] = calpha1.coord.clone().add(calpha2.coord).multiplyScalar(0.5);
42037
42077
  }
42038
42078
 
42039
42079
  // let htmlCnt = '<span class="icn3d-residueNum" title="Ig domain count">' + igCnt.toString() + ' Igs</span>';
@@ -42084,6 +42124,7 @@ class AnnoIg {
42084
42124
  if(igArray.length == 0) return {html: html, html2: html2, html3: html3}
42085
42125
  let rangeArray = [], titleArray = [], fullTitleArray = [], domainArray = [];
42086
42126
 
42127
+ let chain = chnid.substr(chnid.lastIndexOf('_') + 1);
42087
42128
  for(let i = 0, il = igArray.length; i < il; ++i) {
42088
42129
  let domainid = igArray[i].domainid;
42089
42130
  if(!ic.domainid2info) continue;
@@ -42095,7 +42136,7 @@ class AnnoIg {
42095
42136
 
42096
42137
  let igType = (parseFloat(tmscore) < ic.refnumCls.TMThresholdIgType ) ? 'Ig' : ic.ref2igtype[info.refpdbname];
42097
42138
  titleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + ')');
42098
- 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);
42139
+ 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());
42099
42140
 
42100
42141
  domainArray.push(igType);
42101
42142
 
@@ -49365,7 +49406,7 @@ class HlUpdate {
49365
49406
  }
49366
49407
 
49367
49408
  //Remove the highlight in the 2D interaction diagram.
49368
- removeHl2D() { let ic = this.icn3d; ic.icn3dui;
49409
+ removeHl2D(bRemoveChainOnly) { let ic = this.icn3d; ic.icn3dui;
49369
49410
  // clear nodes in 2d dgm
49370
49411
  $("#" + ic.pre + "dl_2ddgm rect").attr('stroke', '#000000');
49371
49412
  $("#" + ic.pre + "dl_2ddgm circle").attr('stroke', '#000000');
@@ -49379,6 +49420,22 @@ class HlUpdate {
49379
49420
  $("#" + ic.pre + "dl_2ddgm svg line").attr('stroke', '#000000');
49380
49421
  $("#" + ic.pre + "dl_2ddgm line").attr('stroke-width', 1);
49381
49422
  }
49423
+
49424
+ if(!bRemoveChainOnly) {
49425
+ // clear nodes in 2d interaction network
49426
+ // $("#" + ic.pre + "dl_linegraph rect").attr('stroke', '#000000');
49427
+ $("#" + ic.pre + "dl_linegraph circle").attr('stroke', '#000000');
49428
+
49429
+ // $("#" + ic.pre + "dl_linegraph rect").attr('stroke-width', 1);
49430
+ $("#" + ic.pre + "dl_linegraph circle").attr('stroke-width', 1);
49431
+
49432
+ // clear nodes in 2d interaction graph
49433
+ $("#" + ic.pre + "dl_scatterplot rect").attr('stroke', '#000000');
49434
+ $("#" + ic.pre + "dl_scatterplot circle").attr('stroke', '#000000');
49435
+
49436
+ $("#" + ic.pre + "dl_scatterplot rect").attr('stroke-width', 1);
49437
+ $("#" + ic.pre + "dl_scatterplot circle").attr('stroke-width', 1);
49438
+ }
49382
49439
  }
49383
49440
 
49384
49441
  //Remove the selection in the menu of defined sets.
@@ -49476,7 +49533,7 @@ class HlUpdate {
49476
49533
  // update highlight in 2D window
49477
49534
  //Update the highlight of 2D interaction diagram according to the current highlighted atoms.
49478
49535
  updateHl2D(chainArray2d) { let ic = this.icn3d, me = ic.icn3dui;
49479
- this.removeHl2D();
49536
+ this.removeHl2D(true);
49480
49537
 
49481
49538
  if(ic.hAtoms && ic.atoms && Object.keys(ic.hAtoms).length == Object.keys(ic.atoms).length) return;
49482
49539
 
@@ -49903,6 +49960,8 @@ class LineGraph {
49903
49960
  && ic.chainsMapping[chainid2] && ic.chainsMapping[chainid2][resid2]) {
49904
49961
  mapping1 = (nodeA.s == "a") ? ic.chainsMapping[chainid1][resid1] : ic.chainsMapping[chainid2][resid2];
49905
49962
  mapping2 = (nodeA.s == "a") ? ic.chainsMapping[chainid2][resid2] : ic.chainsMapping[chainid1][resid1];
49963
+
49964
+ let bIgRef = (mapping1.length > 4 && !isNaN(parseInt(mapping1.substr(-4, 4)))) || (mapping2.length > 4 && !isNaN(parseInt(mapping2.substr(-4, 4))));
49906
49965
 
49907
49966
  let mappingid = mapping1 + '_' + mapping2 + '_' + link.c; // link.c determines the interaction type
49908
49967
 
@@ -49914,7 +49973,7 @@ class LineGraph {
49914
49973
  linkDiff.source += separatorDiff + ic.chainsMapping[chainid1][resid1];
49915
49974
  linkDiff.target += separatorDiff + ic.chainsMapping[chainid2][resid2];
49916
49975
 
49917
- if(linkedNodeCnt[mappingid] == structureArray.length && linkedNodeInterDiffBool[mappingid] == 0) {
49976
+ if(linkedNodeCnt[mappingid] == structureArray.length && (bIgRef || linkedNodeInterDiffBool[mappingid] == 0)) {
49918
49977
  linkArraySplitCommon[index].push(linkCommon);
49919
49978
  }
49920
49979
  else {
@@ -64837,7 +64896,7 @@ class Vastplus {
64837
64896
  let chainid = chainidArray[i];
64838
64897
  let atoms = me.hashUtilsCls.intHash(ic.hAtoms, ic.chains[chainid]);
64839
64898
  let firstAtom = ic.firstAtomObjCls.getFirstAtomObj(atoms);
64840
- structHash[firstAtom.structure] = 1;
64899
+ if(firstAtom) structHash[firstAtom.structure] = 1;
64841
64900
  }
64842
64901
  }
64843
64902
 
@@ -65859,6 +65918,11 @@ class ApplyCommand {
65859
65918
 
65860
65919
  ic.drawCls.draw();
65861
65920
  }
65921
+ else if(command == 'add ig labels') {
65922
+ ic.residueLabelsCls.addIgLabels(ic.hAtoms);
65923
+
65924
+ ic.drawCls.draw();
65925
+ }
65862
65926
  else if(command == 'add atom labels') {
65863
65927
  ic.residueLabelsCls.addAtomLabels(ic.hAtoms);
65864
65928
 
@@ -67185,6 +67249,7 @@ class ApplyCommand {
67185
67249
  else if(cmd.indexOf('hide annotation') == 0) return seqAnnoStr + ': checkboxes off';
67186
67250
  else if(cmd == 'add residue labels') return labelStr + 'per Residue';
67187
67251
  else if(cmd == 'add residue number labels') return labelStr + 'per Residue & Number';
67252
+ else if(cmd == 'add Ig domain labels') return labelStr + 'per Ig Domain';
67188
67253
  else if(cmd == 'add atom labels') return labelStr + 'per Atom';
67189
67254
  else if(cmd == 'add chain labels') return labelStr + 'per Chain';
67190
67255
  else if(cmd == 'add terminal labels') return labelStr + 'N- & C- Termini';
@@ -81689,7 +81754,7 @@ class iCn3DUI {
81689
81754
  //even when multiple iCn3D viewers are shown together.
81690
81755
  this.pre = this.cfg.divid + "_";
81691
81756
 
81692
- this.REVISION = '3.32.0';
81757
+ this.REVISION = '3.33.0';
81693
81758
 
81694
81759
  // In nodejs, iCn3D defines "window = {navigator: {}}"
81695
81760
  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.32.0",
3
+ "version": "3.33.0",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {