icn3d 3.51.3 → 3.52.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 +75 -33
- package/icn3d.min.js +3 -3
- package/icn3d.module.js +75 -33
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -102053,20 +102053,12 @@ class GetGraph {
|
|
|
102053
102053
|
let thickness = me.htmlCls.coilValue;
|
|
102054
102054
|
let prevChain = '', prevResName = '', prevResi = 0;
|
|
102055
102055
|
// add chemicals as well
|
|
102056
|
-
let residHash =
|
|
102057
|
-
for(let
|
|
102058
|
-
let atom = ic.
|
|
102056
|
+
let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(atomSet);
|
|
102057
|
+
for(let resid in residHash) {
|
|
102058
|
+
let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
|
|
102059
102059
|
|
|
102060
|
-
if(atom.chain != 'DUM' && (bAnyAtom || atom.het || (atom.name == "CA" && atom.elem == "C") || atom.name == "O3'" || atom.name == "O3*" || atom.name == "P")) {
|
|
102061
|
-
|
|
102062
|
-
//if(atom.chain != 'DUM' &&(atom.name == "CA" || atom.name == "P")) {
|
|
102063
|
-
let resid = atom.structure + '_' + atom.chain + '_' + atom.resi;
|
|
102064
|
-
if(residHash.hasOwnProperty(resid)) {
|
|
102065
|
-
continue;
|
|
102066
|
-
}
|
|
102067
|
-
else {
|
|
102068
|
-
residHash[resid] = 1;
|
|
102069
|
-
}
|
|
102060
|
+
//if(atom.chain != 'DUM' && (bAnyAtom || atom.het || (atom.name == "CA" && atom.elem == "C") || atom.name == "O3'" || atom.name == "O3*" || atom.name == "P")) {
|
|
102061
|
+
if(atom.chain != 'DUM') {
|
|
102070
102062
|
let resName = me.utilsCls.residueName2Abbr(atom.resn) + atom.resi;
|
|
102071
102063
|
if(labelType == 'chain' || labelType == 'structure') resName += '.' + atom.chain;
|
|
102072
102064
|
if(labelType == 'structure') resName += '.' + atom.structure;
|
|
@@ -109014,12 +109006,15 @@ class OpmParser {
|
|
|
109014
109006
|
|
|
109015
109007
|
async loadOpmData(data, pdbid, bFull, type, pdbid2, bText) { let ic = this.icn3d, me = ic.icn3dui;
|
|
109016
109008
|
try {
|
|
109017
|
-
|
|
109018
|
-
let url = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
|
|
109009
|
+
if(!pdbid) pdbid = ic.defaultPdbId;
|
|
109019
109010
|
|
|
109020
|
-
|
|
109021
|
-
|
|
109022
|
-
|
|
109011
|
+
//if(me.cfg.mmtfid === undefined && me.cfg.bcifid === undefined) { // skip opm for bcif files
|
|
109012
|
+
let url = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&opm&uid=" + pdbid.toLowerCase();
|
|
109013
|
+
|
|
109014
|
+
let opmdata = await me.getAjaxPromise(url, 'jsonp', false);
|
|
109015
|
+
|
|
109016
|
+
this.setOpmData(opmdata); // set ic.bOpm
|
|
109017
|
+
//}
|
|
109023
109018
|
|
|
109024
109019
|
await this.parseAtomData(data, pdbid, bFull, type, pdbid2, bText);
|
|
109025
109020
|
}
|
|
@@ -117196,6 +117191,36 @@ class LoadCIF {
|
|
|
117196
117191
|
this.icn3d = icn3d;
|
|
117197
117192
|
}
|
|
117198
117193
|
|
|
117194
|
+
// Fast replacements for ic.loadPDBCls.isSecondary(), which does a linear scan
|
|
117195
|
+
// ($.inArray, or a hand-rolled loop with a substr() per comparison for bNMR) over
|
|
117196
|
+
// residArray - and gets called up to 6 times per atom in the main atom loop below.
|
|
117197
|
+
// buildSecondarySet() precomputes, once per model, exactly what isSecondary would
|
|
117198
|
+
// have compared against on every call (the raw resid strings for non-NMR, or the
|
|
117199
|
+
// structure-prefix-stripped "chain_resi" strings for NMR - matching isSecondary's
|
|
117200
|
+
// two branches exactly), so membership becomes an O(1) Set lookup instead of an
|
|
117201
|
+
// O(residArray.length) scan repeated for every atom. isSecondary's 4th parameter
|
|
117202
|
+
// (bNonFull) is intentionally not replicated here: in the actual implementation
|
|
117203
|
+
// it's dead (the only reference to it is commented out), so it has no behavior to
|
|
117204
|
+
// preserve.
|
|
117205
|
+
buildSecondarySet(residArray, bNMR) {
|
|
117206
|
+
let s = new Set();
|
|
117207
|
+
if(!bNMR) {
|
|
117208
|
+
for(let i = 0, il = residArray.length; i < il; ++i) s.add(residArray[i]);
|
|
117209
|
+
}
|
|
117210
|
+
else {
|
|
117211
|
+
for(let i = 0, il = residArray.length; i < il; ++i) {
|
|
117212
|
+
let r = residArray[i];
|
|
117213
|
+
s.add(r.substr(r.indexOf('_') + 1));
|
|
117214
|
+
}
|
|
117215
|
+
}
|
|
117216
|
+
return s;
|
|
117217
|
+
}
|
|
117218
|
+
|
|
117219
|
+
isSecondaryFast(resid, secondarySet, bNMR) {
|
|
117220
|
+
if(!bNMR) return secondarySet.has(resid);
|
|
117221
|
+
return secondarySet.has(resid.substr(resid.indexOf('_') + 1));
|
|
117222
|
+
}
|
|
117223
|
+
|
|
117199
117224
|
loadCIF(bcifData, bcifid, bText, bAppend) { let ic = this.icn3d, me = ic.icn3dui;
|
|
117200
117225
|
let hAtoms = {};
|
|
117201
117226
|
|
|
@@ -117572,7 +117597,10 @@ class LoadCIF {
|
|
|
117572
117597
|
// check 3QUM
|
|
117573
117598
|
let chainArray = atom_site.getColumn("auth_asym_id");
|
|
117574
117599
|
|
|
117575
|
-
|
|
117600
|
+
// label_seq_id used to be fetched into "resiArray" here and decoded into
|
|
117601
|
+
// "resi" below, but that value was always immediately overwritten by
|
|
117602
|
+
// auth_seq_id (oriResi) before being used anywhere - decoding it per atom
|
|
117603
|
+
// was pure wasted work, so it is no longer fetched at all.
|
|
117576
117604
|
let resiOriArray = atom_site.getColumn("auth_seq_id");
|
|
117577
117605
|
let altArray = atom_site.getColumn("label_alt_id");
|
|
117578
117606
|
|
|
@@ -117585,6 +117613,14 @@ class LoadCIF {
|
|
|
117585
117613
|
let autochainArray = atom_site.getColumn("label_asym_id");
|
|
117586
117614
|
let modelNumArray = atom_site.getColumn("pdbx_PDB_model_num");
|
|
117587
117615
|
|
|
117616
|
+
// built once per model instead of scanned per atom - see isSecondaryFast()
|
|
117617
|
+
let sheetSet = this.buildSecondarySet(sheetArray, bNMR);
|
|
117618
|
+
let sheetStartSet = this.buildSecondarySet(sheetStart, bNMR);
|
|
117619
|
+
let sheetEndSet = this.buildSecondarySet(sheetEnd, bNMR);
|
|
117620
|
+
let helixSet = this.buildSecondarySet(helixArray, bNMR);
|
|
117621
|
+
let helixStartSet = this.buildSecondarySet(helixStart, bNMR);
|
|
117622
|
+
let helixEndSet = this.buildSecondarySet(helixEnd, bNMR);
|
|
117623
|
+
|
|
117588
117624
|
// get the bond info
|
|
117589
117625
|
let ligSeqHash = {}, prevAutochain = '';
|
|
117590
117626
|
let prevResn;
|
|
@@ -117611,14 +117647,13 @@ class LoadCIF {
|
|
|
117611
117647
|
let atom = nameArray.getString(i);
|
|
117612
117648
|
let entityid = entiyidArray.getString(i);
|
|
117613
117649
|
let chain = chainArray.getString(i);
|
|
117614
|
-
let resi = resiArray.getString(i);
|
|
117615
117650
|
let oriResi = resiOriArray.getString(i);
|
|
117616
117651
|
let alt = altArray.getString(i);
|
|
117617
117652
|
let bFactor = bArray.getString(i);
|
|
117618
117653
|
|
|
117619
117654
|
let autochain = autochainArray.getString(i);
|
|
117620
117655
|
|
|
117621
|
-
resi = oriResi;
|
|
117656
|
+
let resi = oriResi;
|
|
117622
117657
|
|
|
117623
117658
|
let molecueType;
|
|
117624
117659
|
if(atom_hetatm == "ATOM") {
|
|
@@ -117773,26 +117808,26 @@ class LoadCIF {
|
|
|
117773
117808
|
|
|
117774
117809
|
// Assign secondary structures from the input
|
|
117775
117810
|
// if a residue is assigned both sheet and helix, it is assigned as sheet
|
|
117776
|
-
if(
|
|
117811
|
+
if(this.isSecondaryFast(residueNum, sheetSet, bNMR)) {
|
|
117777
117812
|
ic.atoms[serial].ss = 'sheet';
|
|
117778
|
-
if(
|
|
117813
|
+
if(this.isSecondaryFast(residueNum, sheetStartSet, bNMR)) {
|
|
117779
117814
|
ic.atoms[serial].ssbegin = true;
|
|
117780
117815
|
}
|
|
117781
117816
|
|
|
117782
117817
|
// do not use else if. Some residues are both start and end of secondary structure
|
|
117783
|
-
if(
|
|
117818
|
+
if(this.isSecondaryFast(residueNum, sheetEndSet, bNMR)) {
|
|
117784
117819
|
ic.atoms[serial].ssend = true;
|
|
117785
117820
|
}
|
|
117786
117821
|
}
|
|
117787
|
-
else if(
|
|
117822
|
+
else if(this.isSecondaryFast(residueNum, helixSet, bNMR)) {
|
|
117788
117823
|
ic.atoms[serial].ss = 'helix';
|
|
117789
117824
|
|
|
117790
|
-
if(
|
|
117825
|
+
if(this.isSecondaryFast(residueNum, helixStartSet, bNMR)) {
|
|
117791
117826
|
ic.atoms[serial].ssbegin = true;
|
|
117792
117827
|
}
|
|
117793
117828
|
|
|
117794
117829
|
// do not use else if. Some residues are both start and end of secondary structure
|
|
117795
|
-
if(
|
|
117830
|
+
if(this.isSecondaryFast(residueNum, helixEndSet, bNMR)) {
|
|
117796
117831
|
ic.atoms[serial].ssend = true;
|
|
117797
117832
|
}
|
|
117798
117833
|
}
|
|
@@ -117910,7 +117945,7 @@ class LoadCIF {
|
|
|
117910
117945
|
*/
|
|
117911
117946
|
|
|
117912
117947
|
// clear memory
|
|
117913
|
-
atom_hetatmArray = resnArray = elemArray = nameArray = chainArray =
|
|
117948
|
+
atom_hetatmArray = resnArray = elemArray = nameArray = chainArray = resiOriArray
|
|
117914
117949
|
= altArray = bArray = xArray = yArray = zArray = autochainArray = [];
|
|
117915
117950
|
|
|
117916
117951
|
let mChainSeq = {};
|
|
@@ -118082,7 +118117,6 @@ class LoadCIF {
|
|
|
118082
118117
|
// check the bonds between chemicals and all other atoms
|
|
118083
118118
|
let processedChemicals = {};
|
|
118084
118119
|
for(let i in ic.chemicals) {
|
|
118085
|
-
console.log(" i = ", i, " processedChemicals = ", processedChemicals);
|
|
118086
118120
|
if(processedChemicals.hasOwnProperty(i)) continue;
|
|
118087
118121
|
|
|
118088
118122
|
let atom = ic.atoms[i];
|
|
@@ -121560,6 +121594,7 @@ class DefinedSets {
|
|
|
121560
121594
|
}
|
|
121561
121595
|
}
|
|
121562
121596
|
//}
|
|
121597
|
+
|
|
121563
121598
|
return residuesHash;
|
|
121564
121599
|
}
|
|
121565
121600
|
|
|
@@ -123490,6 +123525,8 @@ class Selection {
|
|
|
123490
123525
|
selectMainChains() { let ic = this.icn3d, me = ic.icn3dui;
|
|
123491
123526
|
let currHAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
|
|
123492
123527
|
|
|
123528
|
+
ic.opts.pk = 'atom';
|
|
123529
|
+
|
|
123493
123530
|
ic.hAtoms = ic.applyDisplayCls.selectMainChainSubset(currHAtoms);
|
|
123494
123531
|
|
|
123495
123532
|
ic.hlUpdateCls.showHighlight();
|
|
@@ -123499,6 +123536,8 @@ class Selection {
|
|
|
123499
123536
|
selectSideChains() { let ic = this.icn3d, me = ic.icn3dui;
|
|
123500
123537
|
let currHAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
|
|
123501
123538
|
|
|
123539
|
+
ic.opts.pk = 'atom';
|
|
123540
|
+
|
|
123502
123541
|
ic.hAtoms = this.getSideAtoms(currHAtoms);
|
|
123503
123542
|
ic.hlUpdateCls.showHighlight();
|
|
123504
123543
|
}
|
|
@@ -123520,6 +123559,8 @@ class Selection {
|
|
|
123520
123559
|
selectMainSideChains() { let ic = this.icn3d, me = ic.icn3dui;
|
|
123521
123560
|
let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.hAtoms);
|
|
123522
123561
|
|
|
123562
|
+
ic.opts.pk = 'residue';
|
|
123563
|
+
|
|
123523
123564
|
ic.hAtoms = {};
|
|
123524
123565
|
for(let resid in residHash) {
|
|
123525
123566
|
ic.hAtoms = me.hashUtilsCls.unionHash(ic.hAtoms, ic.residues[resid]);
|
|
@@ -123696,8 +123737,9 @@ class Selection {
|
|
|
123696
123737
|
description = name;
|
|
123697
123738
|
}
|
|
123698
123739
|
|
|
123699
|
-
if(Object.keys(ic.selectedResidues).length > 0) {
|
|
123700
|
-
if(ic.pk == 1) {
|
|
123740
|
+
//if(Object.keys(ic.selectedResidues).length > 0) {
|
|
123741
|
+
// if(ic.pk == 1) {
|
|
123742
|
+
if(ic.opts.pk == 'atom') {
|
|
123701
123743
|
let bAtom = true;
|
|
123702
123744
|
this.selectResidueList(ic.hAtoms, name, description, undefined, undefined, bAtom);
|
|
123703
123745
|
//ic.hlUpdateCls.updateHlAll();
|
|
@@ -123724,7 +123766,7 @@ class Selection {
|
|
|
123724
123766
|
me.htmlCls.clickMenuCls.setLogCmd('select ' + ic.resid2specCls.residueids2spec(Object.keys(ic.selectedResidues)), true);
|
|
123725
123767
|
}
|
|
123726
123768
|
}
|
|
123727
|
-
}
|
|
123769
|
+
//}
|
|
123728
123770
|
}
|
|
123729
123771
|
|
|
123730
123772
|
saveSelInCommand() { let ic = this.icn3d, me = ic.icn3dui;
|
|
@@ -136776,7 +136818,7 @@ class iCn3DUI {
|
|
|
136776
136818
|
//even when multiple iCn3D viewers are shown together.
|
|
136777
136819
|
this.pre = this.cfg.divid + "_";
|
|
136778
136820
|
|
|
136779
|
-
this.REVISION = '3.
|
|
136821
|
+
this.REVISION = '3.52.0';
|
|
136780
136822
|
|
|
136781
136823
|
// In nodejs, iCn3D defines "window = {navigator: {}}", and added window = {navigator: {}, "__THREE__":"177"}
|
|
136782
136824
|
this.bNode = (Object.keys(window).length < 3) ? true : false;
|