icn3d 3.29.0 → 3.29.2
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 +240 -29
- package/icn3d.min.js +5 -7
- package/icn3d.module.js +240 -29
- package/package.json +1 -1
package/icn3d.js
CHANGED
|
@@ -5957,6 +5957,10 @@ class ClickMenu {
|
|
|
5957
5957
|
me.myEventCls.onIds("#" + me.pre + "mn1_selection", "click", function(e) { me.icn3d; //e.preventDefault();
|
|
5958
5958
|
me.htmlCls.dialogCls.openDlg('dl_selection', 'Please input the selection file');
|
|
5959
5959
|
});
|
|
5960
|
+
|
|
5961
|
+
me.myEventCls.onIds("#" + me.pre + "mn1_collection", "click", function (e) { me.icn3d; //e.preventDefault();
|
|
5962
|
+
me.htmlCls.dialogCls.openDlg('dl_collection', 'Please input the collection file');
|
|
5963
|
+
});
|
|
5960
5964
|
|
|
5961
5965
|
me.myEventCls.onIds("#" + me.pre + "mn1_dsn6", "click", function(e) { me.icn3d; //e.preventDefault();
|
|
5962
5966
|
me.htmlCls.dialogCls.openDlg('dl_dsn6', 'Please input the map file to display electron density map');
|
|
@@ -8546,6 +8550,7 @@ class SetMenu {
|
|
|
8546
8550
|
html += this.getLink('mn1_state', 'State/Script File', undefined, 2);
|
|
8547
8551
|
html += this.getLink('mn1_fixedversion', 'Share Link in Archived Ver. ' + me.htmlCls.wifiStr, undefined, 2);
|
|
8548
8552
|
html += this.getLink('mn1_selection', 'Selection File', undefined, 2);
|
|
8553
|
+
html += this.getLink("mn1_collection", "Collection File", undefined, 2);
|
|
8549
8554
|
|
|
8550
8555
|
html += this.getMenuSep();
|
|
8551
8556
|
|
|
@@ -8662,14 +8667,14 @@ class SetMenu {
|
|
|
8662
8667
|
}
|
|
8663
8668
|
|
|
8664
8669
|
//!!!
|
|
8665
|
-
|
|
8670
|
+
/*
|
|
8666
8671
|
html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
|
|
8667
8672
|
html += "<ul>";
|
|
8668
8673
|
html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
|
|
8669
8674
|
html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
|
|
8670
8675
|
html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
|
|
8671
8676
|
html += "</ul>";
|
|
8672
|
-
|
|
8677
|
+
*/
|
|
8673
8678
|
|
|
8674
8679
|
html += "<li><br/></li>";
|
|
8675
8680
|
|
|
@@ -9510,8 +9515,8 @@ class SetMenu {
|
|
|
9510
9515
|
//}
|
|
9511
9516
|
|
|
9512
9517
|
//!!!
|
|
9513
|
-
html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
|
|
9514
|
-
html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
|
|
9518
|
+
//html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
|
|
9519
|
+
//html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
|
|
9515
9520
|
}
|
|
9516
9521
|
else {
|
|
9517
9522
|
//if(!me.cfg.hidelicense) html += this.getRadio('mn4_clr', 'mn1_delphi2', 'DelPhi<br><span style="padding-left:1.5em;">Potential ' + me.htmlCls.licenseStr + '</span>');
|
|
@@ -9642,7 +9647,7 @@ class SetMenu {
|
|
|
9642
9647
|
html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
|
|
9643
9648
|
html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
|
|
9644
9649
|
//!!!
|
|
9645
|
-
html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
|
|
9650
|
+
//html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
|
|
9646
9651
|
html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
|
|
9647
9652
|
html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
|
|
9648
9653
|
}
|
|
@@ -9734,13 +9739,13 @@ class SetMenu {
|
|
|
9734
9739
|
|
|
9735
9740
|
html += "<ul>";
|
|
9736
9741
|
//!!!
|
|
9737
|
-
|
|
9742
|
+
/*
|
|
9738
9743
|
html += this.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
|
|
9739
9744
|
html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
|
|
9740
9745
|
html += this.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
|
|
9741
9746
|
|
|
9742
9747
|
html += this.getMenuSep();
|
|
9743
|
-
|
|
9748
|
+
*/
|
|
9744
9749
|
html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
|
|
9745
9750
|
html += "</ul>";
|
|
9746
9751
|
html += "</li>";
|
|
@@ -10966,11 +10971,26 @@ class SetDialog {
|
|
|
10966
10971
|
|
|
10967
10972
|
|
|
10968
10973
|
html += me.htmlCls.divStr + "dl_selection' class='" + dialogClass + "'>";
|
|
10969
|
-
html += this.addNotebookTitle('dl_selection', '
|
|
10974
|
+
html += this.addNotebookTitle('dl_selection', 'Please input the selection file');
|
|
10970
10975
|
html += "Selection file: " + me.htmlCls.inputFileStr + "id='" + me.pre + "selectionfile'><br/>";
|
|
10971
10976
|
html += me.htmlCls.buttonStr + "reload_selectionfile' style='margin-top: 6px;'>Load</button>";
|
|
10972
10977
|
html += "</div>";
|
|
10973
10978
|
|
|
10979
|
+
html += me.htmlCls.divStr + "dl_collection' class='" + dialogClass + "'>";
|
|
10980
|
+
html += this.addNotebookTitle('dl_collection', 'Please input the collection file');
|
|
10981
|
+
html += "You can load a collection of structures via a file. Here is <a href='https://github.com/ncbi/icn3d/blob/master/example/collection.json' target='_blank'>one example file</a><br><br>";
|
|
10982
|
+
html += "Collection file: " + me.htmlCls.inputFileStr + "id='" + me.pre + "collectionfile'><br/>";
|
|
10983
|
+
html += me.htmlCls.buttonStr + "reload_collectionfile' style='margin-top: 6px;'>Load</button>";
|
|
10984
|
+
html += "</div>";
|
|
10985
|
+
|
|
10986
|
+
html += me.htmlCls.divStr + "dl_selectCollections' class='" + dialogClass + "'>";
|
|
10987
|
+
html += me.htmlCls.divStr + "dl_collectionsMenu'>";
|
|
10988
|
+
html += "<b>Structures:</b> <br/>";
|
|
10989
|
+
html += "<select id='" + me.pre + "collections_menu' multiple size='6' style='min-width:130px;'>";
|
|
10990
|
+
html += "</select>";
|
|
10991
|
+
html += "</div>";
|
|
10992
|
+
html += "</div>";
|
|
10993
|
+
|
|
10974
10994
|
html += me.htmlCls.divStr + "dl_menuloadpref' class='" + dialogClass + "'>";
|
|
10975
10995
|
html += this.addNotebookTitle('dl_menuloadpref', 'Load a preference file');
|
|
10976
10996
|
html += "Preference file: " + me.htmlCls.inputFileStr + "id='" + me.pre + "menupreffile'><br/>";
|
|
@@ -13175,6 +13195,46 @@ class Events {
|
|
|
13175
13195
|
}
|
|
13176
13196
|
});
|
|
13177
13197
|
|
|
13198
|
+
me.myEventCls.onIds("#" + me.pre + "reload_collectionfile", "click", function (e) { let ic = me.icn3d;
|
|
13199
|
+
e.preventDefault();
|
|
13200
|
+
let file = $("#" + me.pre + "collectionfile")[0].files[0];
|
|
13201
|
+
if (!file) {
|
|
13202
|
+
var aaa = 1; //alert("Please select a file before clicking 'Load'");
|
|
13203
|
+
} else {
|
|
13204
|
+
if (!me.cfg.notebook) dialog.dialog("close");
|
|
13205
|
+
if (!me.cfg.notebook) {
|
|
13206
|
+
$(".ui-dialog-content").dialog("close");
|
|
13207
|
+
} else {
|
|
13208
|
+
ic.resizeCanvasCls.closeDialogs();
|
|
13209
|
+
}
|
|
13210
|
+
me.htmlCls.setHtmlCls.fileSupport();
|
|
13211
|
+
let reader = new FileReader();
|
|
13212
|
+
reader.onload = async function (e) {
|
|
13213
|
+
let dataStr = JSON.parse(e.target.result);
|
|
13214
|
+
let collection = [dataStr["structures"].map(({ id }) => id), dataStr["structures"].map(({ title }) => title)];
|
|
13215
|
+
let collectionHtml = ic.selectCollectionsCls.setAtomMenu(collection[0], collection[1]);
|
|
13216
|
+
let bNoDuplicate = true;
|
|
13217
|
+
await ic.chainalignParserCls.downloadMmdbAf(collection[0][0], undefined, undefined, bNoDuplicate);
|
|
13218
|
+
|
|
13219
|
+
ic.opts["color"] = "structure";
|
|
13220
|
+
ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
|
|
13221
|
+
|
|
13222
|
+
$("#" + ic.pre + "collections_menu").html(collectionHtml);
|
|
13223
|
+
ic.selectCollectionsCls.clickStructure();
|
|
13224
|
+
|
|
13225
|
+
$("#" + ic.pre + "collections_menu").trigger("change");
|
|
13226
|
+
|
|
13227
|
+
me.htmlCls.clickMenuCls.setLogCmd(
|
|
13228
|
+
"load collection file " +
|
|
13229
|
+
$("#" + me.pre + "collectionfile").val(),
|
|
13230
|
+
false
|
|
13231
|
+
);
|
|
13232
|
+
};
|
|
13233
|
+
reader.readAsText(file);
|
|
13234
|
+
me.htmlCls.dialogCls.openDlg("dl_selectCollections", "Select Collections");
|
|
13235
|
+
}
|
|
13236
|
+
});
|
|
13237
|
+
|
|
13178
13238
|
me.myEventCls.onIds("#" + me.pre + "reload_dsn6file2fofc", "click", function(e) { let ic = me.icn3d;
|
|
13179
13239
|
e.preventDefault();
|
|
13180
13240
|
//if(!me.cfg.notebook) dialog.dialog( "close" );
|
|
@@ -37577,7 +37637,8 @@ class AnnoDomain {
|
|
|
37577
37637
|
for(let j = from; j <= to; ++j) {
|
|
37578
37638
|
// 0-based
|
|
37579
37639
|
let obj = {};
|
|
37580
|
-
|
|
37640
|
+
let resi = ic.ParserUtilsCls.getResi(chnid, j+1);
|
|
37641
|
+
obj[chnid + '_' + resi] = domainName;
|
|
37581
37642
|
ic.resid2domain[chnid].push(obj);
|
|
37582
37643
|
}
|
|
37583
37644
|
}
|
|
@@ -46137,7 +46198,7 @@ class LineGraph {
|
|
|
46137
46198
|
console.log("domainid: " + domainid);
|
|
46138
46199
|
}
|
|
46139
46200
|
|
|
46140
|
-
if(!
|
|
46201
|
+
if(!domainid2segs.hasOwnProperty(domainid) || queryData[0].score >= ic.domainid2score[domainid].split('_')[0]) {
|
|
46141
46202
|
ic.domainid2score[domainid] = queryData[0].score + '_' + queryData[0].frac_identical + '_' + queryData[0].num_res ;
|
|
46142
46203
|
|
|
46143
46204
|
ic.domainid2refpdbname[domainid] = refpdbname;
|
|
@@ -46217,6 +46278,7 @@ class LineGraph {
|
|
|
46217
46278
|
|
|
46218
46279
|
// combine domainid into chainid
|
|
46219
46280
|
let processedChainid = {};
|
|
46281
|
+
|
|
46220
46282
|
for(let domainid in ic.domainid2refpdbname) {
|
|
46221
46283
|
// remove the first round template
|
|
46222
46284
|
if(ic.domainid2refpdbname[domainid].substr(0,1) == '1') {
|
|
@@ -49689,6 +49751,7 @@ class ChainalignParser {
|
|
|
49689
49751
|
me.htmlCls.clickMenuCls.setLogCmd("Align " + mmdbid1 + " with " + mmdbid2, false);
|
|
49690
49752
|
|
|
49691
49753
|
let bNoAlert = true;
|
|
49754
|
+
|
|
49692
49755
|
let bAligned = this.processAlign(align, i, queryData, bEqualMmdbid, bEqualChain, bNoAlert);
|
|
49693
49756
|
|
|
49694
49757
|
if(bAligned) {
|
|
@@ -50200,7 +50263,6 @@ class ChainalignParser {
|
|
|
50200
50263
|
ic.qt_start_end[index] = align[0].segs;
|
|
50201
50264
|
|
|
50202
50265
|
let rmsd = align[0].super_rmsd;
|
|
50203
|
-
console.log();
|
|
50204
50266
|
|
|
50205
50267
|
let logStr = "alignment RMSD: " + rmsd.toPrecision(4);
|
|
50206
50268
|
if(me.cfg.aligntool == 'tmalign') logStr += "; TM-score: " + align[0].score.toPrecision(4);
|
|
@@ -50285,7 +50347,7 @@ console.log();
|
|
|
50285
50347
|
}
|
|
50286
50348
|
}
|
|
50287
50349
|
|
|
50288
|
-
async downloadMmdbAf(idlist, bQuery, vastplusAtype) { let ic = this.icn3d, me = ic.icn3dui;
|
|
50350
|
+
async downloadMmdbAf(idlist, bQuery, vastplusAtype, bNoDuplicate) { let ic = this.icn3d, me = ic.icn3dui;
|
|
50289
50351
|
let thisClass = this;
|
|
50290
50352
|
|
|
50291
50353
|
ic.structArray = (ic.structures) ? Object.keys(ic.structures) : [];
|
|
@@ -50304,11 +50366,17 @@ console.log();
|
|
|
50304
50366
|
let structArrayTmp = idlist.split(',');
|
|
50305
50367
|
|
|
50306
50368
|
let structArray = [];
|
|
50307
|
-
|
|
50369
|
+
|
|
50308
50370
|
for(let i = 0, il = structArrayTmp.length; i < il; ++i) {
|
|
50309
|
-
|
|
50371
|
+
let id = structArrayTmp[i].toUpperCase();
|
|
50372
|
+
// sometimes we want to load same structure multiple times
|
|
50373
|
+
if(!ic.structures.hasOwnProperty(id) && structArray.indexOf(id) == -1) {
|
|
50310
50374
|
structArray.push(structArrayTmp[i]);
|
|
50311
50375
|
}
|
|
50376
|
+
else {
|
|
50377
|
+
// only when bNoDuplicate is undefined/false, it's allowed to load multiple copies of the same structure
|
|
50378
|
+
if(!bNoDuplicate) structArray.push(structArrayTmp[i] + me.htmlCls.postfix);
|
|
50379
|
+
}
|
|
50312
50380
|
}
|
|
50313
50381
|
|
|
50314
50382
|
if(structArray.length == 0) return;
|
|
@@ -51743,7 +51811,6 @@ class MtzParser {
|
|
|
51743
51811
|
else {
|
|
51744
51812
|
sigma = await this.mtzParserBase(url, type, sigma, 'url');
|
|
51745
51813
|
|
|
51746
|
-
console.log("### sigma " + sigma);
|
|
51747
51814
|
//me.htmlCls.clickMenuCls.setLogCmd('set map ' + type + ' sigma ' + sigma + ' file mtz | ' + encodeURIComponent(url), true);
|
|
51748
51815
|
}
|
|
51749
51816
|
}
|
|
@@ -53783,6 +53850,7 @@ class RealignParser {
|
|
|
53783
53850
|
// reinitialize
|
|
53784
53851
|
ic.qt_start_end = [];
|
|
53785
53852
|
|
|
53853
|
+
let chainidHash = {};
|
|
53786
53854
|
for(let index = 0, indexl = chainidArray.length - 1; index < indexl; ++index) {
|
|
53787
53855
|
let fromStruct = chainidArray[index + 1].substr(0, chainidArray[index + 1].indexOf('_')); //.toUpperCase();
|
|
53788
53856
|
|
|
@@ -53790,6 +53858,8 @@ class RealignParser {
|
|
|
53790
53858
|
|
|
53791
53859
|
let chainTo = toStruct + chainidArray[0].substr(chainidArray[0].indexOf('_'));
|
|
53792
53860
|
let chainFrom = fromStruct + chainidArray[index + 1].substr(chainidArray[index + 1].indexOf('_'));
|
|
53861
|
+
chainidHash[chainTo] = 1;
|
|
53862
|
+
chainidHash[chainFrom] = 1;
|
|
53793
53863
|
|
|
53794
53864
|
chainidArray[0] = chainTo;
|
|
53795
53865
|
chainidArray[index + 1] = chainFrom;
|
|
@@ -53819,13 +53889,17 @@ class RealignParser {
|
|
|
53819
53889
|
// set ic.qt_start_end in alignCoords()
|
|
53820
53890
|
|
|
53821
53891
|
let result = ic.ParserUtilsCls.alignCoords(coord2, coord1, fromStruct, undefined, chainTo, chainFrom, index + 1, bChainAlign);
|
|
53892
|
+
|
|
53822
53893
|
hAtoms = me.hashUtilsCls.unionHash(hAtoms, result.hAtoms);
|
|
53823
53894
|
rmsd = parseFloat(result.rmsd);
|
|
53824
53895
|
}
|
|
53825
53896
|
|
|
53826
53897
|
// If rmsd from vastsrv is too large, realign the chains
|
|
53827
|
-
if(me.cfg.chainalign && !me.cfg.usepdbnum && me.cfg.resdef && rmsd > 5) {
|
|
53828
|
-
|
|
53898
|
+
//if(me.cfg.chainalign && !me.cfg.usepdbnum && me.cfg.resdef && rmsd > 5) {
|
|
53899
|
+
if(!me.cfg.usepdbnum && me.cfg.resdef && rmsd > 5) {
|
|
53900
|
+
console.log("RMSD from VAST is larger than 5. Realign the chains with TM-align.");
|
|
53901
|
+
//let nameArray = me.cfg.chainalign.split(',');
|
|
53902
|
+
let nameArray = Object.keys(chainidHash);
|
|
53829
53903
|
if(nameArray.length > 0) {
|
|
53830
53904
|
ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
|
|
53831
53905
|
}
|
|
@@ -54269,7 +54343,7 @@ class RealignParser {
|
|
|
54269
54343
|
struct2resid[chainid] = [];
|
|
54270
54344
|
}
|
|
54271
54345
|
|
|
54272
|
-
if(bPredefined) {
|
|
54346
|
+
if(bPredefined) {
|
|
54273
54347
|
//base = parseInt(ic.chainsSeq[chainid][0].resi);
|
|
54274
54348
|
|
|
54275
54349
|
if(i == 0) ;
|
|
@@ -54285,6 +54359,7 @@ class RealignParser {
|
|
|
54285
54359
|
|
|
54286
54360
|
// master
|
|
54287
54361
|
resiArray = predefinedResPair[0].split(",");
|
|
54362
|
+
|
|
54288
54363
|
result = thisClass.getSeqCoorResid(resiArray, chainid_t);
|
|
54289
54364
|
|
|
54290
54365
|
hAtoms = me.hashUtilsCls.unionHash(hAtoms, result.hAtoms);
|
|
@@ -54299,6 +54374,7 @@ class RealignParser {
|
|
|
54299
54374
|
|
|
54300
54375
|
// slave
|
|
54301
54376
|
resiArray = predefinedResPair[1].split(",");
|
|
54377
|
+
|
|
54302
54378
|
result = thisClass.getSeqCoorResid(resiArray, chainid);
|
|
54303
54379
|
hAtoms = me.hashUtilsCls.unionHash(hAtoms, result.hAtoms);
|
|
54304
54380
|
|
|
@@ -55524,6 +55600,7 @@ class ParserUtils {
|
|
|
55524
55600
|
if(rmsd) {
|
|
55525
55601
|
me.htmlCls.clickMenuCls.setLogCmd("realignment RMSD: " + rmsd.toPrecision(4), false);
|
|
55526
55602
|
let html = "<br><b>Realignment RMSD</b>: " + rmsd.toPrecision(4) + " Å<br><br>";
|
|
55603
|
+
|
|
55527
55604
|
if(ic.bAfMem && !me.cfg.chainalign) {
|
|
55528
55605
|
//if(window.dialog && window.dialog.hasClass('ui-dialog-content')) window.dialog.dialog( "close" );
|
|
55529
55606
|
html += me.utilsCls.getMemDesc();
|
|
@@ -56438,7 +56515,7 @@ class LoadAtomData {
|
|
|
56438
56515
|
if(!bTitle) ic.molTitle = '';
|
|
56439
56516
|
}
|
|
56440
56517
|
else { // mmdbid or mmcifid
|
|
56441
|
-
if(data.descr !== undefined) ic.molTitle
|
|
56518
|
+
if(data.descr !== undefined) ic.molTitle = data.descr.name;
|
|
56442
56519
|
if(type === 'mmdbid') {
|
|
56443
56520
|
let pdbidTmp = (isNaN(id)) ? id : data.pdbId;
|
|
56444
56521
|
let chainHash = {};
|
|
@@ -62069,7 +62146,7 @@ class DefinedSets {
|
|
|
62069
62146
|
}
|
|
62070
62147
|
|
|
62071
62148
|
//Set the menu of defined sets with an array of defined names "commandnameArray".
|
|
62072
|
-
setAtomMenu(commandnameArray) { let ic = this.icn3d
|
|
62149
|
+
setAtomMenu(commandnameArray) { let ic = this.icn3d, me = ic.icn3dui;
|
|
62073
62150
|
let html = "";
|
|
62074
62151
|
|
|
62075
62152
|
let nameArray1 =(ic.defNames2Residues !== undefined) ? Object.keys(ic.defNames2Residues) : [];
|
|
@@ -62078,12 +62155,22 @@ class DefinedSets {
|
|
|
62078
62155
|
let nameArrayTmp = nameArray1.concat(nameArray2).sort();
|
|
62079
62156
|
|
|
62080
62157
|
let nameArray = [];
|
|
62081
|
-
|
|
62082
|
-
|
|
62083
|
-
|
|
62084
|
-
|
|
62085
|
-
|
|
62086
|
-
|
|
62158
|
+
// $.each(nameArrayTmp, function(i, el){
|
|
62159
|
+
// if($.inArray(el, nameArray) === -1) nameArray.push(el);
|
|
62160
|
+
// });
|
|
62161
|
+
// nameArrayTmp.forEach(elem => {
|
|
62162
|
+
// if($.inArray(elem, nameArray) === -1) nameArray.push(elem);
|
|
62163
|
+
// });
|
|
62164
|
+
|
|
62165
|
+
let structureArray = Object.keys(me.utilsCls.getStructures(ic.dAtoms));
|
|
62166
|
+
|
|
62167
|
+
nameArrayTmp.forEach((elem) => {
|
|
62168
|
+
structureArray.forEach((structure) => {
|
|
62169
|
+
if (ic.defNames2Residues[elem] && ic.defNames2Residues[elem][0] && ic.defNames2Residues[elem][0].split("_")[0].includes(structure.split("_")[0])){
|
|
62170
|
+
if ($.inArray(elem, nameArray) === -1) nameArray.push(elem);
|
|
62171
|
+
}
|
|
62172
|
+
});
|
|
62173
|
+
});
|
|
62087
62174
|
|
|
62088
62175
|
//for(let i in ic.defNames2Atoms) {
|
|
62089
62176
|
for(let i = 0, il = nameArray.length; i < il; ++i) {
|
|
@@ -62649,6 +62736,129 @@ class DefinedSets {
|
|
|
62649
62736
|
|
|
62650
62737
|
}
|
|
62651
62738
|
|
|
62739
|
+
/**
|
|
62740
|
+
* @author Jack Lin <th3linja@yahoo.com> / https://github.com/ncbi/icn3d
|
|
62741
|
+
*/
|
|
62742
|
+
|
|
62743
|
+
class SelectCollections {
|
|
62744
|
+
constructor(icn3d) {
|
|
62745
|
+
this.icn3d = icn3d;
|
|
62746
|
+
}
|
|
62747
|
+
|
|
62748
|
+
//Set the menu of defined sets with an array of defined names "commandnameArray".
|
|
62749
|
+
setAtomMenu(nameArray, titleArray) {
|
|
62750
|
+
let ic = this.icn3d;
|
|
62751
|
+
ic.icn3dui;
|
|
62752
|
+
let html = "";
|
|
62753
|
+
let commandnameArray = [nameArray[0]];
|
|
62754
|
+
//for(let i in ic.defNames2Atoms) {
|
|
62755
|
+
for (let i = 0, il = nameArray.length; i < il; ++i) {
|
|
62756
|
+
let name = nameArray[i];
|
|
62757
|
+
let title = titleArray[i];
|
|
62758
|
+
|
|
62759
|
+
let atomHash;
|
|
62760
|
+
if (
|
|
62761
|
+
ic.defNames2Atoms !== undefined &&
|
|
62762
|
+
ic.defNames2Atoms.hasOwnProperty(name)
|
|
62763
|
+
) {
|
|
62764
|
+
let atomArray = ic.defNames2Atoms[name];
|
|
62765
|
+
|
|
62766
|
+
if (atomArray.length > 0) ic.atoms[atomArray[0]];
|
|
62767
|
+
} else if (
|
|
62768
|
+
ic.defNames2Residues !== undefined &&
|
|
62769
|
+
ic.defNames2Residues.hasOwnProperty(name)
|
|
62770
|
+
) {
|
|
62771
|
+
let residueArray = ic.defNames2Residues[name];
|
|
62772
|
+
if (residueArray.length > 0) {
|
|
62773
|
+
atomHash = ic.residues[residueArray[0]];
|
|
62774
|
+
if (atomHash) {
|
|
62775
|
+
ic.atoms[Object.keys(atomHash)[0]];
|
|
62776
|
+
}
|
|
62777
|
+
}
|
|
62778
|
+
}
|
|
62779
|
+
|
|
62780
|
+
if (commandnameArray.indexOf(name) != -1) {
|
|
62781
|
+
html +=
|
|
62782
|
+
"<option value='" +
|
|
62783
|
+
name +
|
|
62784
|
+
"' selected='selected'>" +
|
|
62785
|
+
title +
|
|
62786
|
+
"</option>";
|
|
62787
|
+
} else {
|
|
62788
|
+
html += "<option value='" + name + "'>" + title + "</option>";
|
|
62789
|
+
}
|
|
62790
|
+
}
|
|
62791
|
+
|
|
62792
|
+
return html;
|
|
62793
|
+
}
|
|
62794
|
+
|
|
62795
|
+
clickStructure() {
|
|
62796
|
+
let ic = this.icn3d,
|
|
62797
|
+
me = ic.icn3dui;
|
|
62798
|
+
let thisClass = this;
|
|
62799
|
+
|
|
62800
|
+
//me.myEventCls.onIds("#" + ic.pre + "atomsCustom", "change", function(e) { let ic = thisClass.icn3d;
|
|
62801
|
+
$("#" + ic.pre + "collections_menu").change(async function (e) {
|
|
62802
|
+
let ic = thisClass.icn3d;
|
|
62803
|
+
// ic.init()
|
|
62804
|
+
let nameArray = $(this).val();
|
|
62805
|
+
let nameStructure = $(this).find("option:selected").text();
|
|
62806
|
+
|
|
62807
|
+
ic.nameArray = nameArray;
|
|
62808
|
+
if (nameArray !== null) {
|
|
62809
|
+
ic.bShowHighlight = false;
|
|
62810
|
+
let bNoDuplicate = true;
|
|
62811
|
+
await ic.chainalignParserCls.downloadMmdbAf(nameArray.toString(), undefined, undefined, bNoDuplicate);
|
|
62812
|
+
|
|
62813
|
+
ic.dAtoms = {};
|
|
62814
|
+
ic.hAtoms = {};
|
|
62815
|
+
// ic.ssbondpnts = {};
|
|
62816
|
+
let chainIdHash = {};
|
|
62817
|
+
|
|
62818
|
+
for (const name in nameArray) {
|
|
62819
|
+
for (const key in ic.chains) {
|
|
62820
|
+
if (key.includes(nameArray[name])) {
|
|
62821
|
+
chainIdHash[key] = 1;
|
|
62822
|
+
if (ic.chains.hasOwnProperty(key)) {
|
|
62823
|
+
const innerDict = ic.chains[key];
|
|
62824
|
+
for (const innerKey in innerDict) {
|
|
62825
|
+
if (innerDict.hasOwnProperty(innerKey)) {
|
|
62826
|
+
ic.dAtoms[innerKey] = innerDict[innerKey];
|
|
62827
|
+
ic.hAtoms[innerKey] = innerDict[innerKey];
|
|
62828
|
+
}
|
|
62829
|
+
}
|
|
62830
|
+
}
|
|
62831
|
+
}
|
|
62832
|
+
}
|
|
62833
|
+
}
|
|
62834
|
+
|
|
62835
|
+
ic.transformCls.zoominSelection();
|
|
62836
|
+
ic.definedSetsCls.showSets();
|
|
62837
|
+
|
|
62838
|
+
|
|
62839
|
+
await ic.drawCls.draw();
|
|
62840
|
+
ic.saveFileCls.showTitle();
|
|
62841
|
+
|
|
62842
|
+
me.htmlCls.clickMenuCls.setLogCmd(
|
|
62843
|
+
"select structure " + "[" + nameStructure + "]",
|
|
62844
|
+
true
|
|
62845
|
+
);
|
|
62846
|
+
ic.bSelectResidue = false;
|
|
62847
|
+
}
|
|
62848
|
+
});
|
|
62849
|
+
|
|
62850
|
+
me.myEventCls.onIds(
|
|
62851
|
+
"#" + ic.pre + "collections_menu",
|
|
62852
|
+
"focus",
|
|
62853
|
+
function (e) {
|
|
62854
|
+
let ic = thisClass.icn3d;
|
|
62855
|
+
if (me.utilsCls.isMobile())
|
|
62856
|
+
$("#" + ic.pre + "collections_menu").val("");
|
|
62857
|
+
}
|
|
62858
|
+
);
|
|
62859
|
+
}
|
|
62860
|
+
}
|
|
62861
|
+
|
|
62652
62862
|
/**
|
|
62653
62863
|
* @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
|
|
62654
62864
|
*/
|
|
@@ -73853,7 +74063,8 @@ class iCn3D {
|
|
|
73853
74063
|
this.setSeqAlignCls = new SetSeqAlign(this);
|
|
73854
74064
|
|
|
73855
74065
|
this.applyCommandCls = new ApplyCommand(this);
|
|
73856
|
-
|
|
74066
|
+
this.definedSetsCls = new DefinedSets(this);
|
|
74067
|
+
this.selectCollectionsCls = new SelectCollections(this);
|
|
73857
74068
|
this.legendTableCls = new LegendTable(this);
|
|
73858
74069
|
this.loadScriptCls = new LoadScript(this);
|
|
73859
74070
|
this.selByCommCls = new SelectByCommand(this);
|
|
@@ -74100,7 +74311,7 @@ class iCn3DUI {
|
|
|
74100
74311
|
//even when multiple iCn3D viewers are shown together.
|
|
74101
74312
|
this.pre = this.cfg.divid + "_";
|
|
74102
74313
|
|
|
74103
|
-
this.REVISION = '3.29.
|
|
74314
|
+
this.REVISION = '3.29.1';
|
|
74104
74315
|
|
|
74105
74316
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
74106
74317
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|
|
@@ -74326,7 +74537,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
74326
74537
|
// load multiple PDBs
|
|
74327
74538
|
// ic.bNCBI = true;
|
|
74328
74539
|
ic.bMmdbafid = true;
|
|
74329
|
-
|
|
74540
|
+
|
|
74330
74541
|
let bQuery = true;
|
|
74331
74542
|
await ic.chainalignParserCls.downloadMmdbAf(mmdbafid, bQuery);
|
|
74332
74543
|
}
|