icn3d 3.33.2 → 3.34.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 +763 -103
- package/icn3d.min.js +3 -3
- package/icn3d.module.js +763 -103
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -14089,6 +14089,7 @@ class Dialog {
|
|
|
14089
14089
|
let bGraph = $('#' + me.pre + 'dl_graph').hasClass('ui-dialog-content'); // initialized
|
|
14090
14090
|
let bLineGraph = $('#' + me.pre + 'dl_linegraph').hasClass('ui-dialog-content'); // initialized
|
|
14091
14091
|
let bScatterplot = $('#' + me.pre + 'dl_scatterplot').hasClass('ui-dialog-content'); // initialized
|
|
14092
|
+
let bLigplot = $('#' + me.pre + 'dl_ligplot').hasClass('ui-dialog-content'); // initialized
|
|
14092
14093
|
let bContactmap = $('#' + me.pre + 'dl_contactmap').hasClass('ui-dialog-content'); // initialized
|
|
14093
14094
|
let bAlignerrormap = $('#' + me.pre + 'dl_alignerrormap').hasClass('ui-dialog-content'); // initialized
|
|
14094
14095
|
let bTable = $('#' + me.pre + 'dl_interactionsorted').hasClass('ui-dialog-content'); // initialized
|
|
@@ -14098,13 +14099,14 @@ class Dialog {
|
|
|
14098
14099
|
let bSetsInit = $('#' + me.pre + 'dl_definedsets').hasClass('ui-dialog-content'); // initialized
|
|
14099
14100
|
|
|
14100
14101
|
status.bSelectannotationsInit2 = false, status.bGraph2 = false, status.bLineGraph2 = false;
|
|
14101
|
-
status.bScatterplot2 = false, status.bTable2 = false, status.bAlignmentInit2 = false;
|
|
14102
|
+
status.bScatterplot2 = false, status.bLigplot2 = false, status.bTable2 = false, status.bAlignmentInit2 = false;
|
|
14102
14103
|
status.bTwoddgmInit2 = false, status.bTwodctnInit2 = false, status.bSetsInit2 = false;
|
|
14103
14104
|
|
|
14104
14105
|
id2flag.dl_selectannotations = 'bSelectannotationsInit2';
|
|
14105
14106
|
id2flag.dl_graph = 'bGraph2';
|
|
14106
14107
|
id2flag.dl_linegraph = 'bLineGraph2';
|
|
14107
|
-
id2flag.dl_scatterplot = 'bScatterplot2';
|
|
14108
|
+
id2flag.dl_scatterplot = 'bScatterplot2';
|
|
14109
|
+
id2flag.dl_ligplot = 'bLigplot2';
|
|
14108
14110
|
id2flag.dl_contactmap = 'bContactmap2';
|
|
14109
14111
|
id2flag.dl_alignerrormap = 'bAlignerrormap2';
|
|
14110
14112
|
id2flag.dl_interactionsorted = 'bTable2';
|
|
@@ -14117,6 +14119,7 @@ class Dialog {
|
|
|
14117
14119
|
if(bGraph) status.bGraph2 = $('#' + me.pre + 'dl_graph').dialog( 'isOpen' );
|
|
14118
14120
|
if(bLineGraph) status.bLineGraph2 = $('#' + me.pre + 'dl_linegraph').dialog( 'isOpen' );
|
|
14119
14121
|
if(bScatterplot) status.bScatterplot2 = $('#' + me.pre + 'dl_scatterplot').dialog( 'isOpen' );
|
|
14122
|
+
if(bLigplot) status.bLigplot2 = $('#' + me.pre + 'dl_ligplot').dialog( 'isOpen' );
|
|
14120
14123
|
if(bContactmap) status.bContactmap2 = $('#' + me.pre + 'dl_contactmap').dialog( 'isOpen' );
|
|
14121
14124
|
if(bAlignerrormap) status.bAlignerror2 = $('#' + me.pre + 'dl_alignerrormap').dialog( 'isOpen' );
|
|
14122
14125
|
if(bTable) status.bTable2 = $('#' + me.pre + 'dl_interactionsorted').dialog( 'isOpen' );
|
|
@@ -14203,7 +14206,7 @@ class Dialog {
|
|
|
14203
14206
|
|
|
14204
14207
|
d3.select("#" + me.svgid).attr("width", width).attr("height", height);
|
|
14205
14208
|
}
|
|
14206
|
-
else if(id == me.pre + 'dl_linegraph' || id == me.pre + 'dl_scatterplot' || id == me.pre + 'dl_contactmap' || id == me.pre + 'dl_alignerrormap') {
|
|
14209
|
+
else if(id == me.pre + 'dl_linegraph' || id == me.pre + 'dl_scatterplot' || id == me.pre + 'dl_ligplot' || id == me.pre + 'dl_contactmap' || id == me.pre + 'dl_alignerrormap') {
|
|
14207
14210
|
let oriWidth =(status.bTwoddgmInit2 || status.bSetsInit2) ?(me.htmlCls.WIDTH - twoddgmWidth)/2 : me.htmlCls.WIDTH / 2;
|
|
14208
14211
|
let ratio = $("#" + id).width() / oriWidth;
|
|
14209
14212
|
|
|
@@ -14215,6 +14218,14 @@ class Dialog {
|
|
|
14215
14218
|
let width = ic.scatterplotWidth * ratio;
|
|
14216
14219
|
$("#" + me.scatterplotid).attr("width", width);
|
|
14217
14220
|
}
|
|
14221
|
+
else if(id == me.pre + 'dl_ligplot') {
|
|
14222
|
+
let width = ic.ligplotWidth * ratio;
|
|
14223
|
+
$("#" + me.ligplotid).attr("width", width);
|
|
14224
|
+
}
|
|
14225
|
+
else if(id == me.pre + 'dl_ligplot') {
|
|
14226
|
+
let width = ic.ligplotWidth * ratio;
|
|
14227
|
+
$("#" + me.ligplotid).attr("width", width);
|
|
14228
|
+
}
|
|
14218
14229
|
else if(id == me.pre + 'dl_contactmap') {
|
|
14219
14230
|
let width = ic.contactmapWidth * ratio;
|
|
14220
14231
|
$("#" + me.contactmapid).attr("width", width);
|
|
@@ -14268,7 +14279,7 @@ class Dialog {
|
|
|
14268
14279
|
close: function(e) {
|
|
14269
14280
|
let status = thisClass.getDialogStatus().status;
|
|
14270
14281
|
|
|
14271
|
-
if((!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bTable2) &&(!status.bAlignmentInit2) ) {
|
|
14282
|
+
if((!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bTable2) &&(!status.bAlignmentInit2) ) {
|
|
14272
14283
|
//ic.resizeCanvasCls.resizeCanvas(me.htmlCls.WIDTH - me.htmlCls.LESSWIDTH, me.htmlCls.HEIGHT - me.htmlCls.LESSHEIGHT - me.htmlCls.EXTRAHEIGHT, true);
|
|
14273
14284
|
ic.resizeCanvasCls.resizeCanvas(me.htmlCls.WIDTH, me.htmlCls.HEIGHT, true);
|
|
14274
14285
|
}
|
|
@@ -14297,7 +14308,7 @@ class Dialog {
|
|
|
14297
14308
|
|
|
14298
14309
|
let status = this.getDialogStatus().status;
|
|
14299
14310
|
|
|
14300
|
-
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_contactmap' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
|
|
14311
|
+
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_ligplot' || id === me.pre + 'dl_contactmap' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
|
|
14301
14312
|
//var dialogWidth = 0.5 *(me.htmlCls.WIDTH - me.htmlCls.LESSWIDTH) - twoddgmWidth * 0.5;
|
|
14302
14313
|
let dialogWidth = 0.5 *(me.htmlCls.WIDTH) - twoddgmWidth * 0.5;
|
|
14303
14314
|
|
|
@@ -14333,14 +14344,15 @@ class Dialog {
|
|
|
14333
14344
|
modal: false,
|
|
14334
14345
|
position: position,
|
|
14335
14346
|
close: function(e) {
|
|
14336
|
-
if((id === me.pre + 'dl_selectannotations' &&(!status.bAlignmentInit2) &&(!status.bGraph2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14337
|
-
||(id === me.pre + 'dl_graph' &&(!status.bSelectannotationsInit2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14338
|
-
||(id === me.pre + 'dl_alignment' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14339
|
-
||(id === me.pre + 'dl_interactionsorted' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14340
|
-
||(id === me.pre + 'dl_linegraph' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bScatterplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14341
|
-
||(id === me.pre + 'dl_scatterplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14342
|
-
||(id === me.pre + '
|
|
14343
|
-
||(id === me.pre + '
|
|
14347
|
+
if((id === me.pre + 'dl_selectannotations' &&(!status.bAlignmentInit2) &&(!status.bGraph2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14348
|
+
||(id === me.pre + 'dl_graph' &&(!status.bSelectannotationsInit2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14349
|
+
||(id === me.pre + 'dl_alignment' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14350
|
+
||(id === me.pre + 'dl_interactionsorted' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14351
|
+
||(id === me.pre + 'dl_linegraph' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14352
|
+
||(id === me.pre + 'dl_scatterplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14353
|
+
||(id === me.pre + 'dl_ligplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
|
|
14354
|
+
||(id === me.pre + 'dl_contactmap' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bAlignerrormap2))
|
|
14355
|
+
||(id === me.pre + 'dl_alignerrormap' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2))
|
|
14344
14356
|
) {
|
|
14345
14357
|
if(status.bTwoddgmInit2 || status.bTwodctnInit2 || status.bSetsInit2) {
|
|
14346
14358
|
let canvasWidth = me.utilsCls.isMobile() ? me.htmlCls.WIDTH : me.htmlCls.WIDTH - twoddgmWidth;
|
|
@@ -14366,7 +14378,7 @@ class Dialog {
|
|
|
14366
14378
|
|
|
14367
14379
|
d3.select("#" + me.svgid).attr("width", width).attr("height", height);
|
|
14368
14380
|
}
|
|
14369
|
-
else if(id == me.pre + 'dl_linegraph' || id == me.pre + 'dl_scatterplot' || id == me.pre + 'dl_contactmap' || id == me.pre + 'dl_alignerrormap') {
|
|
14381
|
+
else if(id == me.pre + 'dl_linegraph' || id == me.pre + 'dl_scatterplot' || id == me.pre + 'dl_ligplot' || id == me.pre + 'dl_contactmap' || id == me.pre + 'dl_alignerrormap') {
|
|
14370
14382
|
let oriWidth =(status.bTwoddgmInit2 || status.bSetsInit2) ?(me.htmlCls.WIDTH - twoddgmWidth)/2 : me.htmlCls.WIDTH / 2;
|
|
14371
14383
|
let ratio = $("#" + id).width() / oriWidth;
|
|
14372
14384
|
|
|
@@ -14378,6 +14390,10 @@ class Dialog {
|
|
|
14378
14390
|
let width = ic.scatterplotWidth * ratio;
|
|
14379
14391
|
$("#" + me.scatterplotid).attr("width", width);
|
|
14380
14392
|
}
|
|
14393
|
+
else if(id == me.pre + 'dl_ligplot') {
|
|
14394
|
+
let width = ic.ligplotWidth * ratio;
|
|
14395
|
+
$("#" + me.ligplotid).attr("width", width);
|
|
14396
|
+
}
|
|
14381
14397
|
else if(id == me.pre + 'dl_contactmap') {
|
|
14382
14398
|
let width = ic.contactmapWidth * ratio;
|
|
14383
14399
|
$("#" + me.contactmapid).attr("width", width);
|
|
@@ -14399,7 +14415,7 @@ class Dialog {
|
|
|
14399
14415
|
|
|
14400
14416
|
//if(me.htmlCls.WIDTH - me.htmlCls.LESSWIDTH >= me.htmlCls.HEIGHT - me.htmlCls.LESSHEIGHT - me.htmlCls.EXTRAHEIGHT) {
|
|
14401
14417
|
if(me.htmlCls.WIDTH >= me.htmlCls.HEIGHT) {
|
|
14402
|
-
if(status.bSelectannotationsInit2 || status.bGraph2 || status.bLineGraph2 || status.bScatterplot2 || status.bTable2 || status.bAlignmentInit2) {
|
|
14418
|
+
if(status.bSelectannotationsInit2 || status.bGraph2 || status.bLineGraph2 || status.bScatterplot2 || status.bLigplot2 || status.bTable2 || status.bAlignmentInit2) {
|
|
14403
14419
|
//tmpWidth = 0.5 *(me.htmlCls.WIDTH - me.htmlCls.LESSWIDTH) - twoddgmWidth * 0.5;
|
|
14404
14420
|
tmpWidth = 0.5 *(me.htmlCls.WIDTH) - twoddgmWidth * 0.5;
|
|
14405
14421
|
}
|
|
@@ -14438,7 +14454,7 @@ class Dialog {
|
|
|
14438
14454
|
|
|
14439
14455
|
//if(me.htmlCls.WIDTH - me.htmlCls.LESSWIDTH >= me.htmlCls.HEIGHT - me.htmlCls.LESSHEIGHT - me.htmlCls.EXTRAHEIGHT) {
|
|
14440
14456
|
if(me.htmlCls.WIDTH >= me.htmlCls.HEIGHT) {
|
|
14441
|
-
if(status.bSelectannotationsInit2 || status.bGraph2 || status.bLineGraph2 || status.bScatterplot2 || status.bTable2 || status.bAlignmentInit2) {
|
|
14457
|
+
if(status.bSelectannotationsInit2 || status.bGraph2 || status.bLineGraph2 || status.bScatterplot2 || status.bLigplot2 || status.bTable2 || status.bAlignmentInit2) {
|
|
14442
14458
|
//tmpWidth = 0.5 *(me.htmlCls.WIDTH - me.htmlCls.LESSWIDTH) - twoddgmWidth * 0.5;
|
|
14443
14459
|
tmpWidth = 0.5 *(me.htmlCls.WIDTH) - twoddgmWidth * 0.5;
|
|
14444
14460
|
}
|
|
@@ -14518,7 +14534,7 @@ class Dialog {
|
|
|
14518
14534
|
let width = 400, height = 150;
|
|
14519
14535
|
let twoddgmWidth = me.htmlCls.width2d + 20;
|
|
14520
14536
|
|
|
14521
|
-
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_contactmap' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
|
|
14537
|
+
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_ligplot' || id === me.pre + 'dl_contactmap' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
|
|
14522
14538
|
$( "#" + id ).show();
|
|
14523
14539
|
$( "#" + id + "_nb").show();
|
|
14524
14540
|
$( "#" + id + "_title").html(title);
|
|
@@ -14553,6 +14569,11 @@ class Dialog {
|
|
|
14553
14569
|
|
|
14554
14570
|
$("#" + me.scatterplotid).attr("width", width);
|
|
14555
14571
|
}
|
|
14572
|
+
else if(id == me.pre + 'dl_ligplot') {
|
|
14573
|
+
let width = ic.ligplotWidth * ratio;
|
|
14574
|
+
|
|
14575
|
+
$("#" + me.ligplotid).attr("width", width);
|
|
14576
|
+
}
|
|
14556
14577
|
else if(id == me.pre + 'dl_contactmap') {
|
|
14557
14578
|
let width = ic.contactmapWidth * ratio;
|
|
14558
14579
|
|
|
@@ -15251,6 +15272,8 @@ class SetDialog {
|
|
|
15251
15272
|
|
|
15252
15273
|
html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondScatterplot'>2D Interaction Map</button> " + me.htmlCls.buttonStr + "hbondScatterplot2' style='margin-left:12px'>2D Map with Reference Numbers</button> to show map</div><br>";
|
|
15253
15274
|
|
|
15275
|
+
html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondLigplot'>2D Interaction for One Ligand/Residue</button> with atom details</div><br>";
|
|
15276
|
+
|
|
15254
15277
|
tmpStr = ': </td><td><input style="margin-left:-12px" type="text" id="';
|
|
15255
15278
|
|
|
15256
15279
|
html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondGraph'>2D Graph(Force-Directed)</button> to show interactions with strength parameters in 0-200:</div>";
|
|
@@ -15417,6 +15440,40 @@ class SetDialog {
|
|
|
15417
15440
|
|
|
15418
15441
|
html += "</div>";
|
|
15419
15442
|
|
|
15443
|
+
|
|
15444
|
+
html += me.htmlCls.divStr + "dl_ligplot' sty2D Interaction for One Ligand/Residule='background-color:white' class='" + dialogClass + "'>";
|
|
15445
|
+
html += this.addNotebookTitle('dl_ligplot', 'e with Atom Details');
|
|
15446
|
+
|
|
15447
|
+
html += me.htmlCls.divNowrapStr + "<b>Note</b>: Nodes can be dragged or clicked. Hold Ctrl key to select multiple nodes. " + me.htmlCls.space3;
|
|
15448
|
+
|
|
15449
|
+
html += '<div style="width:20px; margin-top:6px; display:inline-block;"><span id="'
|
|
15450
|
+
+ me.pre + 'dl_ligplotcolor_expand" class="ui-icon ui-icon-plus icn3d-expand icn3d-link" style="display:none; width:15px;" title="Expand"></span><span id="'
|
|
15451
|
+
+ me.pre + 'dl_ligplotcolor_shrink" class="ui-icon ui-icon-minus icn3d-shrink icn3d-link" style="width:15px;" title="Shrink"></span></div></div>';
|
|
15452
|
+
|
|
15453
|
+
html += me.htmlCls.divStr + "dl_ligplotcolor' style='inline-block;'>";
|
|
15454
|
+
|
|
15455
|
+
// html += "The real interaction distances are not in scale, and are about twice the distances of dashed line segments.<br>Some \"Contact\" lines are only shown partially to simplify the view.<br>";
|
|
15456
|
+
html += "<b>Color Legend</b>: <br>";
|
|
15457
|
+
|
|
15458
|
+
html += me.htmlCls.setHtmlCls.setColorHints();
|
|
15459
|
+
|
|
15460
|
+
html += "<br></div>";
|
|
15461
|
+
|
|
15462
|
+
me.ligplotid = me.pre + 'ligplot';
|
|
15463
|
+
html += me.htmlCls.divNowrapStr + buttonStrTmp + me.ligplotid + '_svg">SVG</button>' + me.htmlCls.space2;
|
|
15464
|
+
html += buttonStrTmp + me.ligplotid + '_png">PNG</button>' + me.htmlCls.space2;
|
|
15465
|
+
// html += buttonStrTmp + me.ligplotid + '_json">JSON</button>' + me.htmlCls.space4;
|
|
15466
|
+
html += "<b>Scale</b>: <select id='" + me.ligplotid + "_scale'>";
|
|
15467
|
+
|
|
15468
|
+
html += me.htmlCls.setHtmlCls.getOptionHtml(optArray4, 5);
|
|
15469
|
+
|
|
15470
|
+
html += "</select></div><br>";
|
|
15471
|
+
html += '<div id="' + me.pre + 'ligplotDiv"></div>';
|
|
15472
|
+
|
|
15473
|
+
html += "</div>";
|
|
15474
|
+
|
|
15475
|
+
|
|
15476
|
+
|
|
15420
15477
|
html += me.htmlCls.divStr + "dl_contactmap' style='background-color:white' class='" + dialogClass + "'>";
|
|
15421
15478
|
html += this.addNotebookTitle('dl_contactmap', 'Contact Map');
|
|
15422
15479
|
|
|
@@ -16471,6 +16528,7 @@ class Events {
|
|
|
16471
16528
|
|
|
16472
16529
|
ic.diagram2dCls.click2Ddgm();
|
|
16473
16530
|
ic.cartoon2dCls.click2Dcartoon();
|
|
16531
|
+
ic.ligplotCls.clickLigplot();
|
|
16474
16532
|
ic.addTrackCls.clickAddTrackButton();
|
|
16475
16533
|
ic.resizeCanvasCls.windowResize();
|
|
16476
16534
|
ic.annotationCls.setTabs();
|
|
@@ -18092,6 +18150,13 @@ class Events {
|
|
|
18092
18150
|
thisClass.setLogCmd("show ref number", true);
|
|
18093
18151
|
await ic.showInterCls.showInteractions('scatterplot');
|
|
18094
18152
|
});
|
|
18153
|
+
me.myEventCls.onIds("#" + me.pre + "hbondLigplot", "click", async function(e) { let ic = me.icn3d;
|
|
18154
|
+
e.preventDefault();
|
|
18155
|
+
|
|
18156
|
+
ic.bShownRefnum = false;
|
|
18157
|
+
thisClass.setLogCmd("hide ref number", true);
|
|
18158
|
+
await ic.showInterCls.showInteractions('ligplot');
|
|
18159
|
+
});
|
|
18095
18160
|
// select residues
|
|
18096
18161
|
$(document).on("click", "#" + me.svgid + " circle.selected", function(e) { let ic = me.icn3d;
|
|
18097
18162
|
e.stopImmediatePropagation();
|
|
@@ -18202,6 +18267,33 @@ class Events {
|
|
|
18202
18267
|
thisClass.setLogCmd("scatterplot scale " + scale, true);
|
|
18203
18268
|
});
|
|
18204
18269
|
|
|
18270
|
+
me.myEventCls.onIds("#" + me.ligplotid + "_svg", "click", function(e) { let ic = me.icn3d;
|
|
18271
|
+
e.preventDefault();
|
|
18272
|
+
|
|
18273
|
+
ic.saveFileCls.saveSvg(me.ligplotid, ic.inputid + "_ligplot.svg", undefined, true);
|
|
18274
|
+
});
|
|
18275
|
+
me.myEventCls.onIds("#" + me.ligplotid + "_png", "click", function(e) { let ic = me.icn3d;
|
|
18276
|
+
e.preventDefault();
|
|
18277
|
+
|
|
18278
|
+
ic.saveFileCls.savePng(me.ligplotid, ic.inputid + "_ligplot.png", undefined, true);
|
|
18279
|
+
});
|
|
18280
|
+
// me.myEventCls.onIds("#" + me.ligplotid + "_json", "click", function(e) { let ic = me.icn3d;
|
|
18281
|
+
// e.preventDefault();
|
|
18282
|
+
|
|
18283
|
+
// let graphStr2 = ic.ligplotStr.substr(0, ic.ligplotStr.lastIndexOf('}'));
|
|
18284
|
+
|
|
18285
|
+
// graphStr2 += me.htmlCls.setHtmlCls.getLinkColor();
|
|
18286
|
+
|
|
18287
|
+
// ic.saveFileCls.saveFile(ic.inputid + "_ligplot.json", "text", [graphStr2]);
|
|
18288
|
+
// });
|
|
18289
|
+
me.myEventCls.onIds("#" + me.ligplotid + "_scale", "change", function(e) { let ic = me.icn3d;
|
|
18290
|
+
e.preventDefault();
|
|
18291
|
+
|
|
18292
|
+
let scale = $("#" + me.ligplotid + "_scale").val();
|
|
18293
|
+
$("#" + me.ligplotid).attr("width",(ic.ligplotWidth * parseFloat(scale)).toString() + "px");
|
|
18294
|
+
thisClass.setLogCmd("ligplot scale " + scale, true);
|
|
18295
|
+
});
|
|
18296
|
+
|
|
18205
18297
|
me.myEventCls.onIds("#" + me.contactmapid + "_svg", "click", function(e) { let ic = me.icn3d;
|
|
18206
18298
|
e.preventDefault();
|
|
18207
18299
|
|
|
@@ -37659,7 +37751,8 @@ class Contact {
|
|
|
37659
37751
|
if(oriCalpha === undefined) oriCalpha = oriAtom;
|
|
37660
37752
|
|
|
37661
37753
|
if(bGetPairs) {
|
|
37662
|
-
|
|
37754
|
+
let serialList = (oriAtom.name.indexOf('pi') == 0 && oriAtom.ring) ? oriAtom.ring.join(',') : oriAtom.serial;
|
|
37755
|
+
oriResidName = oriAtom.resn + ' $' + oriAtom.structure + '.' + oriAtom.chain + ':' + oriAtom.resi + ' ' + serialList;
|
|
37663
37756
|
if(ic.resid2Residhash[oriResidName] === undefined) ic.resid2Residhash[oriResidName] = {};
|
|
37664
37757
|
}
|
|
37665
37758
|
|
|
@@ -37704,13 +37797,14 @@ class Contact {
|
|
|
37704
37797
|
if(bGetPairs) {
|
|
37705
37798
|
let chain_resi2 = atom.structure + '_' + atom.chain + '_' + atom.resi;
|
|
37706
37799
|
|
|
37707
|
-
|
|
37800
|
+
let serialList = (atom.name.indexOf('pi') == 0 && atom.ring) ? atom.ring.join(',') : atom.serial;
|
|
37801
|
+
residName = atom.resn + ' $' + atom.structure + '.' + atom.chain + ':' + atom.resi + ' ' + serialList;
|
|
37708
37802
|
//var dist = Math.sqrt(atomDistSq).toFixed(1);
|
|
37709
37803
|
let dist1 = atomDist.toFixed(1);
|
|
37710
37804
|
let dist2 = calpha.coord.distanceTo(oriCalpha.coord).toFixed(1);
|
|
37711
37805
|
|
|
37712
37806
|
let resids = chain_resi + '_' + oriAtom.resn + ',' + chain_resi2 + '_' + atom.resn;
|
|
37713
|
-
let residNames = oriResidName + '
|
|
37807
|
+
let residNames = oriResidName + '|' + residName;
|
|
37714
37808
|
if(ic.resids2interAll[resids] === undefined
|
|
37715
37809
|
|| ic.resids2interAll[resids]['contact'] === undefined
|
|
37716
37810
|
|| !ic.resids2interAll[resids]['contact'].hasOwnProperty(residNames)
|
|
@@ -37727,12 +37821,12 @@ class Contact {
|
|
|
37727
37821
|
if(!bInternal) {
|
|
37728
37822
|
if(ic.resids2inter[resids] === undefined) ic.resids2inter[resids] = {};
|
|
37729
37823
|
if(ic.resids2inter[resids]['contact'] === undefined) ic.resids2inter[resids]['contact'] = {};
|
|
37730
|
-
ic.resids2inter[resids]['contact'][oriResidName + '
|
|
37824
|
+
ic.resids2inter[resids]['contact'][oriResidName + '|' + residName] = dist1 + '_' + dist2 + '_' + oriAtom.name + '_' + atom.name + '_' + cnt;
|
|
37731
37825
|
}
|
|
37732
37826
|
|
|
37733
37827
|
if(ic.resids2interAll[resids] === undefined) ic.resids2interAll[resids] = {};
|
|
37734
37828
|
if(ic.resids2interAll[resids]['contact'] === undefined) ic.resids2interAll[resids]['contact'] = {};
|
|
37735
|
-
ic.resids2interAll[resids]['contact'][oriResidName + '
|
|
37829
|
+
ic.resids2interAll[resids]['contact'][oriResidName + '|' + residName] = dist1 + '_' + dist2 + '_' + oriAtom.name + '_' + atom.name + '_' + cnt;
|
|
37736
37830
|
}
|
|
37737
37831
|
}
|
|
37738
37832
|
} // if(bGetPairs) {
|
|
@@ -38158,7 +38252,8 @@ class HBond {
|
|
|
38158
38252
|
chain_resi_atom = chain_resi + "_" + atom.name;
|
|
38159
38253
|
|
|
38160
38254
|
//var oriResidName = atom.resn + ' ' + chain_resi_atom;
|
|
38161
|
-
let
|
|
38255
|
+
let serialList = (atom.name.indexOf('pi') == 0 && atom.ring) ? atom.ring.join(',') : atom.serial;
|
|
38256
|
+
let oriResidName = atom.resn + ' $' + atom.structure + '.' + atom.chain + ':' + atom.resi + '@' + atom.name + ' ' + serialList;
|
|
38162
38257
|
if(ic.resid2Residhash[oriResidName] === undefined) ic.resid2Residhash[oriResidName] = {};
|
|
38163
38258
|
|
|
38164
38259
|
for (let j in atomHbond) {
|
|
@@ -38283,24 +38378,25 @@ class HBond {
|
|
|
38283
38378
|
residueHash[chain_resi2] = 1;
|
|
38284
38379
|
|
|
38285
38380
|
//var residName = atomHbond[j].resn + " " + atomHbond[j].structure + "_" + atomHbond[j].chain + "_" + atomHbond[j].resi + '_' + atomHbond[j].name;
|
|
38286
|
-
let
|
|
38381
|
+
let serialList = (atomHbond[j].name.indexOf('pi') == 0 && atomHbond[j].ring) ? atomHbond[j].ring.join(',') : atomHbond[j].serial;
|
|
38382
|
+
let residName = atomHbond[j].resn + ' $' + atomHbond[j].structure + '.' + atomHbond[j].chain + ':' + atomHbond[j].resi + '@' + atomHbond[j].name + ' ' + serialList;
|
|
38287
38383
|
|
|
38288
38384
|
let resids = chain_resi + '_' + atom.resn + ',' + chain_resi2 + '_' + atomHbond[j].resn;
|
|
38289
38385
|
|
|
38290
38386
|
if(ic.resids2interAll[resids] === undefined
|
|
38291
38387
|
|| ic.resids2interAll[resids]['ionic'] === undefined
|
|
38292
|
-
|| !ic.resids2interAll[resids]['ionic'].hasOwnProperty(oriResidName + '
|
|
38388
|
+
|| !ic.resids2interAll[resids]['ionic'].hasOwnProperty(oriResidName + '|' + residName) ) {
|
|
38293
38389
|
ic.resid2Residhash[oriResidName][residName] = dist.toFixed(1);
|
|
38294
38390
|
|
|
38295
38391
|
if(!bInternal) {
|
|
38296
38392
|
if(ic.resids2inter[resids] === undefined) ic.resids2inter[resids] = {};
|
|
38297
38393
|
if(ic.resids2inter[resids]['hbond'] === undefined) ic.resids2inter[resids]['hbond'] = {};
|
|
38298
|
-
ic.resids2inter[resids]['hbond'][oriResidName + '
|
|
38394
|
+
ic.resids2inter[resids]['hbond'][oriResidName + '|' + residName] = dist.toFixed(1);
|
|
38299
38395
|
}
|
|
38300
38396
|
|
|
38301
38397
|
if(ic.resids2interAll[resids] === undefined) ic.resids2interAll[resids] = {};
|
|
38302
38398
|
if(ic.resids2interAll[resids]['hbond'] === undefined) ic.resids2interAll[resids]['hbond'] = {};
|
|
38303
|
-
ic.resids2interAll[resids]['hbond'][oriResidName + '
|
|
38399
|
+
ic.resids2interAll[resids]['hbond'][oriResidName + '|' + residName] = dist.toFixed(1);
|
|
38304
38400
|
}
|
|
38305
38401
|
} // end of for (let j in atomHbond) {
|
|
38306
38402
|
}
|
|
@@ -38453,7 +38549,8 @@ class PiHalogen {
|
|
|
38453
38549
|
|
|
38454
38550
|
for (let i in atoms1a) {
|
|
38455
38551
|
let atom1 = atoms1a[i];
|
|
38456
|
-
let
|
|
38552
|
+
let serialList = (atom1.name.indexOf('pi') == 0 && atom1.ring) ? atom1.ring.join(',') : atom1.serial;
|
|
38553
|
+
let oriResidName = atom1.resn + ' $' + atom1.structure + '.' + atom1.chain + ':' + atom1.resi + '@' + atom1.name + ' ' + serialList;
|
|
38457
38554
|
if(ic.resid2Residhash[oriResidName] === undefined) ic.resid2Residhash[oriResidName] = {};
|
|
38458
38555
|
|
|
38459
38556
|
for (let j in atoms1b) {
|
|
@@ -38497,7 +38594,8 @@ class PiHalogen {
|
|
|
38497
38594
|
|
|
38498
38595
|
for (let i in atoms2a) {
|
|
38499
38596
|
let atom1 = atoms2a[i];
|
|
38500
|
-
let
|
|
38597
|
+
let serialList = (atom1.name.indexOf('pi') == 0 && atom1.ring) ? atom1.ring.join(',') : atom1.serial;
|
|
38598
|
+
let oriResidName = atom1.resn + ' $' + atom1.structure + '.' + atom1.chain + ':' + atom1.resi + '@' + atom1.name + ' ' + serialList;
|
|
38501
38599
|
if(ic.resid2Residhash[oriResidName] === undefined) ic.resid2Residhash[oriResidName] = {};
|
|
38502
38600
|
|
|
38503
38601
|
// available in 1b and 2a
|
|
@@ -38662,7 +38760,8 @@ class PiHalogen {
|
|
|
38662
38760
|
}
|
|
38663
38761
|
}
|
|
38664
38762
|
|
|
38665
|
-
let
|
|
38763
|
+
let serialList = (atom2.name.indexOf('pi') == 0 && atom2.ring) ? atom2.ring.join(',') : atom2.serial;
|
|
38764
|
+
let residName = atom2.resn + ' $' + atom2.structure + '.' + atom2.chain + ':' + atom2.resi + '@' + atom2.name + ' ' + serialList;
|
|
38666
38765
|
|
|
38667
38766
|
//if(ic.resid2Residhash[oriResidName][residName] === undefined || ic.resid2Residhash[oriResidName][residName] > dist) {
|
|
38668
38767
|
ic.resid2Residhash[oriResidName][residName] = dist.toFixed(1);
|
|
@@ -38674,12 +38773,12 @@ class PiHalogen {
|
|
|
38674
38773
|
if(!bInternal) {
|
|
38675
38774
|
if(ic.resids2inter[resids] === undefined) ic.resids2inter[resids] = {};
|
|
38676
38775
|
if(ic.resids2inter[resids][interactionType] === undefined) ic.resids2inter[resids][interactionType] = {};
|
|
38677
|
-
ic.resids2inter[resids][interactionType][oriResidName + '
|
|
38776
|
+
ic.resids2inter[resids][interactionType][oriResidName + '|' + residName] = dist.toFixed(1);
|
|
38678
38777
|
}
|
|
38679
38778
|
|
|
38680
38779
|
if(ic.resids2interAll[resids] === undefined) ic.resids2interAll[resids] = {};
|
|
38681
38780
|
if(ic.resids2interAll[resids][interactionType] === undefined) ic.resids2interAll[resids][interactionType] = {};
|
|
38682
|
-
ic.resids2interAll[resids][interactionType][oriResidName + '
|
|
38781
|
+
ic.resids2interAll[resids][interactionType][oriResidName + '|' + residName] = dist.toFixed(1);
|
|
38683
38782
|
|
|
38684
38783
|
return true;
|
|
38685
38784
|
}
|
|
@@ -38926,12 +39025,13 @@ class PiHalogen {
|
|
|
38926
39025
|
// Print the i-th cycle
|
|
38927
39026
|
let coord = new THREE.Vector3();
|
|
38928
39027
|
let cnt = 0, serial;
|
|
38929
|
-
let coordArray = [];
|
|
39028
|
+
let coordArray = [], ringArray = [];
|
|
38930
39029
|
if(cycles.hasOwnProperty(i)) {
|
|
38931
39030
|
for (let j = 0, jl = cycles[i].length; j < jl; ++j) {
|
|
38932
39031
|
serial = cycles[i][j];
|
|
38933
39032
|
coord.add(ic.atoms[serial].coord);
|
|
38934
39033
|
coordArray.push(ic.atoms[serial].coord);
|
|
39034
|
+
ringArray.push(serial);
|
|
38935
39035
|
++cnt;
|
|
38936
39036
|
}
|
|
38937
39037
|
}
|
|
@@ -38951,7 +39051,7 @@ class PiHalogen {
|
|
|
38951
39051
|
|
|
38952
39052
|
let atom = ic.atoms[serial];
|
|
38953
39053
|
name2atom[resid + '_pi' + serial] = {resn: atom.resn, name: 'pi' + serial, coord: coord, serial: atom.serial,
|
|
38954
|
-
structure: atom.structure, chain: atom.chain, resi: atom.resi, normal: normal};
|
|
39054
|
+
structure: atom.structure, chain: atom.chain, resi: atom.resi, normal: normal, ring: ringArray};
|
|
38955
39055
|
}
|
|
38956
39056
|
}
|
|
38957
39057
|
}
|
|
@@ -39049,7 +39149,8 @@ class Saltbridge {
|
|
|
39049
39149
|
chain_resi = atom.structure + "_" + atom.chain + "_" + atom.resi;
|
|
39050
39150
|
chain_resi_atom = chain_resi + "_" + atom.name;
|
|
39051
39151
|
|
|
39052
|
-
let
|
|
39152
|
+
let serialList = (atom.name.indexOf('pi') == 0 && atom.ring) ? atom.ring.join(',') : atom.serial;
|
|
39153
|
+
let oriResidName = atom.resn + ' $' + atom.structure + '.' + atom.chain + ':' + atom.resi + '@' + atom.name + ' ' + serialList;
|
|
39053
39154
|
if(ic.resid2Residhash[oriResidName] === undefined) ic.resid2Residhash[oriResidName] = {};
|
|
39054
39155
|
|
|
39055
39156
|
let atomHbond = {};
|
|
@@ -39114,7 +39215,8 @@ class Saltbridge {
|
|
|
39114
39215
|
residueHash[chain_resi] = 1;
|
|
39115
39216
|
residueHash[chain_resi2] = 1;
|
|
39116
39217
|
|
|
39117
|
-
let
|
|
39218
|
+
let serialList = (atomHbond[j].name.indexOf('pi') == 0 && atomHbond[j].ring) ? atomHbond[j].ring.join(',') : atomHbond[j].serial;
|
|
39219
|
+
let residName = atomHbond[j].resn + ' $' + atomHbond[j].structure + '.' + atomHbond[j].chain + ':' + atomHbond[j].resi + '@' + atomHbond[j].name + ' ' + serialList;
|
|
39118
39220
|
|
|
39119
39221
|
//if(ic.resid2Residhash[oriResidName][residName] === undefined || ic.resid2Residhash[oriResidName][residName] > dist) {
|
|
39120
39222
|
ic.resid2Residhash[oriResidName][residName] = dist.toFixed(1);
|
|
@@ -39125,12 +39227,12 @@ class Saltbridge {
|
|
|
39125
39227
|
if(!bInternal) {
|
|
39126
39228
|
if(ic.resids2inter[resids] === undefined) ic.resids2inter[resids] = {};
|
|
39127
39229
|
if(ic.resids2inter[resids]['ionic'] === undefined) ic.resids2inter[resids]['ionic'] = {};
|
|
39128
|
-
ic.resids2inter[resids]['ionic'][oriResidName + '
|
|
39230
|
+
ic.resids2inter[resids]['ionic'][oriResidName + '|' + residName] = dist.toFixed(1);
|
|
39129
39231
|
}
|
|
39130
39232
|
|
|
39131
39233
|
if(ic.resids2interAll[resids] === undefined) ic.resids2interAll[resids] = {};
|
|
39132
39234
|
if(ic.resids2interAll[resids]['ionic'] === undefined) ic.resids2interAll[resids]['ionic'] = {};
|
|
39133
|
-
ic.resids2interAll[resids]['ionic'][oriResidName + '
|
|
39235
|
+
ic.resids2interAll[resids]['ionic'][oriResidName + '|' + residName] = dist.toFixed(1);
|
|
39134
39236
|
|
|
39135
39237
|
} // end of for (let j in atomHbond) {
|
|
39136
39238
|
}
|
|
@@ -50515,20 +50617,9 @@ class LineGraph {
|
|
|
50515
50617
|
} else {
|
|
50516
50618
|
linestrokewidth = (link.n == 1) ? 2 : 4;
|
|
50517
50619
|
}
|
|
50518
|
-
|
|
50519
|
-
|
|
50520
|
-
|
|
50521
|
-
} else if(link.v == me.htmlCls.ionicValue) {
|
|
50522
|
-
strokecolor = "#" + me.htmlCls.ionicColor;
|
|
50523
|
-
} else if(link.v == me.htmlCls.halogenValue) {
|
|
50524
|
-
strokecolor = "#" + me.htmlCls.halogenColor;
|
|
50525
|
-
} else if(link.v == me.htmlCls.picationValue) {
|
|
50526
|
-
strokecolor = "#" + me.htmlCls.picationColor;
|
|
50527
|
-
} else if(link.v == me.htmlCls.pistackingValue) {
|
|
50528
|
-
strokecolor = "#" + me.htmlCls.pistackingColor;
|
|
50529
|
-
} else if(link.v == me.htmlCls.contactValue) {
|
|
50530
|
-
strokecolor = "#" + me.htmlCls.contactColor;
|
|
50531
|
-
}
|
|
50620
|
+
|
|
50621
|
+
let strokecolor = this.getStrokecolor(link.v);
|
|
50622
|
+
|
|
50532
50623
|
html += "<g class='icn3d-interaction' resid1='" + resid1 + "' resid2='" + resid2 + "' >";
|
|
50533
50624
|
let interactStr = (link.n == 1) ? 'Interaction' : link.n + ' interactions';
|
|
50534
50625
|
if(link.n > 1) html += "<title>" + interactStr + " of residue " + node1.id + " with residue " + node2.id + "</title>";
|
|
@@ -50591,6 +50682,44 @@ class LineGraph {
|
|
|
50591
50682
|
return html;
|
|
50592
50683
|
}
|
|
50593
50684
|
|
|
50685
|
+
getStrokecolor(value, type) { let ic = this.icn3d, me = ic.icn3dui;
|
|
50686
|
+
let strokecolor = "#000";
|
|
50687
|
+
|
|
50688
|
+
if(value) {
|
|
50689
|
+
if(value == me.htmlCls.hbondValue) {
|
|
50690
|
+
strokecolor = "#" + me.htmlCls.hbondColor;
|
|
50691
|
+
} else if(value == me.htmlCls.ionicValue) {
|
|
50692
|
+
strokecolor = "#" + me.htmlCls.ionicColor;
|
|
50693
|
+
} else if(value == me.htmlCls.halogenValue) {
|
|
50694
|
+
strokecolor = "#" + me.htmlCls.halogenColor;
|
|
50695
|
+
} else if(value == me.htmlCls.picationValue) {
|
|
50696
|
+
strokecolor = "#" + me.htmlCls.picationColor;
|
|
50697
|
+
} else if(value == me.htmlCls.pistackingValue) {
|
|
50698
|
+
strokecolor = "#" + me.htmlCls.pistackingColor;
|
|
50699
|
+
} else if(value == me.htmlCls.contactValue) {
|
|
50700
|
+
strokecolor = "#" + me.htmlCls.contactColor;
|
|
50701
|
+
}
|
|
50702
|
+
}
|
|
50703
|
+
|
|
50704
|
+
if(type) {
|
|
50705
|
+
if(type == 'hbond') {
|
|
50706
|
+
strokecolor = "#" + me.htmlCls.hbondColor;
|
|
50707
|
+
} else if(type == 'ionic') {
|
|
50708
|
+
strokecolor = "#" + me.htmlCls.ionicColor;
|
|
50709
|
+
} else if(type == 'halogen') {
|
|
50710
|
+
strokecolor = "#" + me.htmlCls.halogenColor;
|
|
50711
|
+
} else if(type == 'pi-cation') {
|
|
50712
|
+
strokecolor = "#" + me.htmlCls.picationColor;
|
|
50713
|
+
} else if(type == 'pi-stacking') {
|
|
50714
|
+
strokecolor = "#" + me.htmlCls.pistackingColor;
|
|
50715
|
+
} else if(type == 'contact') {
|
|
50716
|
+
strokecolor = "#" + me.htmlCls.contactColor;
|
|
50717
|
+
}
|
|
50718
|
+
}
|
|
50719
|
+
|
|
50720
|
+
return strokecolor;
|
|
50721
|
+
}
|
|
50722
|
+
|
|
50594
50723
|
drawOnePairNode(link, node1, node2, node2posSet1, node2posSet2, bContactMap, bAfMap) { let ic = this.icn3d, me = ic.icn3dui;
|
|
50595
50724
|
let html = '';
|
|
50596
50725
|
|
|
@@ -50606,20 +50735,7 @@ class LineGraph {
|
|
|
50606
50735
|
let pos2 = node2posSet2[node2.id];
|
|
50607
50736
|
if(pos1 === undefined || pos2 === undefined) return html;
|
|
50608
50737
|
|
|
50609
|
-
let strokecolor;
|
|
50610
|
-
if(link.v == me.htmlCls.hbondValue) {
|
|
50611
|
-
strokecolor = "#" + me.htmlCls.hbondColor;
|
|
50612
|
-
} else if(link.v == me.htmlCls.ionicValue) {
|
|
50613
|
-
strokecolor = "#" + me.htmlCls.ionicColor;
|
|
50614
|
-
} else if(link.v == me.htmlCls.halogenValue) {
|
|
50615
|
-
strokecolor = "#" + me.htmlCls.halogenColor;
|
|
50616
|
-
} else if(link.v == me.htmlCls.picationValue) {
|
|
50617
|
-
strokecolor = "#" + me.htmlCls.picationColor;
|
|
50618
|
-
} else if(link.v == me.htmlCls.pistackingValue) {
|
|
50619
|
-
strokecolor = "#" + me.htmlCls.pistackingColor;
|
|
50620
|
-
} else if(link.v == me.htmlCls.contactValue) {
|
|
50621
|
-
strokecolor = "#" + me.htmlCls.contactColor;
|
|
50622
|
-
}
|
|
50738
|
+
let strokecolor = this.getStrokecolor(link.v);
|
|
50623
50739
|
|
|
50624
50740
|
if(bContactMap) strokecolor = "#" + link.c;
|
|
50625
50741
|
|
|
@@ -51199,6 +51315,10 @@ class GetGraph {
|
|
|
51199
51315
|
convertLabel2Resid(residLabel) {var ic = this.icn3d; ic.icn3dui;
|
|
51200
51316
|
//ASN $1KQ2.A:6@ND2
|
|
51201
51317
|
//or ASN $1KQ2.A:6
|
|
51318
|
+
// or ASN $1KQ2.A:6@ND2 1234
|
|
51319
|
+
let idArray = residLabel.split(' ');
|
|
51320
|
+
residLabel = (idArray.length == 2) ? residLabel : residLabel.substr(0, residLabel.lastIndexOf(' '));
|
|
51321
|
+
|
|
51202
51322
|
residLabel.indexOf(' ');
|
|
51203
51323
|
let pos2Tmp = residLabel.indexOf('@');
|
|
51204
51324
|
let pos2 =(pos2Tmp !== -1) ? pos2Tmp : residLabel.length;
|
|
@@ -51233,6 +51353,25 @@ class ShowInter {
|
|
|
51233
51353
|
ic.dAtoms = me.hashUtilsCls.unionHash(ic.dAtoms, atoms);
|
|
51234
51354
|
ic.dAtoms = me.hashUtilsCls.unionHash(ic.dAtoms, atoms2);
|
|
51235
51355
|
|
|
51356
|
+
if(type == 'ligplot') {
|
|
51357
|
+
let residueHash1 = ic.firstAtomObjCls.getResiduesFromAtoms(atoms);
|
|
51358
|
+
let residueHash2 = ic.firstAtomObjCls.getResiduesFromAtoms(atoms2);
|
|
51359
|
+
|
|
51360
|
+
if(Object.keys(residueHash1).length > 1 && Object.keys(residueHash2).length > 1) {
|
|
51361
|
+
alert("Please select one ligand or residue as one of the interaction sets...");
|
|
51362
|
+
return;
|
|
51363
|
+
}
|
|
51364
|
+
|
|
51365
|
+
// switch the sets to make the first set as the ligand
|
|
51366
|
+
if(Object.keys(residueHash1).length < Object.keys(residueHash2).length) {
|
|
51367
|
+
nameArray2 = $("#" + ic.pre + "atomsCustomHbond").val();
|
|
51368
|
+
nameArray = $("#" + ic.pre + "atomsCustomHbond2").val();
|
|
51369
|
+
|
|
51370
|
+
atoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
|
|
51371
|
+
atoms2 = ic.definedSetsCls.getAtomsFromNameArray(nameArray2);
|
|
51372
|
+
}
|
|
51373
|
+
}
|
|
51374
|
+
|
|
51236
51375
|
if(nameArray2.length == 0) {
|
|
51237
51376
|
alert("Please select the first set");
|
|
51238
51377
|
}
|
|
@@ -51276,6 +51415,9 @@ class ShowInter {
|
|
|
51276
51415
|
else if(type == 'scatterplot') {
|
|
51277
51416
|
me.htmlCls.clickMenuCls.setLogCmd("scatterplot interaction pairs | " + tmpStr, true);
|
|
51278
51417
|
}
|
|
51418
|
+
else if(type == 'ligplot') {
|
|
51419
|
+
me.htmlCls.clickMenuCls.setLogCmd("ligplot interaction pairs | " + tmpStr, true);
|
|
51420
|
+
}
|
|
51279
51421
|
else if(type == 'graph') { // force-directed graph
|
|
51280
51422
|
let dist_ss = parseInt($("#" + ic.pre + "dist_ss").val());
|
|
51281
51423
|
let dist_coil = parseInt($("#" + ic.pre + "dist_coil").val());
|
|
@@ -51964,6 +52106,9 @@ class ViewInterPairs {
|
|
|
51964
52106
|
let svgHtml = ic.lineGraphCls.drawLineGraph(ic.graphStr, true);
|
|
51965
52107
|
$("#" + ic.pre + "scatterplotDiv").html(svgHtml);
|
|
51966
52108
|
}
|
|
52109
|
+
else if(type == 'ligplot') {
|
|
52110
|
+
await ic.ligplotCls.drawLigplot(atomSet1);
|
|
52111
|
+
}
|
|
51967
52112
|
else if(bContactMapLocal) {
|
|
51968
52113
|
me.htmlCls.dialogCls.openDlg('dl_contactmap', 'Show contact map');
|
|
51969
52114
|
let bAnyAtom = true;
|
|
@@ -52053,7 +52198,9 @@ class ViewInterPairs {
|
|
|
52053
52198
|
}
|
|
52054
52199
|
}
|
|
52055
52200
|
|
|
52056
|
-
getAllInteractionTable(type) { let ic = this.icn3d, me = ic.icn3dui;
|
|
52201
|
+
getAllInteractionTable(type, index2xy, xlen, ylen, xcenter, ycenter) { let ic = this.icn3d, me = ic.icn3dui;
|
|
52202
|
+
let svgHtmlNode = '', svgHtmlLine = '';
|
|
52203
|
+
|
|
52057
52204
|
let bondCnt = [];
|
|
52058
52205
|
|
|
52059
52206
|
let residsArray = Object.keys(ic.resids2inter);
|
|
@@ -52092,41 +52239,54 @@ class ViewInterPairs {
|
|
|
52092
52239
|
}
|
|
52093
52240
|
let labels2dist, result;
|
|
52094
52241
|
labels2dist = ic.resids2inter[resids]['hbond'];
|
|
52095
|
-
result = this.getInteractionPairDetails(labels2dist, type, 'hbond');
|
|
52242
|
+
result = this.getInteractionPairDetails(labels2dist, type, 'hbond', index2xy, xlen, ylen, xcenter, ycenter);
|
|
52096
52243
|
strHbond += result.html;
|
|
52097
52244
|
cntHbond += result.cnt;
|
|
52245
|
+
svgHtmlNode += result.svgHtmlNode;
|
|
52246
|
+
svgHtmlLine += result.svgHtmlLine;
|
|
52098
52247
|
if(result.cnt > 0) residname2List += residname2 + ":hbond_" + result.cnt + " ";
|
|
52099
52248
|
|
|
52100
52249
|
labels2dist = ic.resids2inter[resids]['ionic'];
|
|
52101
|
-
result = this.getInteractionPairDetails(labels2dist, type, 'ionic');
|
|
52250
|
+
result = this.getInteractionPairDetails(labels2dist, type, 'ionic', index2xy, xlen, ylen, xcenter, ycenter);
|
|
52102
52251
|
strIonic += result.html;
|
|
52103
52252
|
cntIonic += result.cnt;
|
|
52253
|
+
svgHtmlNode += result.svgHtmlNode;
|
|
52254
|
+
svgHtmlLine += result.svgHtmlLine;
|
|
52104
52255
|
if(result.cnt > 0) residname2List += residname2 + ":ionic_" + result.cnt + " ";
|
|
52105
52256
|
|
|
52106
|
-
labels2dist = ic.resids2inter[resids]['contact'];
|
|
52107
|
-
result = this.getContactPairDetails(labels2dist, type, 'contact');
|
|
52108
|
-
strContact += result.html;
|
|
52109
|
-
cntContact += result.cnt;
|
|
52110
|
-
if(result.cnt > 0) residname2List += residname2 + ":contact_" + result.cnt + " ";
|
|
52111
|
-
|
|
52112
52257
|
labels2dist = ic.resids2inter[resids]['halogen'];
|
|
52113
|
-
result = this.getInteractionPairDetails(labels2dist, type, 'halogen');
|
|
52258
|
+
result = this.getInteractionPairDetails(labels2dist, type, 'halogen', index2xy, xlen, ylen, xcenter, ycenter);
|
|
52114
52259
|
strHalegen += result.html;
|
|
52115
52260
|
cntHalegen += result.cnt;
|
|
52261
|
+
svgHtmlNode += result.svgHtmlNode;
|
|
52262
|
+
svgHtmlLine += result.svgHtmlLine;
|
|
52116
52263
|
if(result.cnt > 0) residname2List += residname2 + ":halogen_" + result.cnt + " ";
|
|
52117
52264
|
|
|
52118
52265
|
labels2dist = ic.resids2inter[resids]['pi-cation'];
|
|
52119
|
-
result = this.getInteractionPairDetails(labels2dist, type, 'pi-cation');
|
|
52266
|
+
result = this.getInteractionPairDetails(labels2dist, type, 'pi-cation', index2xy, xlen, ylen, xcenter, ycenter);
|
|
52120
52267
|
strPication += result.html;
|
|
52121
52268
|
cntPication += result.cnt;
|
|
52269
|
+
svgHtmlNode += result.svgHtmlNode;
|
|
52270
|
+
svgHtmlLine += result.svgHtmlLine;
|
|
52122
52271
|
if(result.cnt > 0) residname2List += residname2 + ":pi-cation_" + result.cnt + " ";
|
|
52123
52272
|
|
|
52124
52273
|
labels2dist = ic.resids2inter[resids]['pi-stacking'];
|
|
52125
|
-
result = this.getInteractionPairDetails(labels2dist, type, 'pi-stacking');
|
|
52274
|
+
result = this.getInteractionPairDetails(labels2dist, type, 'pi-stacking', index2xy, xlen, ylen, xcenter, ycenter);
|
|
52126
52275
|
strPistacking += result.html;
|
|
52127
52276
|
cntPistacking += result.cnt;
|
|
52277
|
+
svgHtmlNode += result.svgHtmlNode;
|
|
52278
|
+
svgHtmlLine += result.svgHtmlLine;
|
|
52128
52279
|
if(result.cnt > 0) residname2List += residname2 + ":pi-stacking_" + result.cnt + " ";
|
|
52129
52280
|
|
|
52281
|
+
// put contact as the last one since contact will use the same node as other interactions in ligand-protein interactoin
|
|
52282
|
+
labels2dist = ic.resids2inter[resids]['contact'];
|
|
52283
|
+
result = this.getContactPairDetails(labels2dist, type, 'contact', index2xy, xlen, ylen, xcenter, ycenter);
|
|
52284
|
+
strContact += result.html;
|
|
52285
|
+
cntContact += result.cnt;
|
|
52286
|
+
svgHtmlNode += result.svgHtmlNode;
|
|
52287
|
+
svgHtmlLine += result.svgHtmlLine;
|
|
52288
|
+
if(result.cnt > 0) residname2List += residname2 + ":contact_" + result.cnt + " ";
|
|
52289
|
+
|
|
52130
52290
|
prevResidname1 = residname1;
|
|
52131
52291
|
prevIds = ids;
|
|
52132
52292
|
}
|
|
@@ -52154,7 +52314,7 @@ class ViewInterPairs {
|
|
|
52154
52314
|
html += tmpText;
|
|
52155
52315
|
html += '</tbody></table><br/>';
|
|
52156
52316
|
}
|
|
52157
|
-
return {html: html, bondCnt: bondCnt};
|
|
52317
|
+
return {html: html, bondCnt: bondCnt, svgHtmlNode: svgHtmlNode, svgHtmlLine: svgHtmlLine};
|
|
52158
52318
|
}
|
|
52159
52319
|
getInteractionPerResidue(prevIds, strHbond, strIonic, strContact, strHalegen, strPication, strPistacking,
|
|
52160
52320
|
cntHbond, cntIonic, cntContact, cntHalegen, cntPication, cntPistacking) { let ic = this.icn3d; ic.icn3dui;
|
|
@@ -52169,15 +52329,24 @@ class ViewInterPairs {
|
|
|
52169
52329
|
tmpText += '</tr>';
|
|
52170
52330
|
return tmpText;
|
|
52171
52331
|
}
|
|
52172
|
-
getInteractionPairDetails(labels2dist, type, interactionType) { let ic = this.icn3d; ic.icn3dui;
|
|
52173
|
-
let tmpText = '', cnt = 0;
|
|
52332
|
+
getInteractionPairDetails(labels2dist, type, interactionType, index2xy, xlen, ylen, xcenter, ycenter) { let ic = this.icn3d; ic.icn3dui;
|
|
52333
|
+
let svgHtmlNode = '', svgHtmlLine = '', tmpText = '', cnt = 0;
|
|
52174
52334
|
let colorText1 = ' <span style="background-color:#';
|
|
52175
52335
|
let colorText2 = '"> </span>';
|
|
52176
52336
|
if(labels2dist !== undefined) {
|
|
52337
|
+
if(!ic.resid2cnt) ic.resid2cnt = {};
|
|
52338
|
+
if(!ic.resid2ToXy) ic.resid2ToXy = {};
|
|
52339
|
+
if(!ic.nodeid2lineid) ic.nodeid2lineid = {};
|
|
52177
52340
|
for(let labels in labels2dist) {
|
|
52178
|
-
let resid1_resid2 = labels.split('
|
|
52179
|
-
let
|
|
52180
|
-
let
|
|
52341
|
+
let resid1_resid2 = labels.split('|');
|
|
52342
|
+
let resid1Ori =(type == 'save1') ? resid1_resid2[0] : resid1_resid2[1];
|
|
52343
|
+
let resid2Ori =(type == 'save1') ? resid1_resid2[1] : resid1_resid2[0];
|
|
52344
|
+
//resid1: MET $3GVU.A:364@N 1234
|
|
52345
|
+
let pos1 = resid1Ori.lastIndexOf(' ');
|
|
52346
|
+
let pos2 = resid2Ori.lastIndexOf(' ');
|
|
52347
|
+
let resid1 = resid1Ori.substr(0, pos1);
|
|
52348
|
+
let resid2 = resid2Ori.substr(0, pos2);
|
|
52349
|
+
|
|
52181
52350
|
let resid1Real = ic.getGraphCls.convertLabel2Resid(resid1);
|
|
52182
52351
|
let atom1 = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid1Real]);
|
|
52183
52352
|
let color1 = (atom1.color) ? atom1.color.getHexString() : '';
|
|
@@ -52189,38 +52358,125 @@ class ViewInterPairs {
|
|
|
52189
52358
|
tmpText += '<td align="center"><button class="' + ic.pre + 'selres" resid="' + resid1 + '|' + resid2 + '">Highlight</button></td>';
|
|
52190
52359
|
tmpText += '</tr>';
|
|
52191
52360
|
++cnt;
|
|
52361
|
+
|
|
52362
|
+
if(index2xy) {
|
|
52363
|
+
let serialArray1 = resid1Ori.substr(pos1 + 1).split(',');
|
|
52364
|
+
|
|
52365
|
+
let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter);
|
|
52366
|
+
svgHtmlNode += result.node;
|
|
52367
|
+
svgHtmlLine += result.line;
|
|
52368
|
+
}
|
|
52192
52369
|
}
|
|
52193
52370
|
}
|
|
52194
|
-
return {html: tmpText, cnt: cnt}
|
|
52371
|
+
return {html: tmpText, cnt: cnt, svgHtmlNode: svgHtmlNode, svgHtmlLine: svgHtmlLine}
|
|
52195
52372
|
}
|
|
52196
|
-
|
|
52197
|
-
|
|
52373
|
+
|
|
52374
|
+
getContactPairDetails(labels2dist, type, interactionType, index2xy, xlen, ylen, xcenter, ycenter) { let ic = this.icn3d; ic.icn3dui;
|
|
52375
|
+
let svgHtmlNode = '', svgHtmlLine = '', tmpText = '', cnt = 0;
|
|
52198
52376
|
let colorText1 = ' <span style="background-color:#';
|
|
52199
52377
|
let colorText2 = '"> </span>';
|
|
52200
52378
|
if(labels2dist !== undefined) {
|
|
52379
|
+
let resids2distCnt = {};
|
|
52380
|
+
if(!ic.resid2cnt) ic.resid2cnt = {};
|
|
52381
|
+
if(!ic.resid2ToXy) ic.resid2ToXy = {};
|
|
52382
|
+
if(!ic.nodeid2lineid) ic.nodeid2lineid = {};
|
|
52201
52383
|
for(let labels in labels2dist) {
|
|
52202
|
-
let resid1_resid2 = labels.split('
|
|
52203
|
-
let
|
|
52204
|
-
let
|
|
52384
|
+
let resid1_resid2 = labels.split('|');
|
|
52385
|
+
let resid1Ori =(type == 'save1') ? resid1_resid2[0] : resid1_resid2[1];
|
|
52386
|
+
let resid2Ori =(type == 'save1') ? resid1_resid2[1] : resid1_resid2[0];
|
|
52387
|
+
//resid1: MET $3GVU.A:364 1234
|
|
52388
|
+
let pos1 = resid1Ori.lastIndexOf(' ');
|
|
52389
|
+
let pos2 = resid2Ori.lastIndexOf(' ');
|
|
52390
|
+
|
|
52391
|
+
let serialArray1 = resid1Ori.substr(pos1 + 1).split(',');
|
|
52392
|
+
let resid1 = resid1Ori.substr(0, pos1);
|
|
52393
|
+
if(index2xy) {
|
|
52394
|
+
// add atom name to resid1
|
|
52395
|
+
resid1 += '@' + ic.atoms[serialArray1[0]].name;
|
|
52396
|
+
}
|
|
52397
|
+
|
|
52398
|
+
let resid2 = resid2Ori.substr(0, pos2);
|
|
52399
|
+
let resids = resid1 + '|' + resid2;
|
|
52400
|
+
|
|
52401
|
+
let resid1Real = ic.getGraphCls.convertLabel2Resid(resid1);
|
|
52402
|
+
ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid1Real]);
|
|
52403
|
+
// let color1 = (atom1.color) ? atom1.color.getHexString() : '';
|
|
52404
|
+
let resid2Real = ic.getGraphCls.convertLabel2Resid(resid2);
|
|
52405
|
+
ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid2Real]);
|
|
52406
|
+
// let color2 = (atom2.color) ? atom2.color.getHexString() : '';
|
|
52407
|
+
let dist1_dist2_atom1_atom2 = labels2dist[labels].split('_');
|
|
52408
|
+
let dist1 = parseFloat(dist1_dist2_atom1_atom2[0]);
|
|
52409
|
+
// let dist2 = parseFloat(dist1_dist2_atom1_atom2[1]);
|
|
52410
|
+
// let atom1Name = dist1_dist2_atom1_atom2[2];
|
|
52411
|
+
// let atom2Name = dist1_dist2_atom1_atom2[3];
|
|
52412
|
+
let contactCnt = parseInt(dist1_dist2_atom1_atom2[4]);
|
|
52413
|
+
if(!resids2distCnt.hasOwnProperty(resids)) {
|
|
52414
|
+
resids2distCnt[resids] = {'dist1': dist1, 'dist1_dist2_atom1_atom2': dist1_dist2_atom1_atom2, 'cnt': contactCnt, 'serialArray1': serialArray1};
|
|
52415
|
+
}
|
|
52416
|
+
else {
|
|
52417
|
+
resids2distCnt[resids].cnt += contactCnt;
|
|
52418
|
+
if(dist1 < resids2distCnt[resids].dist1) {
|
|
52419
|
+
resids2distCnt[resids].dist1 = dist1;
|
|
52420
|
+
resids2distCnt[resids].dist1_dist2_atom1_atom2 = dist1_dist2_atom1_atom2;
|
|
52421
|
+
resids2distCnt[resids].serialArray1 = serialArray1;
|
|
52422
|
+
}
|
|
52423
|
+
}
|
|
52424
|
+
}
|
|
52425
|
+
|
|
52426
|
+
let resid2ToResid1 = {};
|
|
52427
|
+
for(let resids in resids2distCnt) {
|
|
52428
|
+
let resid1_resid2 = resids.split('|');
|
|
52429
|
+
let resid1 = resid1_resid2[0];
|
|
52430
|
+
let resid2 = resid1_resid2[1];
|
|
52431
|
+
|
|
52432
|
+
if(!resid2ToResid1.hasOwnProperty(resid2)) {
|
|
52433
|
+
resid2ToResid1[resid2] = [resid1];
|
|
52434
|
+
}
|
|
52435
|
+
else {
|
|
52436
|
+
resid2ToResid1[resid2].push(resid1);
|
|
52437
|
+
}
|
|
52438
|
+
|
|
52205
52439
|
let resid1Real = ic.getGraphCls.convertLabel2Resid(resid1);
|
|
52206
52440
|
let atom1 = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid1Real]);
|
|
52207
52441
|
let color1 = (atom1.color) ? atom1.color.getHexString() : '';
|
|
52208
52442
|
let resid2Real = ic.getGraphCls.convertLabel2Resid(resid2);
|
|
52209
52443
|
let atom2 = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid2Real]);
|
|
52210
52444
|
let color2 = (atom2.color) ? atom2.color.getHexString() : '';
|
|
52211
|
-
let dist1_dist2_atom1_atom2 =
|
|
52445
|
+
let dist1_dist2_atom1_atom2 = resids2distCnt[resids].dist1_dist2_atom1_atom2;
|
|
52212
52446
|
let dist1 = dist1_dist2_atom1_atom2[0];
|
|
52213
52447
|
let dist2 = dist1_dist2_atom1_atom2[1];
|
|
52214
52448
|
let atom1Name = dist1_dist2_atom1_atom2[2];
|
|
52215
52449
|
let atom2Name = dist1_dist2_atom1_atom2[3];
|
|
52216
|
-
let contactCnt =
|
|
52450
|
+
let contactCnt = 1; //resids2distCnt[resids].cnt;
|
|
52451
|
+
|
|
52217
52452
|
tmpText += '<tr><td><span style="white-space:nowrap"><input type="checkbox" class="' + ic.pre + 'seloneres" id="' + ic.pre + 'inter2_' + cnt + 'a" resid="' + resid1 + '"/> ' + resid1 + '@' + atom1Name + colorText1 + color1 + colorText2 + '</span></td><td><span style="white-space:nowrap"><input type="checkbox" class="' + ic.pre + 'seloneres" id="' + ic.pre + 'inter2_' + cnt + 'b" resid="' + resid2 + '"/> ' + resid2 + '@' + atom2Name + colorText1 + color2 + colorText2 + '</span></td><td align="center">' + contactCnt + '</td><td align="center">' + dist1 + '</td><td align="center">' + dist2 + '</td>';
|
|
52218
52453
|
tmpText += '<td align="center"><button class="' + ic.pre + 'selres" resid="' + resid1 + '|' + resid2 + '">Highlight</button></td>';
|
|
52219
52454
|
tmpText += '</tr>';
|
|
52220
52455
|
cnt += parseInt(contactCnt);
|
|
52221
52456
|
}
|
|
52457
|
+
|
|
52458
|
+
if(index2xy) {
|
|
52459
|
+
for(let resid2 in resid2ToResid1) {
|
|
52460
|
+
let resid1Array = resid2ToResid1[resid2];
|
|
52461
|
+
let prevX2, prevY2;
|
|
52462
|
+
for(let i = 0, il = resid1Array.length; i < il; ++i) {
|
|
52463
|
+
let resid1 = resid1Array[i];
|
|
52464
|
+
let resids = resid1 + '|' + resid2;
|
|
52465
|
+
|
|
52466
|
+
let serialArray1 = resids2distCnt[resids].serialArray1;
|
|
52467
|
+
|
|
52468
|
+
let bNotDrawNode = (i == 0) ? false : true;
|
|
52469
|
+
let result = ic.ligplotCls.getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, bNotDrawNode, prevX2, prevY2);
|
|
52470
|
+
svgHtmlNode += result.node;
|
|
52471
|
+
svgHtmlLine += result.line;
|
|
52472
|
+
prevX2 = result.x2;
|
|
52473
|
+
prevY2 = result.y2;
|
|
52474
|
+
}
|
|
52475
|
+
}
|
|
52476
|
+
}
|
|
52222
52477
|
}
|
|
52223
|
-
|
|
52478
|
+
|
|
52479
|
+
return {html: tmpText, cnt: cnt, svgHtmlNode: svgHtmlNode, svgHtmlLine: svgHtmlLine};
|
|
52224
52480
|
}
|
|
52225
52481
|
|
|
52226
52482
|
//Export the list of residues in some chain interacting with residues in another chain.
|
|
@@ -53628,8 +53884,8 @@ class ChainalignParser {
|
|
|
53628
53884
|
let chain_t = idArray[3];
|
|
53629
53885
|
let chainid_t = mmdbid_t + '_' + chain_t;
|
|
53630
53886
|
|
|
53631
|
-
let atomSet_t = (
|
|
53632
|
-
let atomSet_q = (
|
|
53887
|
+
let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t).hAtoms : ic.chains[chainid_t];
|
|
53888
|
+
let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q).hAtoms : ic.chains[chainid_q];
|
|
53633
53889
|
// end of original version =============
|
|
53634
53890
|
|
|
53635
53891
|
/*
|
|
@@ -56287,6 +56543,22 @@ class MmdbParser {
|
|
|
56287
56543
|
hAtoms = ic.loadAtomDataCls.loadAtomDataIn(data, pdbid, 'mmdbid', undefined, type, chainid, chainIndex, bLastQuery, bNoTransformNoSeqalign);
|
|
56288
56544
|
}
|
|
56289
56545
|
|
|
56546
|
+
// show ligand-protein interaction
|
|
56547
|
+
if(me.cfg.ligand) { // sid123059722
|
|
56548
|
+
for(let chainid in ic.chainid2sid) {
|
|
56549
|
+
if(ic.chainid2sid[chainid] == me.cfg.ligand.substr(3)) {
|
|
56550
|
+
// save a set named me.cfg.ligand
|
|
56551
|
+
let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.chains[chainid]);
|
|
56552
|
+
let idArray = Object.keys(residueHash)[0].split('_');
|
|
56553
|
+
let select = '.' + idArray[1] + ':' + idArray[2];
|
|
56554
|
+
|
|
56555
|
+
await ic.selByCommCls.selectByCommand(select, me.cfg.ligand, me.cfg.ligand);
|
|
56556
|
+
break;
|
|
56557
|
+
}
|
|
56558
|
+
}
|
|
56559
|
+
}
|
|
56560
|
+
ic.hAtoms = hAtoms;
|
|
56561
|
+
|
|
56290
56562
|
// set 3d domains
|
|
56291
56563
|
let structure = data.pdbId;
|
|
56292
56564
|
|
|
@@ -66874,6 +67146,7 @@ class ApplyCommand {
|
|
|
66874
67146
|
|| commandOri.indexOf('save2 interaction pairs') == 0
|
|
66875
67147
|
|| commandOri.indexOf('line graph interaction pairs') == 0
|
|
66876
67148
|
|| commandOri.indexOf('scatterplot interaction pairs') == 0
|
|
67149
|
+
|| commandOri.indexOf('ligplot interaction pairs') == 0
|
|
66877
67150
|
) {
|
|
66878
67151
|
let paraArray = commandOri.split(' | ');
|
|
66879
67152
|
if(paraArray.length >= 3) {
|
|
@@ -66931,6 +67204,9 @@ class ApplyCommand {
|
|
|
66931
67204
|
else if(commandOri.indexOf('scatterplot interaction pairs') == 0) {
|
|
66932
67205
|
type = 'scatterplot';
|
|
66933
67206
|
}
|
|
67207
|
+
else if(commandOri.indexOf('ligplot interaction pairs') == 0) {
|
|
67208
|
+
type = 'ligplot';
|
|
67209
|
+
}
|
|
66934
67210
|
|
|
66935
67211
|
await ic.viewInterPairsCls.viewInteractionPairs(nameArray2, nameArray, bHbondCalc, type, bHbond, bSaltbridge, bInteraction, bHalogen, bPication, bPistacking);
|
|
66936
67212
|
}
|
|
@@ -66990,6 +67266,14 @@ class ApplyCommand {
|
|
|
66990
67266
|
|
|
66991
67267
|
$("#" + me.scatterplotid).attr("width",(ic.scatterplotWidth * parseFloat(scale)).toString() + "px");
|
|
66992
67268
|
}
|
|
67269
|
+
else if(command.indexOf('ligplot scale') == 0) {
|
|
67270
|
+
let pos = command.lastIndexOf(' ');
|
|
67271
|
+
let scale = command.substr(pos + 1);
|
|
67272
|
+
|
|
67273
|
+
$("#" + me.ligplotid + "_scale").val(scale);
|
|
67274
|
+
|
|
67275
|
+
$("#" + me.ligplotid).attr("width",(ic.ligplotWidth * parseFloat(scale)).toString() + "px");
|
|
67276
|
+
}
|
|
66993
67277
|
else if(command.indexOf('contactmap scale') == 0) {
|
|
66994
67278
|
let pos = command.lastIndexOf(' ');
|
|
66995
67279
|
let scale = command.substr(pos + 1);
|
|
@@ -67643,6 +67927,7 @@ class ApplyCommand {
|
|
|
67643
67927
|
else if(cmd.indexOf('save2 interaction pairs') == 0) return hbondIntStr + ': "Set 2" button';
|
|
67644
67928
|
else if(cmd.indexOf('line graph interaction pairs') == 0) return hbondIntStr + ': "2D Interaction Network" button';
|
|
67645
67929
|
else if(cmd.indexOf('scatterplot interaction pairs') == 0) return hbondIntStr + ': "2D Interaction Map" button';
|
|
67930
|
+
else if(cmd.indexOf('ligplot interaction pairs') == 0) return hbondIntStr + ': "2D Interaction for One Ligand/Residue" button';
|
|
67646
67931
|
else if(cmd.indexOf('graph label') == 0) return forceStr + ': "Label Size" menu';
|
|
67647
67932
|
else if(cmd.indexOf('graph force') == 0) return forceStr + ': "Force on Nodes" menu';
|
|
67648
67933
|
else if(cmd.indexOf('hide edges') == 0) return forceStr + ': "Internal Edges" menu';
|
|
@@ -76200,6 +76485,12 @@ class Diagram2d {
|
|
|
76200
76485
|
thisClass.clickNode(this);
|
|
76201
76486
|
});
|
|
76202
76487
|
|
|
76488
|
+
$(document).on("click", "#" + ic.pre + "dl_ligplot .icn3d-node", function(e) { thisClass.icn3d;
|
|
76489
|
+
e.stopImmediatePropagation();
|
|
76490
|
+
|
|
76491
|
+
thisClass.clickNode(this);
|
|
76492
|
+
});
|
|
76493
|
+
|
|
76203
76494
|
//$("#" + ic.pre + "dl_linegraph .icn3d-interaction", "click", function(e) { let ic = this.icn3d, me = ic.icn3dui;
|
|
76204
76495
|
$(document).on("click", "#" + ic.pre + "dl_linegraph .icn3d-interaction", function(e) { let ic = thisClass.icn3d;
|
|
76205
76496
|
e.stopImmediatePropagation();
|
|
@@ -76282,6 +76573,8 @@ class Diagram2d {
|
|
|
76282
76573
|
let strokeWidth = 2;
|
|
76283
76574
|
$(node).find('circle').attr('stroke', me.htmlCls.ORANGE);
|
|
76284
76575
|
$(node).find('circle').attr('stroke-width', strokeWidth);
|
|
76576
|
+
$(node).find('rect').attr('stroke', me.htmlCls.ORANGE);
|
|
76577
|
+
$(node).find('rect').attr('stroke-width', strokeWidth);
|
|
76285
76578
|
|
|
76286
76579
|
ic.hAtoms = me.hashUtilsCls.unionHash(ic.hAtoms, ic.residues[resid]);
|
|
76287
76580
|
|
|
@@ -77399,6 +77692,364 @@ class Cartoon2d {
|
|
|
77399
77692
|
}
|
|
77400
77693
|
}
|
|
77401
77694
|
|
|
77695
|
+
/**
|
|
77696
|
+
* @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
|
|
77697
|
+
*/
|
|
77698
|
+
|
|
77699
|
+
class Ligplot {
|
|
77700
|
+
constructor(icn3d) {
|
|
77701
|
+
this.icn3d = icn3d;
|
|
77702
|
+
}
|
|
77703
|
+
|
|
77704
|
+
async drawLigplot(atomSet1) { let ic = this.icn3d, me = ic.icn3dui;
|
|
77705
|
+
me.htmlCls.dialogCls.openDlg('dl_ligplot', 'Show ligand interactions with atom details');
|
|
77706
|
+
|
|
77707
|
+
let widthOri, heightOri, width = 100, height = 100;
|
|
77708
|
+
ic.len4ang = 80;
|
|
77709
|
+
|
|
77710
|
+
// get SVG from backend
|
|
77711
|
+
let pdbStr = ic.saveFileCls.getAtomPDB(atomSet1);
|
|
77712
|
+
pdbStr = pdbStr.trim();
|
|
77713
|
+
pdbStr = pdbStr.replace(/\n\n/g, '\n'); // remove empty lines
|
|
77714
|
+
|
|
77715
|
+
let dataObj = {'pdb2svg': pdbStr};
|
|
77716
|
+
let url = me.htmlCls.baseUrl + "openbabel/openbabel.cgi";
|
|
77717
|
+
let dataStr = await me.getAjaxPostPromise(url, dataObj, undefined, undefined, undefined, undefined, 'text');
|
|
77718
|
+
|
|
77719
|
+
let lineArray = dataStr.split('\n');
|
|
77720
|
+
let lineSvg = '', nodeSvg = '', index2xy = {};
|
|
77721
|
+
let xsum = 0, ysum = 0, cnt = 0;
|
|
77722
|
+
ic.svgGridSize = ic.len4ang; // make the scg into many grids to tell whether the grid is empty, 30 is about bond length (1.5 angstrom)
|
|
77723
|
+
ic.gridXY2used = {};
|
|
77724
|
+
for(let i = 0, il = lineArray.length; i < il; ++i) {
|
|
77725
|
+
let line = lineArray[i];
|
|
77726
|
+
if(line.indexOf('<svg width') == 0) {
|
|
77727
|
+
//<svg width="100" height="100" x="0" y="0" viewBox="0 0 634.256 380"
|
|
77728
|
+
// get real width and height
|
|
77729
|
+
let start = line.indexOf('viewBox="') + 9;
|
|
77730
|
+
let linePart = line.substr(start);
|
|
77731
|
+
let viewbox = linePart.substr(0, linePart.indexOf('"'));
|
|
77732
|
+
let viewboxArray = viewbox.split(' ');
|
|
77733
|
+
widthOri = parseFloat(viewboxArray[2]);
|
|
77734
|
+
heightOri = parseFloat(viewboxArray[3]);
|
|
77735
|
+
width = widthOri + 2*ic.len4ang;
|
|
77736
|
+
height = heightOri + 2*ic.len4ang;
|
|
77737
|
+
}
|
|
77738
|
+
else if(line.indexOf('<line') == 0) {
|
|
77739
|
+
lineSvg += line + '\n';
|
|
77740
|
+
}
|
|
77741
|
+
else if(line.indexOf('<text') == 0) {
|
|
77742
|
+
if(line.indexOf('font-size="12"') != -1) {
|
|
77743
|
+
// index node
|
|
77744
|
+
//<text x="40.000000" y="120.000000" fill="rgb(255,0,0)" stroke-width="0" font-weight="bold" font-size="12" >1</text>
|
|
77745
|
+
let start = line.indexOf('>') + 1;
|
|
77746
|
+
let indexPart = line.substr(start);
|
|
77747
|
+
let index = parseInt(indexPart.substr(0, indexPart.indexOf('<')));
|
|
77748
|
+
|
|
77749
|
+
start = line.indexOf('x="') + 3;
|
|
77750
|
+
let xPart = line.substr(start);
|
|
77751
|
+
let x = parseFloat(xPart.substr(0, xPart.indexOf('"')));
|
|
77752
|
+
|
|
77753
|
+
start = line.indexOf('y="') + 3;
|
|
77754
|
+
let yPart = line.substr(start);
|
|
77755
|
+
let y = parseFloat(yPart.substr(0, yPart.indexOf('"')));
|
|
77756
|
+
|
|
77757
|
+
index2xy[index] = {"x": x, "y": y};
|
|
77758
|
+
let xGrid = parseInt(x / ic.svgGridSize);
|
|
77759
|
+
let yGrid = parseInt(y / ic.svgGridSize);
|
|
77760
|
+
ic.gridXY2used[xGrid + '_' + yGrid] = 1;
|
|
77761
|
+
|
|
77762
|
+
xsum += x;
|
|
77763
|
+
ysum += y;
|
|
77764
|
+
++cnt;
|
|
77765
|
+
}
|
|
77766
|
+
else { // font-size > 12
|
|
77767
|
+
nodeSvg += line + '\n';
|
|
77768
|
+
}
|
|
77769
|
+
}
|
|
77770
|
+
else if(line.indexOf('</svg>') == 0) {
|
|
77771
|
+
break;
|
|
77772
|
+
}
|
|
77773
|
+
}
|
|
77774
|
+
|
|
77775
|
+
let xcenter = xsum / cnt, ycenter = ysum / cnt;
|
|
77776
|
+
|
|
77777
|
+
let id = me.ligplotid;
|
|
77778
|
+
ic.ligplotWidth = width;
|
|
77779
|
+
let graphWidth = ic.ligplotWidth;
|
|
77780
|
+
|
|
77781
|
+
let textHeight = 30;
|
|
77782
|
+
let heightAll = height + textHeight;
|
|
77783
|
+
|
|
77784
|
+
let offset = - ic.len4ang;
|
|
77785
|
+
let svgHtml = "<svg id='" + id + "' viewBox='" + offset + "," + offset + "," + width + "," + heightAll + "' width='" + graphWidth + "px' font-family='sans-serif' stroke='rgb(0,0,0)' stroke-width='2' stroke-linecap='round'>";
|
|
77786
|
+
|
|
77787
|
+
let xlen = parseInt(widthOri / ic.svgGridSize), ylen = parseInt(heightOri / ic.svgGridSize);
|
|
77788
|
+
let result = ic.viewInterPairsCls.getAllInteractionTable("save1", index2xy, xlen, ylen, xcenter, ycenter); // sort on the ligand/set1
|
|
77789
|
+
ic.bLigplot = true;
|
|
77790
|
+
|
|
77791
|
+
svgHtml += lineSvg + result.svgHtmlLine;
|
|
77792
|
+
|
|
77793
|
+
svgHtml += nodeSvg + result.svgHtmlNode;
|
|
77794
|
+
|
|
77795
|
+
svgHtml += "</svg>";
|
|
77796
|
+
|
|
77797
|
+
$("#" + ic.pre + "ligplotDiv").html(svgHtml);
|
|
77798
|
+
|
|
77799
|
+
this.setEventsForLigplot();
|
|
77800
|
+
}
|
|
77801
|
+
|
|
77802
|
+
|
|
77803
|
+
getSvgPerPair(serialArray1, resid1, resid2, interactionType, index2xy, xlen, ylen, xcenter, ycenter, bNotDrawNode, prevX2, prevY2) { let ic = this.icn3d, me = ic.icn3dui;
|
|
77804
|
+
let xOffset = 1, yOffset = -1;
|
|
77805
|
+
let bondLen = (interactionType == 'hbond' || interactionType == 'contact' || interactionType == 'halogen') ? ic.len4ang : ic.len4ang * 1.5; // real distance should be bout 120, not 80
|
|
77806
|
+
let shortBondLen = ic.len4ang / 2;
|
|
77807
|
+
let strokeWidth = (interactionType == 'contact') ? 1 : 2;
|
|
77808
|
+
|
|
77809
|
+
let resid1Real = ic.getGraphCls.convertLabel2Resid(resid1);
|
|
77810
|
+
let atom1 = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid1Real]);
|
|
77811
|
+
let resid2Real = ic.getGraphCls.convertLabel2Resid(resid2);
|
|
77812
|
+
let atom2 = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid2Real]);
|
|
77813
|
+
|
|
77814
|
+
let xSum = 0, ySum = 0, cntPoint = 0;
|
|
77815
|
+
let baseSerial = atom1.serial;
|
|
77816
|
+
for(let i = 0, il = serialArray1.length; i < il; ++i) {
|
|
77817
|
+
let index = serialArray1[i] - baseSerial + 1;
|
|
77818
|
+
xSum += index2xy[index].x;
|
|
77819
|
+
ySum += index2xy[index].y;
|
|
77820
|
+
++cntPoint;
|
|
77821
|
+
}
|
|
77822
|
+
|
|
77823
|
+
let x1 = xSum / cntPoint - xOffset;
|
|
77824
|
+
let y1 = ySum / cntPoint - yOffset;
|
|
77825
|
+
|
|
77826
|
+
if(!ic.resid2cnt.hasOwnProperty(resid1)) {
|
|
77827
|
+
ic.resid2cnt[resid1] = 0;
|
|
77828
|
+
}
|
|
77829
|
+
else {
|
|
77830
|
+
++ic.resid2cnt[resid1];
|
|
77831
|
+
}
|
|
77832
|
+
|
|
77833
|
+
let x2, y2, angle;
|
|
77834
|
+
if(!bNotDrawNode && !ic.resid2ToXy.hasOwnProperty(resid2Real)) {
|
|
77835
|
+
// 1st and ideal way to find a position. If failed, use the 2nd way
|
|
77836
|
+
let xGrid = parseInt(x1 / ic.svgGridSize);
|
|
77837
|
+
let yGrid = parseInt(y1 / ic.svgGridSize);
|
|
77838
|
+
let gridArray = [];
|
|
77839
|
+
for(let i = 1; i >= -1; --i) { // try right-bottom first
|
|
77840
|
+
for(let j = 1; j >= -1; --j) {
|
|
77841
|
+
if(!(i == 0 && j == 0)) {
|
|
77842
|
+
if(xGrid + i >= 0 && xGrid + i <= xlen && yGrid + j >= 0 && yGrid + j <= ylen) gridArray.push((xGrid + i) + '_' + (yGrid + j));
|
|
77843
|
+
}
|
|
77844
|
+
}
|
|
77845
|
+
}
|
|
77846
|
+
for(let i = 2; i >= -2; --i) { // try right-bottom first
|
|
77847
|
+
for(let j = 2; j >= -2; --j) {
|
|
77848
|
+
if(!(i >= -1 && i <= 1 && j >= -1 && j <= 1 )) {
|
|
77849
|
+
if(xGrid + i >= 0 && xGrid + i <= xlen && yGrid + j >= 0 && yGrid + j <= ylen) gridArray.push((xGrid + i) + '_' + (yGrid + j));
|
|
77850
|
+
}
|
|
77851
|
+
}
|
|
77852
|
+
}
|
|
77853
|
+
|
|
77854
|
+
let bFound = false, xyGrids;
|
|
77855
|
+
for(let i = 0, il = gridArray.length; i < il; ++i) {
|
|
77856
|
+
if(!ic.gridXY2used[gridArray[i]]) { // found a spot to put the residue
|
|
77857
|
+
xyGrids = gridArray[i].split('_');
|
|
77858
|
+
x2 = (parseInt(xyGrids[0]) + 0.5) * ic.svgGridSize;
|
|
77859
|
+
y2 = (parseInt(xyGrids[1]) + 0.5) * ic.svgGridSize;
|
|
77860
|
+
|
|
77861
|
+
let dist = Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
|
|
77862
|
+
let x2b = bondLen / dist * (x2 - x1) + x1;
|
|
77863
|
+
let y2b = bondLen / dist * (y2 - y1) + y1;
|
|
77864
|
+
x2 = x2b;
|
|
77865
|
+
y2 = y2b;
|
|
77866
|
+
|
|
77867
|
+
ic.gridXY2used[gridArray[i]] = 1;
|
|
77868
|
+
bFound = true;
|
|
77869
|
+
break;
|
|
77870
|
+
}
|
|
77871
|
+
}
|
|
77872
|
+
|
|
77873
|
+
if(!bFound) {
|
|
77874
|
+
// 2nd way to find a position from the center to the outside
|
|
77875
|
+
let dx = x1 - xcenter;
|
|
77876
|
+
let dy = y1 - ycenter;
|
|
77877
|
+
|
|
77878
|
+
let baseAngle = 0;
|
|
77879
|
+
if(Math.abs(dx) > Math.abs(dy)) { // extend along x-axis
|
|
77880
|
+
if(dx > 0) { // +x direction
|
|
77881
|
+
baseAngle = 0;
|
|
77882
|
+
}
|
|
77883
|
+
else { // -x direction
|
|
77884
|
+
baseAngle = 180;
|
|
77885
|
+
}
|
|
77886
|
+
}
|
|
77887
|
+
else { // extend along y-axis
|
|
77888
|
+
if(dy > 0) { // +y direction
|
|
77889
|
+
baseAngle = 90;
|
|
77890
|
+
}
|
|
77891
|
+
else { // -y direction
|
|
77892
|
+
baseAngle = 270;
|
|
77893
|
+
}
|
|
77894
|
+
}
|
|
77895
|
+
angle = baseAngle - 10 + ic.resid2cnt[resid1] * 30;
|
|
77896
|
+
|
|
77897
|
+
x2 = x1 + bondLen * Math.cos(angle * Math.PI/180);
|
|
77898
|
+
y2 = y1 + bondLen * Math.sin(angle * Math.PI/180);
|
|
77899
|
+
}
|
|
77900
|
+
}
|
|
77901
|
+
|
|
77902
|
+
let oneLetterRes = me.utilsCls.residueName2Abbr(atom2.resn.substr(0, 3));
|
|
77903
|
+
let resName2 = oneLetterRes + atom2.resi;
|
|
77904
|
+
let textColor2 = (atom2.color) ? atom2.color.getHexString() : '000';
|
|
77905
|
+
let lineColor = ic.lineGraphCls.getStrokecolor(undefined, interactionType);
|
|
77906
|
+
|
|
77907
|
+
// let node = '<circle cx="' + x2 + '" cy="' + y2 + '" r="8" fill="#' + textColor2 + '" stroke-width="1" stroke="' + textColor2 + '" resid="' + resid2 + '"></circle>\n<text x="' + x2 + '" y="' + y2 + '" stroke="#000" stroke-width="1px" text-anchor="middle" alignment-baseline="central" font-size="8px">' + resName2 + '</text>';
|
|
77908
|
+
|
|
77909
|
+
let node = '', line = '';
|
|
77910
|
+
|
|
77911
|
+
// id can't contain comma and thus use '-'
|
|
77912
|
+
// sometimes the same ligand atom is used in both Hbond and contact. THus we add "interactionType"
|
|
77913
|
+
let idpair = resid2Real + '--' + serialArray1.join('-') + interactionType;
|
|
77914
|
+
|
|
77915
|
+
let id = resid2Real;
|
|
77916
|
+
if(bNotDrawNode || ic.resid2ToXy.hasOwnProperty(id)) {
|
|
77917
|
+
x2 = (ic.resid2ToXy.hasOwnProperty(id)) ? ic.resid2ToXy[id].x2 : prevX2;
|
|
77918
|
+
y2 = (ic.resid2ToXy.hasOwnProperty(id)) ? ic.resid2ToXy[id].y2 : prevY2;
|
|
77919
|
+
|
|
77920
|
+
// draw a short line from x2, y2 to x1, y1 with the distance shortBondLen
|
|
77921
|
+
let x1b = x1, y1b = y1, bShort = 0;
|
|
77922
|
+
if(interactionType == 'contact') {
|
|
77923
|
+
let dist = Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
|
|
77924
|
+
if(shortBondLen < dist) {
|
|
77925
|
+
x1b = shortBondLen / dist * (x1 - x2) + x2;
|
|
77926
|
+
y1b = shortBondLen / dist * (y1 - y2) + y2;
|
|
77927
|
+
bShort = 1;
|
|
77928
|
+
}
|
|
77929
|
+
}
|
|
77930
|
+
|
|
77931
|
+
line += '<line id="' + idpair + '" x1="' + x1b.toFixed(2) + '" y1="' + y1b.toFixed(2) + '" x2="' + x2.toFixed(2) + '" y2="' + y2.toFixed(2) + '" x0="' + x1.toFixed(2) + '" y0="' + y1.toFixed(2) + '" short="' + bShort + '" opacity="1.0" stroke="' + lineColor + '" stroke-width="' + strokeWidth + '" stroke-dasharray="5,5"/>\n';
|
|
77932
|
+
}
|
|
77933
|
+
else {
|
|
77934
|
+
node +='<g>';
|
|
77935
|
+
node += '<title>' + resName2 + '</title>';
|
|
77936
|
+
// node += '<circle class='icn3d-ctnode' cx="' + x2.toFixed(2) + '" cy="' + y2.toFixed(2) + '" r="10" fill="#' + textColor2 + '" stroke-width="1" stroke="' + textColor2 + '" resid="' + resid2Real + '"/>';
|
|
77937
|
+
let boxWidth = 28, boxHeight = 14;
|
|
77938
|
+
node += '<rect id="' + id + '_node" x="' + (x2 - boxWidth*0.5).toFixed(2) + '" y="' + (y2 - boxHeight*0.5).toFixed(2) + '" width="' + boxWidth + '" height="' + boxHeight + '" rx="2" ry="2" fill="#' + textColor2 + '" stroke-width="1" stroke="' + textColor2 + '" resid="' + resid2Real + '"/>';
|
|
77939
|
+
|
|
77940
|
+
node += '<text class="icn3d-ctnode" resid="' + id + '" id="' + id + '" x="' + x2.toFixed(2) + '" y="' + y2.toFixed(2) + '" fill="#000" stroke="none" text-anchor="middle" alignment-baseline="central" style="font-size:10px">' + resName2 + '</text>';
|
|
77941
|
+
node += '</g>\n';
|
|
77942
|
+
|
|
77943
|
+
line += '<line id="' + idpair + '" x1="' + x1.toFixed(2) + '" y1="' + y1.toFixed(2) + '" x2="' + x2.toFixed(2) + '" y2="' + y2.toFixed(2) + '" opacity="1.0" stroke="' + lineColor + '" stroke-width="' + strokeWidth + '" stroke-dasharray="5,5"/>\n';
|
|
77944
|
+
|
|
77945
|
+
if(interactionType != 'contact') {
|
|
77946
|
+
if(!ic.resid2ToXy.hasOwnProperty(resid2Real)) ic.resid2ToXy[resid2Real] = {x2: x2, y2: y2};
|
|
77947
|
+
}
|
|
77948
|
+
}
|
|
77949
|
+
|
|
77950
|
+
if(!ic.nodeid2lineid.hasOwnProperty(id)) ic.nodeid2lineid[id] = [];
|
|
77951
|
+
ic.nodeid2lineid[id].push(idpair);
|
|
77952
|
+
|
|
77953
|
+
return {node: node, line: line, x2: x2, y2: y2};
|
|
77954
|
+
}
|
|
77955
|
+
|
|
77956
|
+
setEventsForLigplot() { let ic = this.icn3d, me = ic.icn3dui;
|
|
77957
|
+
//https://stackoverflow.com/questions/1108480/svg-draggable-using-jquery-and-jquery-svg
|
|
77958
|
+
$("#" + me.ligplotid + " .icn3d-ctnode")
|
|
77959
|
+
.draggable({
|
|
77960
|
+
start: function( e, ui ) {
|
|
77961
|
+
let oriX= parseFloat(e.target.getAttribute('x'));
|
|
77962
|
+
let oriY = parseFloat(e.target.getAttribute('y'));
|
|
77963
|
+
|
|
77964
|
+
e.target.setAttribute('x', oriX);
|
|
77965
|
+
e.target.setAttribute('y', oriY);
|
|
77966
|
+
},
|
|
77967
|
+
drag: function( e, ui ) {
|
|
77968
|
+
let offsetX = $("#" + me.ligplotid).offset().left + ic.len4ang; // ic.len4ang was defined in svg viewbox
|
|
77969
|
+
let offsetY = $("#" + me.ligplotid).offset().top + ic.len4ang;
|
|
77970
|
+
|
|
77971
|
+
let id = e.target.getAttribute('resid');
|
|
77972
|
+
let x = (e.clientX - offsetX);
|
|
77973
|
+
let y = (e.clientY - offsetY);
|
|
77974
|
+
|
|
77975
|
+
let oriX = parseFloat(e.target.getAttribute('x'));
|
|
77976
|
+
let oriY = parseFloat(e.target.getAttribute('y'));
|
|
77977
|
+
|
|
77978
|
+
// change for each step
|
|
77979
|
+
let dx = (x - oriX) / ic.resizeRatioX;
|
|
77980
|
+
let dy = (y - oriY) / ic.resizeRatioY;
|
|
77981
|
+
|
|
77982
|
+
// move the text label
|
|
77983
|
+
oriX = parseFloat($("#" + id + "_node").attr('x'));
|
|
77984
|
+
oriY = parseFloat($("#" + id + "_node").attr('y'));
|
|
77985
|
+
|
|
77986
|
+
$("#" + id + "_node").attr('x', oriX + dx);
|
|
77987
|
+
$("#" + id + "_node").attr('y', oriY + dy);
|
|
77988
|
+
|
|
77989
|
+
// update the center
|
|
77990
|
+
e.target.setAttribute('x', x);
|
|
77991
|
+
e.target.setAttribute('y', y);
|
|
77992
|
+
|
|
77993
|
+
// update the edges
|
|
77994
|
+
if(ic.nodeid2lineid[id]) {
|
|
77995
|
+
for(let i = 0, il = ic.nodeid2lineid[id].length; i < il; ++i) {
|
|
77996
|
+
let idpair = ic.nodeid2lineid[id][i];
|
|
77997
|
+
|
|
77998
|
+
updateEdges(idpair, id);
|
|
77999
|
+
}
|
|
78000
|
+
}
|
|
78001
|
+
|
|
78002
|
+
function updateEdges(idpair, id) {
|
|
78003
|
+
if(idpair && idpair.indexOf(id) != -1) {
|
|
78004
|
+
let idArray = idpair.split('--');
|
|
78005
|
+
if(idArray.length == 2) {
|
|
78006
|
+
let id2;
|
|
78007
|
+
id2 = idArray[0];
|
|
78008
|
+
|
|
78009
|
+
let x2 = parseFloat($("#" + id2).attr('x'));
|
|
78010
|
+
let y2 = parseFloat($("#" + id2).attr('y'));
|
|
78011
|
+
|
|
78012
|
+
$("#" + idpair).attr('x2', x2);
|
|
78013
|
+
$("#" + idpair).attr('y2', y2);
|
|
78014
|
+
|
|
78015
|
+
let x1 = $("#" + idpair).attr('x1');
|
|
78016
|
+
let y1 = $("#" + idpair).attr('y1');
|
|
78017
|
+
let x1b = x1, y1b = y1;
|
|
78018
|
+
|
|
78019
|
+
let bShort = parseInt($("#" + idpair).attr('short'));
|
|
78020
|
+
if(bShort) { // adjust x1,y1
|
|
78021
|
+
x1 = $("#" + idpair).attr('x0');
|
|
78022
|
+
y1 = $("#" + idpair).attr('y0');
|
|
78023
|
+
|
|
78024
|
+
let dist = Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
|
|
78025
|
+
let shortBondLen = ic.len4ang / 2;
|
|
78026
|
+
|
|
78027
|
+
if(shortBondLen < dist) {
|
|
78028
|
+
x1b = shortBondLen / dist * (x1 - x2) + x2;
|
|
78029
|
+
y1b = shortBondLen / dist * (y1 - y2) + y2;
|
|
78030
|
+
}
|
|
78031
|
+
}
|
|
78032
|
+
|
|
78033
|
+
$("#" + idpair).attr('x1', x1b);
|
|
78034
|
+
$("#" + idpair).attr('y1', y1b);
|
|
78035
|
+
}
|
|
78036
|
+
} // if
|
|
78037
|
+
} // function
|
|
78038
|
+
}
|
|
78039
|
+
});
|
|
78040
|
+
}
|
|
78041
|
+
|
|
78042
|
+
clickLigplot() { let ic = this.icn3d; ic.icn3dui;
|
|
78043
|
+
let thisClass = this;
|
|
78044
|
+
|
|
78045
|
+
$(document).on("click", "#" + ic.pre + "dl_ligplot .icn3d-ctnode", function(e) { let ic = thisClass.icn3d;
|
|
78046
|
+
e.stopImmediatePropagation();
|
|
78047
|
+
|
|
78048
|
+
ic.diagram2dCls.clickNode(this);
|
|
78049
|
+
});
|
|
78050
|
+
}
|
|
78051
|
+
}
|
|
78052
|
+
|
|
77402
78053
|
/**
|
|
77403
78054
|
* @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
|
|
77404
78055
|
*/
|
|
@@ -78082,7 +78733,7 @@ class SaveFile {
|
|
|
78082
78733
|
}
|
|
78083
78734
|
}
|
|
78084
78735
|
|
|
78085
|
-
saveSvg(id, filename, bContactmap) { let ic = this.icn3d, me = ic.icn3dui;
|
|
78736
|
+
saveSvg(id, filename, bContactmap, bLigplot) { let ic = this.icn3d, me = ic.icn3dui;
|
|
78086
78737
|
if(me.bNode) return '';
|
|
78087
78738
|
|
|
78088
78739
|
let width = $("#" + id).width();
|
|
@@ -78090,19 +78741,26 @@ class SaveFile {
|
|
|
78090
78741
|
|
|
78091
78742
|
if(bContactmap) height = width;
|
|
78092
78743
|
|
|
78093
|
-
|
|
78744
|
+
if(bLigplot) {
|
|
78745
|
+
width += ic.len4ang;
|
|
78746
|
+
height += ic.len4ang;
|
|
78747
|
+
}
|
|
78748
|
+
|
|
78749
|
+
let svgXml = this.getSvgXml(id, width, height, bContactmap, bLigplot);
|
|
78094
78750
|
|
|
78095
78751
|
let blob = new Blob([svgXml], {type: "image/svg+xml"});
|
|
78096
78752
|
saveAs(blob, filename);
|
|
78097
78753
|
}
|
|
78098
78754
|
|
|
78099
|
-
getSvgXml(id, width, height, bContactmap) { let ic = this.icn3d, me = ic.icn3dui;
|
|
78755
|
+
getSvgXml(id, width, height, bContactmap, bLigplot) { let ic = this.icn3d, me = ic.icn3dui;
|
|
78100
78756
|
if(me.bNode) return '';
|
|
78101
78757
|
|
|
78102
78758
|
// font is not good
|
|
78103
78759
|
let svg_data = document.getElementById(id).innerHTML; //put id of your svg element here
|
|
78104
78760
|
|
|
78105
|
-
let
|
|
78761
|
+
let startX = (bLigplot) ? -30 : 0;
|
|
78762
|
+
let startY = (bLigplot) ? -30 : 0;
|
|
78763
|
+
let viewbox = (width && height) ? "<svg viewBox=\"" + startX + " " + startY + " " + width + " " + height + "\"" : "<svg";
|
|
78106
78764
|
//let head = viewbox + " title=\"graph\" version=\"1.1\" xmlns:xl=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">";
|
|
78107
78765
|
let head = viewbox + " title=\"graph\" xmlns:xl=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">";
|
|
78108
78766
|
|
|
@@ -78114,7 +78772,7 @@ class SaveFile {
|
|
|
78114
78772
|
return full_svg;
|
|
78115
78773
|
}
|
|
78116
78774
|
|
|
78117
|
-
savePng(id, filename, bContactmap) { let ic = this.icn3d, me = ic.icn3dui;
|
|
78775
|
+
savePng(id, filename, bContactmap, bLigplot) { let ic = this.icn3d, me = ic.icn3dui;
|
|
78118
78776
|
if(me.bNode) return '';
|
|
78119
78777
|
|
|
78120
78778
|
let width = $("#" + id).width();
|
|
@@ -78127,7 +78785,7 @@ class SaveFile {
|
|
|
78127
78785
|
let bbox = svg.getBBox();
|
|
78128
78786
|
|
|
78129
78787
|
let copy = svg.cloneNode(true);
|
|
78130
|
-
ic.lineGraphCls.copyStylesInline(copy, svg);
|
|
78788
|
+
if(!bLigplot) ic.lineGraphCls.copyStylesInline(copy, svg);
|
|
78131
78789
|
let canvas = document.createElement("CANVAS");
|
|
78132
78790
|
canvas.width = width;
|
|
78133
78791
|
canvas.height = height;
|
|
@@ -81920,6 +82578,7 @@ class iCn3D {
|
|
|
81920
82578
|
this.shareLinkCls = new ShareLink(this);
|
|
81921
82579
|
this.diagram2dCls = new Diagram2d(this);
|
|
81922
82580
|
this.cartoon2dCls = new Cartoon2d(this);
|
|
82581
|
+
this.ligplotCls = new Ligplot(this);
|
|
81923
82582
|
|
|
81924
82583
|
this.rayCls = new Ray(this);
|
|
81925
82584
|
this.controlCls = new Control(this);
|
|
@@ -82146,7 +82805,7 @@ class iCn3DUI {
|
|
|
82146
82805
|
//even when multiple iCn3D viewers are shown together.
|
|
82147
82806
|
this.pre = this.cfg.divid + "_";
|
|
82148
82807
|
|
|
82149
|
-
this.REVISION = '3.
|
|
82808
|
+
this.REVISION = '3.34.0';
|
|
82150
82809
|
|
|
82151
82810
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
82152
82811
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|
|
@@ -82589,7 +83248,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
82589
83248
|
|
|
82590
83249
|
ic.bChainAlign = true;
|
|
82591
83250
|
ic.inputid = me.cfg.chainalign;
|
|
82592
|
-
|
|
83251
|
+
let resrangeStr = (me.cfg.resrange) ? ' | resrange ' + me.cfg.resrange : '';
|
|
83252
|
+
ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + me.cfg.resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara + resrangeStr;
|
|
82593
83253
|
me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
|
|
82594
83254
|
await ic.chainalignParserCls.downloadChainalignment(me.cfg.chainalign);
|
|
82595
83255
|
}
|