icn3d 3.50.0 → 3.51.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/css/icn3d.css +3 -2
- package/icn3d.js +330 -103
- package/icn3d.min.js +4 -4
- package/icn3d.module.js +330 -103
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -59492,7 +59492,7 @@ class ClickMenu {
|
|
|
59492
59492
|
let definedAtomsHtml = ic.definedSetsCls.setAtomMenu(['protein'], bNucleotides);
|
|
59493
59493
|
if($("#" + me.pre + "atomsCustomNucleotide").length && definedAtomsHtml) {
|
|
59494
59494
|
$("#" + me.pre + "atomsCustomNucleotide").html(definedAtomsHtml);
|
|
59495
|
-
me.htmlCls.dialogCls.openDlg('dl_2ddgm_r2dt', 'Show R2DT Diagram for
|
|
59495
|
+
me.htmlCls.dialogCls.openDlg('dl_2ddgm_r2dt', 'Show R2DT Diagram for RNAs');
|
|
59496
59496
|
$("#" + me.pre + "atomsCustomNucleotide").resizable();
|
|
59497
59497
|
}
|
|
59498
59498
|
else {
|
|
@@ -61421,7 +61421,7 @@ class SetMenu {
|
|
|
61421
61421
|
|
|
61422
61422
|
html += this.getMenuText('2ddgmwrap', '2D Diagram', undefined, 1, 1);
|
|
61423
61423
|
html += "<ul>";
|
|
61424
|
-
html += this.getLink('2ddgm_r2dt', 'for
|
|
61424
|
+
html += this.getLink('2ddgm_r2dt', 'for RNAs' + me.htmlCls.wifiStr, 1, 2);
|
|
61425
61425
|
html += this.getLink('2ddgm_igdgm', 'for Ig Domains' + me.htmlCls.wifiStr, 1, 2);
|
|
61426
61426
|
if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined || me.cfg.blast_rep_id !== undefined || me.cfg.align !== undefined || me.cfg.chainalign !== undefined) {
|
|
61427
61427
|
html += this.getLink('mn2_2ddgm', 'for Chains ' + me.htmlCls.wifiStr, 1, 2);
|
|
@@ -61874,6 +61874,7 @@ class Dialog {
|
|
|
61874
61874
|
let bLigplot = $('#' + me.pre + 'dl_ligplot').hasClass('ui-dialog-content'); // initialized
|
|
61875
61875
|
let bContactmap = $('#' + me.pre + 'dl_contactmap').hasClass('ui-dialog-content'); // initialized
|
|
61876
61876
|
let b2ddiagram = $('#' + me.pre + 'dl_2ddiagram').hasClass('ui-dialog-content'); // initialized
|
|
61877
|
+
let big2ddgm = $('#' + me.pre + 'dl_ig2ddgm').hasClass('ui-dialog-content'); // initialized
|
|
61877
61878
|
let brnacanvas = $('#' + me.pre + 'dl_rnacanvas').hasClass('ui-dialog-content'); // initialized
|
|
61878
61879
|
let bAlignerrormap = $('#' + me.pre + 'dl_alignerrormap').hasClass('ui-dialog-content'); // initialized
|
|
61879
61880
|
let bTable = $('#' + me.pre + 'dl_interactionsorted').hasClass('ui-dialog-content'); // initialized
|
|
@@ -61896,6 +61897,7 @@ class Dialog {
|
|
|
61896
61897
|
id2flag.dl_contactmap = 'bContactmap2';
|
|
61897
61898
|
id2flag.dl_2ddiagram = 'b2ddiagram2';
|
|
61898
61899
|
id2flag.dl_rnacanvas = 'brnacanvas2';
|
|
61900
|
+
id2flag.dl_ig2ddgm = 'big2ddgm2';
|
|
61899
61901
|
id2flag.dl_alignerrormap = 'bAlignerrormap2';
|
|
61900
61902
|
id2flag.dl_interactionsorted = 'bTable2';
|
|
61901
61903
|
id2flag.dl_alignment = 'bAlignmentInit2';
|
|
@@ -61913,6 +61915,7 @@ class Dialog {
|
|
|
61913
61915
|
if(bContactmap) status.bContactmap2 = $('#' + me.pre + 'dl_contactmap').dialog( 'isOpen' );
|
|
61914
61916
|
if(b2ddiagram) status.b2ddiagram2 = $('#' + me.pre + 'dl_2ddiagram').dialog( 'isOpen' );
|
|
61915
61917
|
if(brnacanvas) status.brnacanvas2 = $('#' + me.pre + 'dl_rnacanvas').dialog( 'isOpen' );
|
|
61918
|
+
if(big2ddgm) status.big2ddgm2 = $('#' + me.pre + 'dl_ig2ddgm').dialog( 'isOpen' );
|
|
61916
61919
|
if(bAlignerrormap) status.bAlignerror2 = $('#' + me.pre + 'dl_alignerrormap').dialog( 'isOpen' );
|
|
61917
61920
|
if(bTable) status.bTable2 = $('#' + me.pre + 'dl_interactionsorted').dialog( 'isOpen' );
|
|
61918
61921
|
if(bAlignmentInit) status.bAlignmentInit2 = $('#' + me.pre + 'dl_alignment').dialog( 'isOpen' );
|
|
@@ -62100,7 +62103,7 @@ class Dialog {
|
|
|
62100
62103
|
|
|
62101
62104
|
let status = this.getDialogStatus().status;
|
|
62102
62105
|
|
|
62103
|
-
if(id === me.pre + 'dl_selectannotations' || id === me.pre + 'dl_graph' || id === me.pre + 'dl_linegraph' || id === me.pre + 'dl_scatterplot' || id === me.pre + 'dl_rmsdplot' || id === me.pre + 'dl_hbondplot' || id === me.pre + 'dl_ligplot' || id === me.pre + 'dl_contactmap' || id === me.pre + 'dl_2ddiagram' || id === me.pre + 'dl_rnacanvas' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
|
|
62106
|
+
if(id === me.pre + 'dl_selectannotations' || id === me.pre + 'dl_graph' || id === me.pre + 'dl_linegraph' || id === me.pre + 'dl_scatterplot' || id === me.pre + 'dl_rmsdplot' || id === me.pre + 'dl_hbondplot' || id === me.pre + 'dl_ligplot' || id === me.pre + 'dl_contactmap' || id === me.pre + 'dl_2ddiagram' || id === me.pre + 'dl_rnacanvas' || id === me.pre + 'dl_ig2ddgm' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
|
|
62104
62107
|
//var dialogWidth = 0.5 *(me.htmlCls.WIDTH - me.htmlCls.LESSWIDTH) - twoddgmWidth * 0.5;
|
|
62105
62108
|
let dialogWidth = 0.5 *(me.htmlCls.WIDTH) - twoddgmWidth * 0.5;
|
|
62106
62109
|
|
|
@@ -63066,19 +63069,19 @@ class SetDialog {
|
|
|
63066
63069
|
html += "</div>";
|
|
63067
63070
|
|
|
63068
63071
|
html += me.htmlCls.divStr + "dl_2ddgm_r2dt' class='" + dialogClass + "'>";
|
|
63069
|
-
html += this.addNotebookTitle('dl_2ddgm_r2dt', '2D Diagram for
|
|
63070
|
-
html += "1. Select a
|
|
63072
|
+
html += this.addNotebookTitle('dl_2ddgm_r2dt', '2D Diagram for RNAs (R2DT)');
|
|
63073
|
+
html += "1. Select a RNA chain to show 2D diagram:<br>";
|
|
63071
63074
|
html += "<select style='max-width:200px' id='" + me.pre + "atomsCustomNucleotide' size='5' style='min-width:130px;'>";
|
|
63072
63075
|
html += "</select><br>";
|
|
63073
63076
|
html += "2. " + me.htmlCls.buttonStr + "applyr2dt'>R2DT Diagram</button>" + me.htmlCls.buttonStr + "applyfr3d' style='margin-left:12px'>2D Diagram with RNAcanvas</button><br><br>(Hints: Click on Residues in 2D to highlight in 3D. <br>Ctrl + click to select multiple residues.)<br>";
|
|
63074
63077
|
html += "</div>";
|
|
63075
63078
|
|
|
63076
63079
|
html += me.htmlCls.divStr + "dl_2ddgm_igdgm' class='" + dialogClass + "'>";
|
|
63077
|
-
html += this.addNotebookTitle('dl_2ddgm_igdgm', '2D Diagram for Ig Domains
|
|
63080
|
+
html += this.addNotebookTitle('dl_2ddgm_igdgm', '2D Diagram for Ig Domains');
|
|
63078
63081
|
html += "1. Select a protein chain to show Ig diagram. An Excel file containing <br>the Ig diagram will be saved to your computer.<br>";
|
|
63079
63082
|
html += "<select style='max-width:200px' id='" + me.pre + "atomsCustomProtein' size='5' style='min-width:130px;'>";
|
|
63080
63083
|
html += "</select><br>";
|
|
63081
|
-
html += me.htmlCls.buttonStr + "applyigdgm'>Show Ig Diagram</button><br>";
|
|
63084
|
+
html += "2. " + me.htmlCls.buttonStr + "applyigdgm' style='margin-right:12px;'>Show Ig Diagram</button>" + me.htmlCls.buttonStr + "saveigdgm'>Download Ig Diagrams in Excel</button><br>";
|
|
63082
63085
|
html += "</div>";
|
|
63083
63086
|
|
|
63084
63087
|
html += me.htmlCls.divStr + "dl_hbonds' class='" + dialogClass + "'>";
|
|
@@ -63436,6 +63439,20 @@ class SetDialog {
|
|
|
63436
63439
|
html += '<div id="' + me.pre + 'rnacanvasDiv"></div>';
|
|
63437
63440
|
html += "</div>";
|
|
63438
63441
|
|
|
63442
|
+
|
|
63443
|
+
me.ig2ddgmid = me.pre + 'ig2ddgm';
|
|
63444
|
+
html += me.htmlCls.divStr + "dl_ig2ddgm' style='background-color:white' class='" + dialogClass + "'>";
|
|
63445
|
+
html += this.addNotebookTitle('dl_ig2ddgm', '2D Diagram for Ig domains');
|
|
63446
|
+
|
|
63447
|
+
html += "<table><tr><td>Select an Ig domain:<br>";
|
|
63448
|
+
html += me.htmlCls.divNowrapStr + "<select id='" + me.pre + "iglist' size='2' style='min-width:130px;'>";
|
|
63449
|
+
html += "</select></td><td valign='top'>";
|
|
63450
|
+
html += me.htmlCls.space2 + buttonStrTmp + me.ig2ddgmid + '_svg">Download SVG</button></td></tr></table><br>';
|
|
63451
|
+
|
|
63452
|
+
html += '<div id="' + me.pre + 'ig2ddgmDiv"></div>';
|
|
63453
|
+
html += "</div>";
|
|
63454
|
+
|
|
63455
|
+
|
|
63439
63456
|
html += me.htmlCls.divStr + "dl_alignerrormap' style='background-color:white' class='" + dialogClass + "'>";
|
|
63440
63457
|
html += this.addNotebookTitle('dl_alignerrormap', 'PAE Map');
|
|
63441
63458
|
|
|
@@ -66708,7 +66725,17 @@ class Events {
|
|
|
66708
66725
|
thisClass.setLogCmd('diagram 2d fr3d | ' + chainid, true);
|
|
66709
66726
|
});
|
|
66710
66727
|
|
|
66711
|
-
me.myEventCls.onIds("#" + me.pre + "
|
|
66728
|
+
me.myEventCls.onIds("#" + me.pre + "saveigdgm", "click", async function(e) { let ic = me.icn3d;
|
|
66729
|
+
e.preventDefault();
|
|
66730
|
+
//if(!me.cfg.notebook) dialog.dialog( "close" );
|
|
66731
|
+
|
|
66732
|
+
let chainid = $("#" + ic.pre + "atomsCustomProtein").val();
|
|
66733
|
+
|
|
66734
|
+
let bSave = true;
|
|
66735
|
+
await ic.diagram2dCls.drawIgdgm(chainid, bSave);
|
|
66736
|
+
thisClass.setLogCmd('download 2d ig | ' + chainid, true);
|
|
66737
|
+
});
|
|
66738
|
+
me.myEventCls.onIds("#" + me.pre + "applyigdgm", "click", async function(e) { let ic = me.icn3d;
|
|
66712
66739
|
e.preventDefault();
|
|
66713
66740
|
//if(!me.cfg.notebook) dialog.dialog( "close" );
|
|
66714
66741
|
|
|
@@ -66908,6 +66935,11 @@ class Events {
|
|
|
66908
66935
|
ic.saveFileCls.saveFile(chainid + "_seq.txt", "text", [seq]);
|
|
66909
66936
|
});
|
|
66910
66937
|
|
|
66938
|
+
me.myEventCls.onIds("#" + me.ig2ddgmid + "_svg", "click", function(e) { let ic = me.icn3d;
|
|
66939
|
+
e.preventDefault();
|
|
66940
|
+
|
|
66941
|
+
ic.saveFileCls.saveSvg("ig2ddgmSvg", ic.ig2ddgm_chainid + "_ig_2d.svg");
|
|
66942
|
+
});
|
|
66911
66943
|
|
|
66912
66944
|
me.myEventCls.onIds("#" + me.linegraphid + "_svg", "click", function(e) { let ic = me.icn3d;
|
|
66913
66945
|
e.preventDefault();
|
|
@@ -84990,6 +85022,28 @@ class ApplyClbonds {
|
|
|
84990
85022
|
} // if
|
|
84991
85023
|
} // if
|
|
84992
85024
|
|
|
85025
|
+
// add crosslink chemicals to the linked protein/nucleotide residues
|
|
85026
|
+
for(let structure in ic.structures) {
|
|
85027
|
+
let clbondArray = ic.clbondpnts[structure];
|
|
85028
|
+
if(clbondArray === undefined) {
|
|
85029
|
+
break;
|
|
85030
|
+
}
|
|
85031
|
+
for(let i = 0, il = clbondArray.length; i < il; i = i + 2) {
|
|
85032
|
+
let resid1 = clbondArray[i];
|
|
85033
|
+
let resid2 = clbondArray[i+1];
|
|
85034
|
+
|
|
85035
|
+
let atom1 = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid1]);
|
|
85036
|
+
let atom2 = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid2]);
|
|
85037
|
+
|
|
85038
|
+
if((ic.proteins.hasOwnProperty(atom1.serial) || ic.nucleotides.hasOwnProperty(atom1.serial)) && ic.chemicals.hasOwnProperty(atom2.serial)) {
|
|
85039
|
+
ic.residues[resid1] = me.hashUtilsCls.unionHash(ic.residues[resid1], ic.residues[resid2]);
|
|
85040
|
+
}
|
|
85041
|
+
else if((ic.proteins.hasOwnProperty(atom2.serial) || ic.nucleotides.hasOwnProperty(atom2.serial)) && ic.chemicals.hasOwnProperty(atom1.serial)) {
|
|
85042
|
+
ic.residues[resid2] = me.hashUtilsCls.unionHash(ic.residues[resid2], ic.residues[resid1]);
|
|
85043
|
+
}
|
|
85044
|
+
}
|
|
85045
|
+
}
|
|
85046
|
+
|
|
84993
85047
|
return ic.residuesHashClbonds;
|
|
84994
85048
|
}
|
|
84995
85049
|
|
|
@@ -85336,7 +85390,7 @@ class ApplyDisplay {
|
|
|
85336
85390
|
|
|
85337
85391
|
// remove schematic labels
|
|
85338
85392
|
//if(ic.labels !== undefined) ic.labels['schematic'] = undefined;
|
|
85339
|
-
if(ic.labels !== undefined) delete ic.labels['schematic'];
|
|
85393
|
+
if(!bHighlight && ic.labels !== undefined) delete ic.labels['schematic'];
|
|
85340
85394
|
/*
|
|
85341
85395
|
if(bHighlight) {
|
|
85342
85396
|
//let residueHashCalpha = ic.firstAtomObjCls.getResiduesFromCalphaAtoms(ic.hAtoms);
|
|
@@ -85357,6 +85411,7 @@ class ApplyDisplay {
|
|
|
85357
85411
|
//var bPhosphorusOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(atomHash), "O3'", "O3*") || me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(atomHash), "P");
|
|
85358
85412
|
//let bPhosphorusOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms));
|
|
85359
85413
|
let nucleotidesAtoms = me.hashUtilsCls.intHash(atomHash, ic.nucleotides);
|
|
85414
|
+
|
|
85360
85415
|
let bPhosphorusOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(nucleotidesAtoms, ic.atoms));
|
|
85361
85416
|
|
|
85362
85417
|
if(style === 'ribbon') {
|
|
@@ -85395,13 +85450,13 @@ class ApplyDisplay {
|
|
|
85395
85450
|
|
|
85396
85451
|
//if(firstAtom.het) { // chemicals
|
|
85397
85452
|
if(ic.chemicals.hasOwnProperty(firstAtom.serial)) { // chemicals
|
|
85398
|
-
ic.residueLabelsCls.addNonCarbonAtomLabels(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms));
|
|
85453
|
+
if(!bHighlight) ic.residueLabelsCls.addNonCarbonAtomLabels(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms));
|
|
85399
85454
|
|
|
85400
85455
|
let bSchematic = true;
|
|
85401
85456
|
ic.stickCls.createStickRepresentation(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms), chemicalSchematicRadius, chemicalSchematicRadius, undefined, bHighlight, bSchematic);
|
|
85402
85457
|
}
|
|
85403
85458
|
else { // nucleotides or proteins
|
|
85404
|
-
ic.residueLabelsCls.addResidueLabels(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms), true);
|
|
85459
|
+
if(!bHighlight) ic.residueLabelsCls.addResidueLabels(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms), true);
|
|
85405
85460
|
|
|
85406
85461
|
if(bPhosphorusOnly) {
|
|
85407
85462
|
ic.cylinderCls.createCylinderCurve(me.hashUtilsCls.hash2Atoms(atomHash, ic.atoms), ["P"], ic.traceRadius, false, bHighlight);
|
|
@@ -91017,7 +91072,7 @@ class SetOption {
|
|
|
91017
91072
|
ic.atoms[i].style2 = style;
|
|
91018
91073
|
}
|
|
91019
91074
|
}
|
|
91020
|
-
else {
|
|
91075
|
+
else {
|
|
91021
91076
|
for(let i in atoms) {
|
|
91022
91077
|
ic.atoms[i].style = style;
|
|
91023
91078
|
}
|
|
@@ -107764,6 +107819,7 @@ class MmdbParser {
|
|
|
107764
107819
|
//ic.molid2color = molid2color;
|
|
107765
107820
|
//ic.chain2molid = chain2molid;
|
|
107766
107821
|
ic.molid2chain = molid2chain;
|
|
107822
|
+
|
|
107767
107823
|
// small structure with all atoms
|
|
107768
107824
|
// show surface options
|
|
107769
107825
|
$("#" + ic.pre + "accordion5").show();
|
|
@@ -116200,7 +116256,9 @@ class LoadPDB {
|
|
|
116200
116256
|
|
|
116201
116257
|
let bHeader = false, bFirstAtom = true;
|
|
116202
116258
|
|
|
116203
|
-
let segId, prevSegId;
|
|
116259
|
+
let segId, prevSegId, entityid;
|
|
116260
|
+
|
|
116261
|
+
if(!ic.molid2chain) ic.molid2chain = {};
|
|
116204
116262
|
|
|
116205
116263
|
for (let i in lines) {
|
|
116206
116264
|
let line = lines[i];
|
|
@@ -116345,6 +116403,17 @@ class LoadPDB {
|
|
|
116345
116403
|
ic.organism = line.substr(28).toLowerCase().trim();
|
|
116346
116404
|
|
|
116347
116405
|
ic.organism = ic.organism.substr(0, ic.organism.length - 1);
|
|
116406
|
+
} else if (record === 'COMPND') {
|
|
116407
|
+
if(line.indexOf('MOL_ID: ') != -1) { // COMPND MOL_ID: 1;
|
|
116408
|
+
let itemArray = line.trim().split(' ');
|
|
116409
|
+
let lastItem = itemArray[itemArray.length - 1];
|
|
116410
|
+
entityid = lastItem.substr(0, lastItem.length - 1);
|
|
116411
|
+
}
|
|
116412
|
+
else if(line.indexOf('CHAIN: ') != -1) { // COMPND 3 CHAIN: H;
|
|
116413
|
+
let itemArray = line.trim().split(' ');
|
|
116414
|
+
let lastItem = itemArray[itemArray.length - 1];
|
|
116415
|
+
ic.molid2chain[parseInt(entityid)] = structure + '_' + lastItem.substr(0, lastItem.length - 1);
|
|
116416
|
+
}
|
|
116348
116417
|
} else if (record === 'ENDMDL') {
|
|
116349
116418
|
if(ic.statefileArray) {
|
|
116350
116419
|
ic.struct_statefile.push({'structure': structure, 'statefile': ic.statefileArray[moleculeNum - 1]});
|
|
@@ -117421,6 +117490,7 @@ class LoadCIF {
|
|
|
117421
117490
|
let resnArray = atom_site.getColumn("label_comp_id");
|
|
117422
117491
|
let elemArray = atom_site.getColumn("type_symbol");
|
|
117423
117492
|
let nameArray = atom_site.getColumn("label_atom_id");
|
|
117493
|
+
let entiyidArray = atom_site.getColumn("label_entity_id");
|
|
117424
117494
|
|
|
117425
117495
|
let chainArray = atom_site.getColumn("auth_asym_id");
|
|
117426
117496
|
|
|
@@ -117442,6 +117512,8 @@ class LoadCIF {
|
|
|
117442
117512
|
let prevResn;
|
|
117443
117513
|
let sChain = {};
|
|
117444
117514
|
let prevModelNum = '';
|
|
117515
|
+
if(!ic.molid2chain) ic.molid2chain = {};
|
|
117516
|
+
|
|
117445
117517
|
for (let i = 0; i < atomSize; ++i) {
|
|
117446
117518
|
let modelNum = modelNumArray.getString(i);
|
|
117447
117519
|
if(i > 0 && modelNum != prevModelNum) {
|
|
@@ -117460,6 +117532,7 @@ class LoadCIF {
|
|
|
117460
117532
|
let resn = resnArray.getString(i);
|
|
117461
117533
|
let elem = elemArray.getString(i);
|
|
117462
117534
|
let atom = nameArray.getString(i);
|
|
117535
|
+
let entityid = entiyidArray.getString(i);
|
|
117463
117536
|
let chain = chainArray.getString(i);
|
|
117464
117537
|
let resi = resiArray.getString(i);
|
|
117465
117538
|
let oriResi = resiOriArray.getString(i);
|
|
@@ -117566,6 +117639,8 @@ class LoadCIF {
|
|
|
117566
117639
|
chainNum = structure + "_" + chain;
|
|
117567
117640
|
oriResidueNum = chainNum + "_" + oriResi;
|
|
117568
117641
|
|
|
117642
|
+
ic.molid2chain[parseInt(entityid)] = chainNum;
|
|
117643
|
+
|
|
117569
117644
|
residueNum = chainNum + "_" + resi;
|
|
117570
117645
|
|
|
117571
117646
|
//let chain_resi = chain + "_" + resi;
|
|
@@ -119236,7 +119311,7 @@ class ApplyCommand {
|
|
|
119236
119311
|
ic.definedSetsCls.deleteSelectedSets();
|
|
119237
119312
|
}
|
|
119238
119313
|
else if(command == 'view interactions' || command == 'view 2d diagram') {
|
|
119239
|
-
if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined) {
|
|
119314
|
+
if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined || me.cfg.mmdbafid !== undefined) {
|
|
119240
119315
|
ic.ParserUtilsCls.set2DDiagrams(ic.inputid);
|
|
119241
119316
|
}
|
|
119242
119317
|
}
|
|
@@ -120751,27 +120826,31 @@ class DefinedSets {
|
|
|
120751
120826
|
let colorStr =(atom === undefined || atom.color === undefined || atom.color.getHexString().toUpperCase() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
|
|
120752
120827
|
let color =(atom !== undefined && atom.color !== undefined) ? colorStr : '000000';
|
|
120753
120828
|
|
|
120754
|
-
if(bNucleotide
|
|
120829
|
+
if(bNucleotide) {
|
|
120755
120830
|
// Handle nucleotide-specific logic
|
|
120756
|
-
if(ic.nucleotides.hasOwnProperty(atom.serial) && name.split('_').length == 2 && !ic.structures.hasOwnProperty(name)) {
|
|
120831
|
+
if(atom && ic.nucleotides.hasOwnProperty(atom.serial) && name.split('_').length == 2 && !ic.structures.hasOwnProperty(name)) {
|
|
120757
120832
|
let selectStr = (cnt == 0) ? "selected" : "";
|
|
120758
120833
|
|
|
120834
|
+
if(cnt == 0) this.selectSets([name]);
|
|
120835
|
+
|
|
120759
120836
|
html += "<option value='" + name + "' style='color:#" + color + "' " + selectStr + ">" + name + "</option>";
|
|
120760
120837
|
bFoundNucleotide = true;
|
|
120761
120838
|
++cnt;
|
|
120762
120839
|
}
|
|
120763
120840
|
}
|
|
120764
|
-
else if(bProtein
|
|
120841
|
+
else if(bProtein) {
|
|
120765
120842
|
// Handle protein-specific logic
|
|
120766
|
-
if(ic.proteins.hasOwnProperty(atom.serial) && name.split('_').length == 2 && !ic.structures.hasOwnProperty(name)) {
|
|
120843
|
+
if(atom && ic.proteins.hasOwnProperty(atom.serial) && name.split('_').length == 2 && !ic.structures.hasOwnProperty(name)) {
|
|
120767
120844
|
let selectStr = (cnt == 0) ? "selected" : "";
|
|
120768
120845
|
|
|
120846
|
+
if(cnt == 0) this.selectSets([name]);
|
|
120847
|
+
|
|
120769
120848
|
html += "<option value='" + name + "' style='color:#" + color + "' " + selectStr + ">" + name + "</option>";
|
|
120770
120849
|
bFoundProtein = true;
|
|
120771
120850
|
++cnt;
|
|
120772
120851
|
}
|
|
120773
120852
|
}
|
|
120774
|
-
else {
|
|
120853
|
+
else {
|
|
120775
120854
|
if(commandnameArray.indexOf(name) != -1) {
|
|
120776
120855
|
html += "<option value='" + name + "' style='color:#" + color + "' selected='selected'>" + name + "</option>";
|
|
120777
120856
|
}
|
|
@@ -121954,6 +122033,20 @@ class LoadScript {
|
|
|
121954
122033
|
await ic.diagram2dCls.drawIgdgm(chainid);
|
|
121955
122034
|
ic.bRender = false;
|
|
121956
122035
|
}
|
|
122036
|
+
else if(command.indexOf('update ig') == 0) {
|
|
122037
|
+
let paraArray = command.split(' ');
|
|
122038
|
+
let igIndex_igType = (paraArray.length == 3) ? paraArray[2] : '';
|
|
122039
|
+
await ic.diagram2dCls.show2DdgmForIg(igIndex_igType[0], igIndex_igType[1]);
|
|
122040
|
+
}
|
|
122041
|
+
else if(command.indexOf('download 2d ig') == 0) {
|
|
122042
|
+
let paraArray = command.split(' | ');
|
|
122043
|
+
let pos = command.lastIndexOf(' ');
|
|
122044
|
+
let chainid = (paraArray.length == 2) ? paraArray[1] : command.substr(pos + 1);
|
|
122045
|
+
|
|
122046
|
+
ic.bRender = true;
|
|
122047
|
+
await ic.diagram2dCls.drawIgdgm(chainid, true);
|
|
122048
|
+
ic.bRender = false;
|
|
122049
|
+
}
|
|
121957
122050
|
else if(command.indexOf('add msa track') == 0) {
|
|
121958
122051
|
//add msa track | chainid " + chainid + " | startpos " + startpos + " | type " + type + " | fastaList " + fastaList
|
|
121959
122052
|
let paraArray = command.split(' | ');
|
|
@@ -129300,6 +129393,74 @@ class Diagram2d {
|
|
|
129300
129393
|
//}
|
|
129301
129394
|
}
|
|
129302
129395
|
});
|
|
129396
|
+
|
|
129397
|
+
//$("#" + me.pre + "ig2ddgmDiv").html(svgHtml);
|
|
129398
|
+
$(document).on("change", "#" + me.pre + "iglist", async function(e) { thisClass.icn3d;
|
|
129399
|
+
let igIndex_igType = $("#" + me.pre + "iglist").val().split('_');
|
|
129400
|
+
|
|
129401
|
+
await thisClass.show2DdgmForIg(igIndex_igType[0], igIndex_igType[1]);
|
|
129402
|
+
|
|
129403
|
+
me.htmlCls.clickMenuCls.setLogCmd('update ig ' + igIndex_igType, true);
|
|
129404
|
+
});
|
|
129405
|
+
|
|
129406
|
+
// ig 2D diagram: 2D -> 3D
|
|
129407
|
+
$(document).on('click', '#ig2ddgmSvg .node', function(e) { let ic = thisClass.icn3d;
|
|
129408
|
+
// clear all node color
|
|
129409
|
+
thisClass.resetAllNodes('ig2ddgmSvg');
|
|
129410
|
+
|
|
129411
|
+
$(this).css({'font-size': '20px', 'font-weight': 'bold'});
|
|
129412
|
+
|
|
129413
|
+
//<text x="502.1" y="301.8" class="s9 c8547"><title>Ref. Num. 8547</title> N99 </text>
|
|
129414
|
+
let text = $(this).html().trim();
|
|
129415
|
+
let resnresi = text.substr(text.lastIndexOf(' ') + 1);
|
|
129416
|
+
|
|
129417
|
+
let resid = ic.ncbi2resid[ic.ig2ddgm_chainid + '_' + resnresi.substr(1)];
|
|
129418
|
+
|
|
129419
|
+
// highlight the selected residue
|
|
129420
|
+
if(ic.bCtrl || ic.bShift) {
|
|
129421
|
+
ic.hAtoms = me.hashUtilsCls.unionHash(ic.hAtoms, ic.residues[resid]);
|
|
129422
|
+
}
|
|
129423
|
+
else {
|
|
129424
|
+
ic.hAtoms = ic.residues[resid];
|
|
129425
|
+
}
|
|
129426
|
+
|
|
129427
|
+
ic.hlUpdateCls.showHighlight();
|
|
129428
|
+
});
|
|
129429
|
+
|
|
129430
|
+
// $(document).on('mouseout', '#ig2ddgmSvg .node', function(e) { let ic = thisClass.icn3d;
|
|
129431
|
+
// thisClass.resetAllNodes('ig2ddgmSvg');
|
|
129432
|
+
// });
|
|
129433
|
+
|
|
129434
|
+
// ig 2D diagram: 3D -> 2D
|
|
129435
|
+
$(document).on('icn3d.pick.click icn3d.pick.mouseover', function(ev, data) { let ic = thisClass.icn3d;
|
|
129436
|
+
// get the residues in the selection
|
|
129437
|
+
let ncbiresid = data;
|
|
129438
|
+
let resid = ic.ncbi2resid[ncbiresid];
|
|
129439
|
+
|
|
129440
|
+
if(ic.ig2ddgm_chainid && ic.resid2refnum && ic.resid2refnum[resid]) {
|
|
129441
|
+
let refnumLabel = ic.resid2refnum[resid];
|
|
129442
|
+
let refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
|
|
129443
|
+
|
|
129444
|
+
// clear all node color
|
|
129445
|
+
thisClass.resetAllNodes('ig2ddgmSvg');
|
|
129446
|
+
|
|
129447
|
+
// highlight the residue
|
|
129448
|
+
$("#ig2ddgmSvg .c" + refnumStr).css({'font-size': '20px', 'font-weight': 'bold'});
|
|
129449
|
+
}
|
|
129450
|
+
});
|
|
129451
|
+
}
|
|
129452
|
+
|
|
129453
|
+
// reset all nodes
|
|
129454
|
+
resetAllNodes(id) { let ic = this.icn3d; ic.icn3dui;
|
|
129455
|
+
// Select the SVG container
|
|
129456
|
+
const svg = document.getElementById(id);
|
|
129457
|
+
|
|
129458
|
+
// Select all text-related nodes: <text>
|
|
129459
|
+
const textElements = svg.querySelectorAll('text');
|
|
129460
|
+
|
|
129461
|
+
textElements.forEach((node) => {
|
|
129462
|
+
node.style = {};
|
|
129463
|
+
});
|
|
129303
129464
|
}
|
|
129304
129465
|
|
|
129305
129466
|
clickNode(node) { let ic = this.icn3d, me = ic.icn3dui;
|
|
@@ -129534,19 +129695,14 @@ class Diagram2d {
|
|
|
129534
129695
|
|
|
129535
129696
|
//https://9c5d031c.na-hackathon-2026.pages.dev/api.json
|
|
129536
129697
|
//https://www.ebi.ac.uk/pdbe/static/entry/1ffk_2_9.json, or 1ffk_1_0.json [pdbid_molid_chain]
|
|
129537
|
-
|
|
129538
|
-
|
|
129539
|
-
|
|
129540
|
-
|
|
129541
|
-
|
|
129542
|
-
for(let id in ic.nucleotide_chainid) {
|
|
129543
|
-
ic.chainid2molid[id] = molidTmp;
|
|
129544
|
-
++molidTmp;
|
|
129698
|
+
let molid = 1;
|
|
129699
|
+
for(let i in ic.molid2chain) {
|
|
129700
|
+
if(ic.molid2chain[i] == chainid) {
|
|
129701
|
+
molid = i;
|
|
129702
|
+
break;
|
|
129545
129703
|
}
|
|
129546
129704
|
}
|
|
129547
129705
|
|
|
129548
|
-
let molid = ic.chainid2molid[chainid] ? ic.chainid2molid[chainid] : 1;
|
|
129549
|
-
|
|
129550
129706
|
let url = "https://www.ebi.ac.uk/pdbe/static/entry/" + pdbid.toLowerCase() + "_" + molid + "_" + chain + ".json";
|
|
129551
129707
|
let apiData = await me.getAjaxPromise(url, 'json', undefined, 'The chain ' + chainid + ' with molid ' + molid + ' has no R2DT information in PDBe...');
|
|
129552
129708
|
|
|
@@ -129700,7 +129856,7 @@ class Diagram2d {
|
|
|
129700
129856
|
if(from_type_to.length != 3) continue;
|
|
129701
129857
|
|
|
129702
129858
|
let fromArray = from_type_to[0].split('|'), toArray = from_type_to[2].split('|');
|
|
129703
|
-
if(fromArray.length
|
|
129859
|
+
if(fromArray.length < 5 || toArray.length < 5) continue;
|
|
129704
129860
|
if(fromArray[2] != chain || toArray[2] != chain) continue;
|
|
129705
129861
|
let resi1 = fromArray[4], resi2 = toArray[4];
|
|
129706
129862
|
let ncbiResid1 = ic.resid2ncbi[chainid + '_' + resi1], ncbiResid2 = ic.resid2ncbi[chainid + '_' + resi2];
|
|
@@ -129900,12 +130056,12 @@ class Diagram2d {
|
|
|
129900
130056
|
html += " rnaCanvas.drawingView.fitToContent();\n";
|
|
129901
130057
|
html += " $('.UDedZ1UaiPZJsRmm1yxA').hide();\n"; // hide the "Powered by RNAcanvas" label
|
|
129902
130058
|
|
|
129903
|
-
html += "var pos2node = {}
|
|
130059
|
+
html += "var pos2node = {};\n";
|
|
129904
130060
|
html += "var nodes = rnaCanvas.drawing.bases;\n";
|
|
129905
130061
|
|
|
129906
130062
|
html += "for (var i = 0, il = nodes.length; i < il; i++) {\n";
|
|
129907
130063
|
html += " pos2node[i + 1] = nodes[i];\n";
|
|
129908
|
-
|
|
130064
|
+
html += " nodes[i].setAttribute('resi', i + 1);\n";
|
|
129909
130065
|
html += "}\n";
|
|
129910
130066
|
|
|
129911
130067
|
html += "$(document).on('click', '#rnacanvasSvg svg text', function(e) {\n";
|
|
@@ -129916,19 +130072,17 @@ class Diagram2d {
|
|
|
129916
130072
|
html += " }\n";
|
|
129917
130073
|
html += " $(this)[0].setAttribute('fill', '#f8b84e');\n";
|
|
129918
130074
|
|
|
129919
|
-
html += " var pos = id2pos[id];\n";
|
|
129920
130075
|
html += " var resn = $(this).text().split(' ')[0];\n"; //C Position 8
|
|
129921
|
-
html += " $(document).trigger('from_rnacanvas',
|
|
130076
|
+
html += " $(document).trigger('from_rnacanvas', $(this).attr('resi') + '_' + resn);\n";
|
|
129922
130077
|
html += " document.dispatchEvent(event);\n";
|
|
129923
130078
|
html += "});\n";
|
|
129924
130079
|
|
|
129925
130080
|
html += "$(document).on('mouseover', '#rnacanvasSvg svg text', function(e) {\n";
|
|
129926
130081
|
html += " var id = $(this).attr('id');\n";
|
|
129927
130082
|
html += " $(this)[0].setAttribute('fill', '#f8b84e');\n";
|
|
129928
|
-
|
|
129929
130083
|
html += " if(!$(this)[0].querySelector('title')) {\n";
|
|
129930
130084
|
html += " var title = document.createElementNS('http://www.w3.org/2000/svg', 'title');\n";
|
|
129931
|
-
html += " title.textContent = ' Position ' +
|
|
130085
|
+
html += " title.textContent = ' Position ' + $(this).attr('resi');\n";
|
|
129932
130086
|
html += " $(this)[0].appendChild(title);\n";
|
|
129933
130087
|
html += " }\n";
|
|
129934
130088
|
html += "});\n";
|
|
@@ -129974,7 +130128,12 @@ class Diagram2d {
|
|
|
129974
130128
|
html += " line.setAttribute('y2', node2.y);\n";
|
|
129975
130129
|
html += " line.setAttribute('stroke', 'black');\n";
|
|
129976
130130
|
html += " line.setAttribute('stroke-width', '1');\n";
|
|
129977
|
-
html += " line.setAttribute('title', '" + type + "');\n";
|
|
130131
|
+
//html += " line.setAttribute('title', '" + type + "');\n";
|
|
130132
|
+
|
|
130133
|
+
html += " var title = document.createElementNS('http://www.w3.org/2000/svg', 'title');\n";
|
|
130134
|
+
html += " title.textContent = '" + pos1 + " - " + pos2 + "; " + type + "';\n";
|
|
130135
|
+
html += " line.appendChild(title);\n";
|
|
130136
|
+
|
|
129978
130137
|
html += " rnaCanvas.drawing.domNode.appendChild(line);";
|
|
129979
130138
|
html += "}\n";
|
|
129980
130139
|
}
|
|
@@ -129995,10 +130154,12 @@ class Diagram2d {
|
|
|
129995
130154
|
$("#" + me.pre + "rnacanvasDiv").html(html);
|
|
129996
130155
|
}
|
|
129997
130156
|
|
|
129998
|
-
async drawIgdgm(chainid) { let ic = this.icn3d, me = ic.icn3dui;
|
|
130157
|
+
async drawIgdgm(chainid, bDownload) { let ic = this.icn3d, me = ic.icn3dui;
|
|
129999
130158
|
// select the current chain
|
|
130000
130159
|
//ic.hAtoms = me.hashUtilsCls.cloneHash(ic.chains[chainid]);
|
|
130001
130160
|
|
|
130161
|
+
ic.ig2ddgm_chainid = chainid;
|
|
130162
|
+
|
|
130002
130163
|
// run ig detection
|
|
130003
130164
|
ic.bRunRefnumAgain = true;
|
|
130004
130165
|
if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
|
|
@@ -130022,7 +130183,7 @@ class Diagram2d {
|
|
|
130022
130183
|
|
|
130023
130184
|
let igType = ic.ref2igtype[info.refpdbname];
|
|
130024
130185
|
|
|
130025
|
-
if(igType == 'IgV' || igType == 'IgC1' || igType == 'IgC2' || igType == 'IgI') {
|
|
130186
|
+
if(igType == 'IgV' || igType == 'IgC1' || igType == 'IgC2' || igType == 'IgI' || igType == 'IgFN3') {
|
|
130026
130187
|
bFound = true;
|
|
130027
130188
|
}
|
|
130028
130189
|
|
|
@@ -130030,12 +130191,12 @@ class Diagram2d {
|
|
|
130030
130191
|
}
|
|
130031
130192
|
|
|
130032
130193
|
if(!bFound) {
|
|
130033
|
-
var aaa = 1; //alert("The Ig type(s) for chain " + chainid + " is/are " + igTypeArray + ". Currently only IgV, IgC1, IgC2 and
|
|
130194
|
+
var aaa = 1; //alert("The Ig type(s) for chain " + chainid + " is/are " + igTypeArray + ". Currently only IgV, IgC1, IgC2, IgI and IgFN3 types are supported for drawing Ig diagrams.");
|
|
130034
130195
|
return;
|
|
130035
130196
|
}
|
|
130036
130197
|
|
|
130037
130198
|
// get the hash of refnum to resn
|
|
130038
|
-
|
|
130199
|
+
ic.refnum2resn = {};
|
|
130039
130200
|
for(let resid in ic.resid2refnum) {
|
|
130040
130201
|
let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
|
|
130041
130202
|
if(!atom) continue;
|
|
@@ -130048,88 +130209,154 @@ class Diagram2d {
|
|
|
130048
130209
|
|
|
130049
130210
|
if(refnumLabel) {
|
|
130050
130211
|
refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
|
|
130051
|
-
if(!refnum2resn[domainid]) refnum2resn[domainid] = {};
|
|
130052
|
-
refnum2resn[domainid][refnumStr] = resn + resid.split('_')[2];
|
|
130212
|
+
if(!ic.refnum2resn[domainid]) ic.refnum2resn[domainid] = {};
|
|
130213
|
+
ic.refnum2resn[domainid][refnumStr] = resn + resid.split('_')[2];
|
|
130053
130214
|
}
|
|
130054
130215
|
}
|
|
130055
130216
|
|
|
130056
|
-
if(
|
|
130057
|
-
|
|
130058
|
-
|
|
130217
|
+
if(bDownload) {
|
|
130218
|
+
if(ic.bXlsx === undefined) {
|
|
130219
|
+
let urlScript = "/Structure/icn3d/script/exceljs.min.js";
|
|
130220
|
+
await me.getAjaxPromise(urlScript, 'script');
|
|
130059
130221
|
|
|
130060
|
-
|
|
130061
|
-
|
|
130222
|
+
ic.bXlsx = true;
|
|
130223
|
+
}
|
|
130062
130224
|
|
|
130063
|
-
|
|
130225
|
+
const mainWorkbook = new ExcelJS.Workbook();
|
|
130064
130226
|
|
|
130065
|
-
|
|
130227
|
+
let ig2width = {'IgC1': 17, 'IgC2': 18, 'IgI': 19, 'IgV': 19};
|
|
130066
130228
|
|
|
130067
|
-
|
|
130068
|
-
|
|
130069
|
-
|
|
130070
|
-
|
|
130071
|
-
|
|
130072
|
-
|
|
130073
|
-
|
|
130074
|
-
|
|
130075
|
-
|
|
130076
|
-
|
|
130077
|
-
|
|
130078
|
-
|
|
130079
|
-
|
|
130080
|
-
|
|
130081
|
-
|
|
130082
|
-
|
|
130083
|
-
|
|
130084
|
-
|
|
130085
|
-
|
|
130086
|
-
|
|
130087
|
-
|
|
130088
|
-
|
|
130089
|
-
|
|
130090
|
-
|
|
130091
|
-
|
|
130092
|
-
|
|
130093
|
-
|
|
130094
|
-
|
|
130229
|
+
for(let i = 0, il = igArray.length; i < il; ++i) {
|
|
130230
|
+
let domainid = igArray[i].domainid;
|
|
130231
|
+
let igType = igTypeArray[i];
|
|
130232
|
+
if(!(igType == 'IgV' || igType == 'IgC1' || igType == 'IgC2' || igType == 'IgI' || igType == 'IgFN3')) {
|
|
130233
|
+
mainWorkbook.addWorksheet((i + 1) + ". " + igType);
|
|
130234
|
+
}
|
|
130235
|
+
else {
|
|
130236
|
+
let url = "/Structure/icn3d/template/igstrand_template_" + igType + ".xlsx";
|
|
130237
|
+
let arrayBuffer = await me.getXMLHttpRqstPromise(url, 'GET', 'arraybuffer', 'xlsx');
|
|
130238
|
+
|
|
130239
|
+
const workbook = new ExcelJS.Workbook();
|
|
130240
|
+
// Load the workbook from the buffer
|
|
130241
|
+
await workbook.xlsx.load(arrayBuffer);
|
|
130242
|
+
const worksheet = workbook.getWorksheet(1);
|
|
130243
|
+
|
|
130244
|
+
const newSheet = mainWorkbook.addWorksheet();
|
|
130245
|
+
// Clone the model to transfer styles and data
|
|
130246
|
+
newSheet.model = worksheet.model;
|
|
130247
|
+
newSheet.name = (i + 1) + ". " + igType;
|
|
130248
|
+
|
|
130249
|
+
// Iterate over all rows that have values
|
|
130250
|
+
newSheet.eachRow({ includeEmpty: true }, (row, rowNumber) => {
|
|
130251
|
+
// Iterate over all cells in the row
|
|
130252
|
+
row.eachCell({ includeEmpty: true }, (cell, colNumber) => {
|
|
130253
|
+
//console.log(`Cell [${rowNumber}, ${colNumber}] = ${cell.value}`);
|
|
130254
|
+
if (cell.value && !isNaN(cell.value) && cell.value > 1000 && cell.value < 10000) {
|
|
130255
|
+
if(ic.refnum2resn[domainid].hasOwnProperty(cell.value)) {
|
|
130256
|
+
cell.value = ic.refnum2resn[domainid][cell.value];
|
|
130257
|
+
}
|
|
130258
|
+
else {
|
|
130259
|
+
cell.value = '';
|
|
130260
|
+
}
|
|
130095
130261
|
}
|
|
130096
|
-
else {
|
|
130262
|
+
else if(cell.value == 'NUMBERING') {
|
|
130097
130263
|
cell.value = '';
|
|
130098
130264
|
}
|
|
130099
|
-
}
|
|
130100
|
-
else if(cell.value == 'NUMBERING') {
|
|
130101
|
-
cell.value = '';
|
|
130102
|
-
}
|
|
130265
|
+
});
|
|
130103
130266
|
});
|
|
130104
|
-
});
|
|
130105
130267
|
|
|
130106
|
-
|
|
130107
|
-
|
|
130108
|
-
|
|
130109
|
-
|
|
130268
|
+
// copy the original data
|
|
130269
|
+
let colNum = ig2width[igType]; // some extra columns
|
|
130270
|
+
for(let i = 1; i <= colNum; ++i) {
|
|
130271
|
+
const sourceCol = worksheet.getColumn(i);
|
|
130110
130272
|
|
|
130111
|
-
|
|
130112
|
-
|
|
130113
|
-
|
|
130114
|
-
|
|
130115
|
-
|
|
130116
|
-
|
|
130117
|
-
|
|
130273
|
+
// Copy values and styles
|
|
130274
|
+
sourceCol.eachCell({ includeEmpty: true }, (cell, rowNumber) => {
|
|
130275
|
+
const targetCell = newSheet.getRow(rowNumber).getCell(colNum + 2 + i);
|
|
130276
|
+
|
|
130277
|
+
targetCell.value = cell.value;
|
|
130278
|
+
targetCell.style = cell.style; // Copies font, borders, and fills
|
|
130279
|
+
});
|
|
130118
130280
|
|
|
130119
|
-
|
|
130120
|
-
|
|
130281
|
+
// reset width for each column
|
|
130282
|
+
newSheet.getColumn(colNum + 2 + i).width = worksheet.getColumn(i).width;
|
|
130283
|
+
}
|
|
130121
130284
|
}
|
|
130122
130285
|
}
|
|
130123
|
-
}
|
|
130124
130286
|
|
|
130125
|
-
|
|
130126
|
-
|
|
130287
|
+
// Generate the workbook as a Buffer
|
|
130288
|
+
const data = await mainWorkbook.xlsx.writeBuffer();
|
|
130127
130289
|
|
|
130128
|
-
|
|
130129
|
-
|
|
130290
|
+
// Access the underlying ArrayBuffer
|
|
130291
|
+
ic.saveFileCls.saveFile(ic.inputid + '_ig_diagram.xlsx', 'xlsx', data);
|
|
130292
|
+
}
|
|
130293
|
+
else { // show interactive SVG
|
|
130294
|
+
// generate a dropdown menu
|
|
130295
|
+
let menuHtml = '';
|
|
130296
|
+
for(let i = 0, il = igArray.length; i < il; ++i) {
|
|
130297
|
+
igArray[i].domainid;
|
|
130298
|
+
let igType = igTypeArray[i];
|
|
130299
|
+
|
|
130300
|
+
let selStr = (i == 0) ? ' selected' : '';
|
|
130301
|
+
menuHtml += "<option value='" + i + '_' + igType + "' " + selStr + ">" + (i+1) + ". " + igType + "</option>";
|
|
130302
|
+
}
|
|
130303
|
+
$("#" + me.pre + "iglist").html(menuHtml);
|
|
130304
|
+
|
|
130305
|
+
await this.show2DdgmForIg(0, igTypeArray[0]); // default
|
|
130306
|
+
|
|
130307
|
+
$("#" + me.pre + "iglist").resizable();
|
|
130308
|
+
}
|
|
130130
130309
|
|
|
130131
130310
|
ic.drawCls.draw();
|
|
130132
130311
|
}
|
|
130312
|
+
|
|
130313
|
+
async show2DdgmForIg(igIndex, igType) { let ic = this.icn3d, me = ic.icn3dui;
|
|
130314
|
+
if(!(igType == 'IgV' || igType == 'IgC1' || igType == 'IgC2' || igType == 'IgI' || igType == 'IgFN3')) {
|
|
130315
|
+
var aaa = 1; //alert("This Ig type " + igType + "has no 2D template yet...");
|
|
130316
|
+
return '';
|
|
130317
|
+
}
|
|
130318
|
+
else {
|
|
130319
|
+
let url = "/Structure/icn3d/template/igstrand_template_" + igType + ".svg";
|
|
130320
|
+
let svgHtml = await me.getAjaxPromise(url, 'text');
|
|
130321
|
+
|
|
130322
|
+
let igArray = ic.chain2igArray[ic.ig2ddgm_chainid];
|
|
130323
|
+
let domainid = igArray[igIndex].domainid;
|
|
130324
|
+
|
|
130325
|
+
// loop through all text node
|
|
130326
|
+
let lineArray = svgHtml.split('\n');
|
|
130327
|
+
|
|
130328
|
+
let html = '';
|
|
130329
|
+
for(let i = 0, il = lineArray.length; i < il; ++i) {
|
|
130330
|
+
let line = lineArray[i];
|
|
130331
|
+
if(line.indexOf('<text ') == 0) { // <text x="502.1" y="301.8" class="s9 c8547"><title>Ref. Num. 8547</title> 8547 </text>
|
|
130332
|
+
let pos = line.indexOf('</title> ');
|
|
130333
|
+
let refnumStr = line.substr(pos + 9).split(' ')[0];
|
|
130334
|
+
let refnum = parseInt(refnumStr);
|
|
130335
|
+
|
|
130336
|
+
if(!isNaN(refnumStr) && refnum > 1000 && refnum < 10000) {
|
|
130337
|
+
if(ic.refnum2resn[domainid].hasOwnProperty(refnumStr)) {
|
|
130338
|
+
let resn = ic.refnum2resn[domainid][refnumStr];
|
|
130339
|
+
let pos2 = line.indexOf('class=');
|
|
130340
|
+
html += line.substr(0, pos2) + 'class="node ' + line.substr(pos2 + 7, pos - (pos2 + 7)) + '</title> ' + resn + ' </text>';
|
|
130341
|
+
}
|
|
130342
|
+
else {
|
|
130343
|
+
html += line.substr(0, pos) + '</title> </text>';
|
|
130344
|
+
}
|
|
130345
|
+
}
|
|
130346
|
+
else {
|
|
130347
|
+
html += line + '\n';
|
|
130348
|
+
}
|
|
130349
|
+
}
|
|
130350
|
+
else {
|
|
130351
|
+
html += line + '\n';
|
|
130352
|
+
}
|
|
130353
|
+
}
|
|
130354
|
+
|
|
130355
|
+
$("#" + me.pre + "ig2ddgmDiv").html(html);
|
|
130356
|
+
|
|
130357
|
+
me.htmlCls.dialogCls.openDlg('dl_ig2ddgm', 'Show 2D diagram for Ig ' + (igIndex + 1) + '.' + igType + ' in ' + ic.ig2ddgm_chainid);
|
|
130358
|
+
}
|
|
130359
|
+
}
|
|
130133
130360
|
}
|
|
130134
130361
|
|
|
130135
130362
|
/**
|
|
@@ -136411,7 +136638,7 @@ class iCn3DUI {
|
|
|
136411
136638
|
//even when multiple iCn3D viewers are shown together.
|
|
136412
136639
|
this.pre = this.cfg.divid + "_";
|
|
136413
136640
|
|
|
136414
|
-
this.REVISION = '3.
|
|
136641
|
+
this.REVISION = '3.51.0';
|
|
136415
136642
|
|
|
136416
136643
|
// In nodejs, iCn3D defines "window = {navigator: {}}", and added window = {navigator: {}, "__THREE__":"177"}
|
|
136417
136644
|
this.bNode = (Object.keys(window).length < 3) ? true : false;
|