icn3d 3.34.1 → 3.34.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 +51 -52
- package/icn3d.min.js +5 -3
- package/icn3d.module.js +51 -52
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -16515,8 +16515,8 @@ class Events {
|
|
|
16515
16515
|
hostUrl = (pos == -1) ? hostUrl : hostUrl.substr(0, pos);
|
|
16516
16516
|
|
|
16517
16517
|
// some URLs from VAST search are like https://www.ncbi.nlm.nih.gov/Structure/vast/icn3d/
|
|
16518
|
-
if(hostUrl
|
|
16519
|
-
hostUrl = '
|
|
16518
|
+
if(hostUrl.indexOf('/vast/icn3d/')) {
|
|
16519
|
+
hostUrl = hostUrl.replace(/\/vast\/icn3d\//g, '/icn3d/');
|
|
16520
16520
|
}
|
|
16521
16521
|
|
|
16522
16522
|
ic.definedSetsCls.clickCustomAtoms();
|
|
@@ -39495,15 +39495,16 @@ class SetColor {
|
|
|
39495
39495
|
atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
|
|
39496
39496
|
|
|
39497
39497
|
for (let i in atoms) {
|
|
39498
|
-
|
|
39499
|
-
if(!atom.het) ++cnt;
|
|
39498
|
+
ic.atoms[i];
|
|
39499
|
+
// if(!atom.het) ++cnt;
|
|
39500
|
+
++cnt;
|
|
39500
39501
|
}
|
|
39501
39502
|
|
|
39502
39503
|
let lastTerSerialInv = (cnt > 1) ? 1 / (cnt - 1) : 1;
|
|
39503
39504
|
for (let i in atoms) {
|
|
39504
39505
|
let atom = ic.atoms[i];
|
|
39505
|
-
//atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(
|
|
39506
|
-
atom.color =
|
|
39506
|
+
// atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
|
|
39507
|
+
atom.color = me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
|
|
39507
39508
|
|
|
39508
39509
|
ic.atomPrevColors[i] = atom.color;
|
|
39509
39510
|
}
|
|
@@ -39517,14 +39518,16 @@ class SetColor {
|
|
|
39517
39518
|
atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
|
|
39518
39519
|
|
|
39519
39520
|
for (let i in atoms) {
|
|
39520
|
-
|
|
39521
|
-
if(!atom.het) ++cnt;
|
|
39521
|
+
ic.atoms[i];
|
|
39522
|
+
// if(!atom.het) ++cnt;
|
|
39523
|
+
++cnt;
|
|
39522
39524
|
}
|
|
39523
39525
|
|
|
39524
39526
|
let lastTerSerialInv = (cnt > 1) ? 1 / (cnt - 1) : 1;
|
|
39525
39527
|
for (let i in atoms) {
|
|
39526
39528
|
let atom = ic.atoms[i];
|
|
39527
|
-
atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
|
|
39529
|
+
// atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
|
|
39530
|
+
atom.color = me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
|
|
39528
39531
|
|
|
39529
39532
|
ic.atomPrevColors[i] = atom.color;
|
|
39530
39533
|
}
|
|
@@ -53859,16 +53862,17 @@ class ChainalignParser {
|
|
|
53859
53862
|
// calculate secondary structures with applyCommandDssp
|
|
53860
53863
|
//$.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
|
|
53861
53864
|
await ic.pdbParserCls.applyCommandDssp(true);
|
|
53862
|
-
|
|
53865
|
+
//!!!
|
|
53866
|
+
/*
|
|
53863
53867
|
// original version =============
|
|
53864
53868
|
// align PDB chains
|
|
53865
53869
|
for(let index in ic.pdbChainIndexHash) {
|
|
53866
53870
|
//ic.pdbChainIndexHash[index] = mmdbid_q_tmp + "_" + ic.chain_q + "_" + ic.mmdbid_t + "_" + ic.chain_t;
|
|
53867
53871
|
let idArray = ic.pdbChainIndexHash[index].split('_');
|
|
53868
53872
|
mmdbid_q = idArray[0];
|
|
53869
|
-
idArray[1];
|
|
53873
|
+
let chain_q = idArray[1];
|
|
53870
53874
|
mmdbid_t = idArray[2];
|
|
53871
|
-
idArray[3];
|
|
53875
|
+
let chain_t = idArray[3];
|
|
53872
53876
|
|
|
53873
53877
|
thisClass.transformStructure(mmdbid_q, index-1, 'query');
|
|
53874
53878
|
}
|
|
@@ -53878,7 +53882,7 @@ class ChainalignParser {
|
|
|
53878
53882
|
let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
|
|
53879
53883
|
let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
|
|
53880
53884
|
|
|
53881
|
-
let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split('
|
|
53885
|
+
let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(',') : [];
|
|
53882
53886
|
|
|
53883
53887
|
for(let index in ic.afChainIndexHash) {
|
|
53884
53888
|
let idArray = ic.afChainIndexHash[index].split('_');
|
|
@@ -53890,25 +53894,26 @@ class ChainalignParser {
|
|
|
53890
53894
|
let chain_t = idArray[3];
|
|
53891
53895
|
let chainid_t = mmdbid_t + '_' + chain_t;
|
|
53892
53896
|
|
|
53893
|
-
let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t).hAtoms : ic.chains[chainid_t];
|
|
53894
|
-
let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q).hAtoms : ic.chains[chainid_q];
|
|
53897
|
+
// let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t, true).hAtoms : ic.chains[chainid_t];
|
|
53898
|
+
// let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q, true).hAtoms : ic.chains[chainid_q];
|
|
53899
|
+
let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[0]], chainid_t, true).hAtoms : ic.chains[chainid_t];
|
|
53900
|
+
let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[index]], chainid_q, true).hAtoms : ic.chains[chainid_q];
|
|
53895
53901
|
// end of original version =============
|
|
53896
|
-
|
|
53897
|
-
|
|
53902
|
+
*/
|
|
53903
|
+
|
|
53898
53904
|
// new version to be done for VASTsrv ==============
|
|
53899
53905
|
// dynamically align pairs in all chainids
|
|
53900
53906
|
let ajaxArray = [], indexArray = [], struArray = [];
|
|
53901
53907
|
let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
|
|
53902
53908
|
let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
|
|
53903
53909
|
|
|
53904
|
-
let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split('
|
|
53910
|
+
let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(',') : [];
|
|
53905
53911
|
|
|
53906
53912
|
// dynamically align pairs in all chainids
|
|
53907
|
-
let atomSet_t = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0]
|
|
53913
|
+
let atomSet_t = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[0]], chainidArray[0], true).hAtoms : ic.chains[chainidArray[0]];
|
|
53908
53914
|
for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
|
|
53909
|
-
let atomSet_q = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index]
|
|
53915
|
+
let atomSet_q = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[index]], chainidArray[index], true).hAtoms : ic.chains[chainidArray[index]];
|
|
53910
53916
|
// end of new version to be done for VASTsrv ==============
|
|
53911
|
-
*/
|
|
53912
53917
|
|
|
53913
53918
|
let alignAjax;
|
|
53914
53919
|
if(me.cfg.aligntool != 'tmalign') {
|
|
@@ -54136,10 +54141,11 @@ class ChainalignParser {
|
|
|
54136
54141
|
|
|
54137
54142
|
// chainid1 is target
|
|
54138
54143
|
aligType = 'target';
|
|
54139
|
-
|
|
54144
|
+
let bForce = true;
|
|
54145
|
+
this.transformStructure(target, index, aligType, bForce);
|
|
54140
54146
|
|
|
54141
54147
|
aligType = 'query';
|
|
54142
|
-
this.transformStructure(query, index, aligType);
|
|
54148
|
+
this.transformStructure(query, index, aligType, bForce);
|
|
54143
54149
|
|
|
54144
54150
|
allChainidHash[chainidArray[0]] = 1;
|
|
54145
54151
|
allChainidHash[chainidArray[1]] = 1;
|
|
@@ -54817,8 +54823,12 @@ class ChainalignParser {
|
|
|
54817
54823
|
|
|
54818
54824
|
if(bQuery && me.cfg.matchedchains) {
|
|
54819
54825
|
// $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
|
|
54820
|
-
let bRealign = true, bPredefined = true;
|
|
54821
|
-
await ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
|
|
54826
|
+
// let bRealign = true, bPredefined = true;
|
|
54827
|
+
// await ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
|
|
54828
|
+
|
|
54829
|
+
ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(ic.chainidArray);
|
|
54830
|
+
await ic.realignParserCls.realignOnStructAlign();
|
|
54831
|
+
|
|
54822
54832
|
// reset annotations
|
|
54823
54833
|
$("#" + ic.pre + "dl_annotations").html("");
|
|
54824
54834
|
ic.bAnnoShown = false;
|
|
@@ -59389,7 +59399,7 @@ class RealignParser {
|
|
|
59389
59399
|
}
|
|
59390
59400
|
}
|
|
59391
59401
|
|
|
59392
|
-
getSeqCoorResid(resiArray, chainid) { let ic = this.icn3d, me = ic.icn3dui;
|
|
59402
|
+
getSeqCoorResid(resiArray, chainid, bNCBI) { let ic = this.icn3d, me = ic.icn3dui;
|
|
59393
59403
|
let seq = '', coorArray = [], residArray = [];
|
|
59394
59404
|
let hAtoms = {};
|
|
59395
59405
|
|
|
@@ -59397,15 +59407,7 @@ class RealignParser {
|
|
|
59397
59407
|
if(resiArray[j].indexOf('-') != -1) {
|
|
59398
59408
|
let startEnd = resiArray[j].split('-');
|
|
59399
59409
|
for(let k = parseInt(startEnd[0]); k <= parseInt(startEnd[1]); ++k) {
|
|
59400
|
-
|
|
59401
|
-
//if(me.cfg.usepdbnum === false) k += base - 1;
|
|
59402
|
-
|
|
59403
|
-
//let seqIndex = k - base;
|
|
59404
|
-
let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
|
|
59405
|
-
// if(ic.bNCBI) {
|
|
59406
|
-
// let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
|
|
59407
|
-
// if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
|
|
59408
|
-
// }
|
|
59410
|
+
let seqIndex = (bNCBI) ? k : ic.setSeqAlignCls.getPosFromResi(chainid, k);
|
|
59409
59411
|
|
|
59410
59412
|
// don't align solvent or chemicals
|
|
59411
59413
|
if(!ic.chainsSeq[chainid] || !ic.chainsSeq[chainid][seqIndex] || me.parasCls.b62ResArray.indexOf(ic.chainsSeq[chainid][seqIndex].name.toUpperCase()) == -1) continue;
|
|
@@ -59417,20 +59419,14 @@ class RealignParser {
|
|
|
59417
59419
|
residArray.push(chainid + '_' + k);
|
|
59418
59420
|
}
|
|
59419
59421
|
}
|
|
59422
|
+
else if(resiArray[j] == 0) { // 0 means the whole chain
|
|
59423
|
+
let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.chains[chainid]);
|
|
59424
|
+
residArray = Object.keys(residueHash);
|
|
59425
|
+
}
|
|
59420
59426
|
else { // one residue
|
|
59421
|
-
|
|
59422
|
-
//let k = parseInt(resiArray[j]);
|
|
59423
59427
|
let k = resiArray[j];
|
|
59424
|
-
// from VAST neighbor page, use NCBI residue number
|
|
59425
|
-
//if(me.cfg.usepdbnum === false) k += base - 1;
|
|
59426
|
-
|
|
59427
|
-
//let seqIndex = k - base;
|
|
59428
|
-
let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
|
|
59429
59428
|
|
|
59430
|
-
|
|
59431
|
-
// let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
|
|
59432
|
-
// if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
|
|
59433
|
-
// }
|
|
59429
|
+
let seqIndex = (bNCBI) ? k : ic.setSeqAlignCls.getPosFromResi(chainid, k);
|
|
59434
59430
|
|
|
59435
59431
|
if(!ic.chainsSeq[chainid][seqIndex]) continue;
|
|
59436
59432
|
|
|
@@ -69431,9 +69427,10 @@ class LoadScript {
|
|
|
69431
69427
|
|
|
69432
69428
|
if(command.indexOf('load') !== -1) { // 'load pdb [pdbid]'
|
|
69433
69429
|
let load_parameters = command.split(' | ');
|
|
69434
|
-
|
|
69435
69430
|
let loadStr = load_parameters[0];
|
|
69436
|
-
|
|
69431
|
+
|
|
69432
|
+
// do not reset me.cfg.inpara from "command=..." part if it was not empty
|
|
69433
|
+
if(load_parameters.length > 1 && !me.cfg.inpara) {
|
|
69437
69434
|
let firstSpacePos = load_parameters[load_parameters.length - 1].indexOf(' ');
|
|
69438
69435
|
me.cfg.inpara = load_parameters[load_parameters.length - 1].substr(firstSpacePos + 1);
|
|
69439
69436
|
if(me.cfg.inpara === 'undefined') {
|
|
@@ -82811,7 +82808,7 @@ class iCn3DUI {
|
|
|
82811
82808
|
//even when multiple iCn3D viewers are shown together.
|
|
82812
82809
|
this.pre = this.cfg.divid + "_";
|
|
82813
82810
|
|
|
82814
|
-
this.REVISION = '3.34.
|
|
82811
|
+
this.REVISION = '3.34.1';
|
|
82815
82812
|
|
|
82816
82813
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
82817
82814
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|
|
@@ -83001,7 +82998,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
83001
82998
|
await ic.realignParserCls.realignChainOnSeqAlign(undefined, chainidArray, bRealign, bPredefined);
|
|
83002
82999
|
}
|
|
83003
83000
|
}
|
|
83004
|
-
else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
|
|
83001
|
+
// else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
|
|
83002
|
+
else if(me.cfg.matchedchains !== undefined) {
|
|
83005
83003
|
let stru_t = Object.keys(ic.structures)[0];
|
|
83006
83004
|
|
|
83007
83005
|
let chain_t = stru_t + '_' + me.cfg.masterchain;
|
|
@@ -83029,7 +83027,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
83029
83027
|
ic.chainidArray = [chain_t].concat(chainidArray);
|
|
83030
83028
|
ic.chainidArray = ic.chainalignParserCls.addPostfixForChainids(ic.chainidArray);
|
|
83031
83029
|
|
|
83032
|
-
me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
|
|
83030
|
+
// me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
|
|
83033
83031
|
|
|
83034
83032
|
ic.loadCmd = 'vast_search_chainid ' + ic.chainidArray;
|
|
83035
83033
|
me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
|
|
@@ -83255,7 +83253,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
83255
83253
|
ic.bChainAlign = true;
|
|
83256
83254
|
ic.inputid = me.cfg.chainalign;
|
|
83257
83255
|
let resrangeStr = (me.cfg.resrange) ? ' | resrange ' + me.cfg.resrange : '';
|
|
83258
|
-
|
|
83256
|
+
let resdef = (me.cfg.resdef) ? me.cfg.resdef : '';
|
|
83257
|
+
ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara + resrangeStr;
|
|
83259
83258
|
me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
|
|
83260
83259
|
await ic.chainalignParserCls.downloadChainalignment(me.cfg.chainalign);
|
|
83261
83260
|
}
|