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.js
CHANGED
|
@@ -15614,8 +15614,8 @@ class Events {
|
|
|
15614
15614
|
hostUrl = (pos == -1) ? hostUrl : hostUrl.substr(0, pos);
|
|
15615
15615
|
|
|
15616
15616
|
// some URLs from VAST search are like https://www.ncbi.nlm.nih.gov/Structure/vast/icn3d/
|
|
15617
|
-
if(hostUrl
|
|
15618
|
-
hostUrl = '
|
|
15617
|
+
if(hostUrl.indexOf('/vast/icn3d/')) {
|
|
15618
|
+
hostUrl = hostUrl.replace(/\/vast\/icn3d\//g, '/icn3d/');
|
|
15619
15619
|
}
|
|
15620
15620
|
|
|
15621
15621
|
ic.definedSetsCls.clickCustomAtoms();
|
|
@@ -38594,15 +38594,16 @@ class SetColor {
|
|
|
38594
38594
|
atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
|
|
38595
38595
|
|
|
38596
38596
|
for (let i in atoms) {
|
|
38597
|
-
|
|
38598
|
-
if(!atom.het) ++cnt;
|
|
38597
|
+
ic.atoms[i];
|
|
38598
|
+
// if(!atom.het) ++cnt;
|
|
38599
|
+
++cnt;
|
|
38599
38600
|
}
|
|
38600
38601
|
|
|
38601
38602
|
let lastTerSerialInv = (cnt > 1) ? 1 / (cnt - 1) : 1;
|
|
38602
38603
|
for (let i in atoms) {
|
|
38603
38604
|
let atom = ic.atoms[i];
|
|
38604
|
-
//atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(
|
|
38605
|
-
atom.color =
|
|
38605
|
+
// atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
|
|
38606
|
+
atom.color = me.parasCls.thr().setHSL(3 / 4 * (1 - idx++ * lastTerSerialInv), 1, 0.45);
|
|
38606
38607
|
|
|
38607
38608
|
ic.atomPrevColors[i] = atom.color;
|
|
38608
38609
|
}
|
|
@@ -38616,14 +38617,16 @@ class SetColor {
|
|
|
38616
38617
|
atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
|
|
38617
38618
|
|
|
38618
38619
|
for (let i in atoms) {
|
|
38619
|
-
|
|
38620
|
-
if(!atom.het) ++cnt;
|
|
38620
|
+
ic.atoms[i];
|
|
38621
|
+
// if(!atom.het) ++cnt;
|
|
38622
|
+
++cnt;
|
|
38621
38623
|
}
|
|
38622
38624
|
|
|
38623
38625
|
let lastTerSerialInv = (cnt > 1) ? 1 / (cnt - 1) : 1;
|
|
38624
38626
|
for (let i in atoms) {
|
|
38625
38627
|
let atom = ic.atoms[i];
|
|
38626
|
-
atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
|
|
38628
|
+
// atom.color = atom.het ? me.parasCls.atomColors[atom.elem] || me.parasCls.defaultAtomColor : me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
|
|
38629
|
+
atom.color = me.parasCls.thr().setHSL(3 / 4 * idx++ * lastTerSerialInv, 1, 0.45);
|
|
38627
38630
|
|
|
38628
38631
|
ic.atomPrevColors[i] = atom.color;
|
|
38629
38632
|
}
|
|
@@ -52958,16 +52961,17 @@ class ChainalignParser {
|
|
|
52958
52961
|
// calculate secondary structures with applyCommandDssp
|
|
52959
52962
|
//$.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
|
|
52960
52963
|
await ic.pdbParserCls.applyCommandDssp(true);
|
|
52961
|
-
|
|
52964
|
+
//!!!
|
|
52965
|
+
/*
|
|
52962
52966
|
// original version =============
|
|
52963
52967
|
// align PDB chains
|
|
52964
52968
|
for(let index in ic.pdbChainIndexHash) {
|
|
52965
52969
|
//ic.pdbChainIndexHash[index] = mmdbid_q_tmp + "_" + ic.chain_q + "_" + ic.mmdbid_t + "_" + ic.chain_t;
|
|
52966
52970
|
let idArray = ic.pdbChainIndexHash[index].split('_');
|
|
52967
52971
|
mmdbid_q = idArray[0];
|
|
52968
|
-
idArray[1];
|
|
52972
|
+
let chain_q = idArray[1];
|
|
52969
52973
|
mmdbid_t = idArray[2];
|
|
52970
|
-
idArray[3];
|
|
52974
|
+
let chain_t = idArray[3];
|
|
52971
52975
|
|
|
52972
52976
|
thisClass.transformStructure(mmdbid_q, index-1, 'query');
|
|
52973
52977
|
}
|
|
@@ -52977,7 +52981,7 @@ class ChainalignParser {
|
|
|
52977
52981
|
let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
|
|
52978
52982
|
let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
|
|
52979
52983
|
|
|
52980
|
-
let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split('
|
|
52984
|
+
let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(',') : [];
|
|
52981
52985
|
|
|
52982
52986
|
for(let index in ic.afChainIndexHash) {
|
|
52983
52987
|
let idArray = ic.afChainIndexHash[index].split('_');
|
|
@@ -52989,25 +52993,26 @@ class ChainalignParser {
|
|
|
52989
52993
|
let chain_t = idArray[3];
|
|
52990
52994
|
let chainid_t = mmdbid_t + '_' + chain_t;
|
|
52991
52995
|
|
|
52992
|
-
let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t).hAtoms : ic.chains[chainid_t];
|
|
52993
|
-
let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q).hAtoms : ic.chains[chainid_q];
|
|
52996
|
+
// let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0].split(','), chainid_t, true).hAtoms : ic.chains[chainid_t];
|
|
52997
|
+
// let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index].split(','), chainid_q, true).hAtoms : ic.chains[chainid_q];
|
|
52998
|
+
let atomSet_t = (resRangeArray[0]) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[0]], chainid_t, true).hAtoms : ic.chains[chainid_t];
|
|
52999
|
+
let atomSet_q = (resRangeArray[index]) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[index]], chainid_q, true).hAtoms : ic.chains[chainid_q];
|
|
52994
53000
|
// end of original version =============
|
|
52995
|
-
|
|
52996
|
-
|
|
53001
|
+
*/
|
|
53002
|
+
|
|
52997
53003
|
// new version to be done for VASTsrv ==============
|
|
52998
53004
|
// dynamically align pairs in all chainids
|
|
52999
53005
|
let ajaxArray = [], indexArray = [], struArray = [];
|
|
53000
53006
|
let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
|
|
53001
53007
|
let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
|
|
53002
53008
|
|
|
53003
|
-
let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split('
|
|
53009
|
+
let resRangeArray = (me.cfg.resrange) ? me.cfg.resrange.split(',') : [];
|
|
53004
53010
|
|
|
53005
53011
|
// dynamically align pairs in all chainids
|
|
53006
|
-
let atomSet_t = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[0]
|
|
53012
|
+
let atomSet_t = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[0]], chainidArray[0], true).hAtoms : ic.chains[chainidArray[0]];
|
|
53007
53013
|
for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
|
|
53008
|
-
let atomSet_q = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid(resRangeArray[index]
|
|
53014
|
+
let atomSet_q = (me.cfg.resrange) ? ic.realignParserCls.getSeqCoorResid([resRangeArray[index]], chainidArray[index], true).hAtoms : ic.chains[chainidArray[index]];
|
|
53009
53015
|
// end of new version to be done for VASTsrv ==============
|
|
53010
|
-
*/
|
|
53011
53016
|
|
|
53012
53017
|
let alignAjax;
|
|
53013
53018
|
if(me.cfg.aligntool != 'tmalign') {
|
|
@@ -53235,10 +53240,11 @@ class ChainalignParser {
|
|
|
53235
53240
|
|
|
53236
53241
|
// chainid1 is target
|
|
53237
53242
|
aligType = 'target';
|
|
53238
|
-
|
|
53243
|
+
let bForce = true;
|
|
53244
|
+
this.transformStructure(target, index, aligType, bForce);
|
|
53239
53245
|
|
|
53240
53246
|
aligType = 'query';
|
|
53241
|
-
this.transformStructure(query, index, aligType);
|
|
53247
|
+
this.transformStructure(query, index, aligType, bForce);
|
|
53242
53248
|
|
|
53243
53249
|
allChainidHash[chainidArray[0]] = 1;
|
|
53244
53250
|
allChainidHash[chainidArray[1]] = 1;
|
|
@@ -53916,8 +53922,12 @@ class ChainalignParser {
|
|
|
53916
53922
|
|
|
53917
53923
|
if(bQuery && me.cfg.matchedchains) {
|
|
53918
53924
|
// $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
|
|
53919
|
-
let bRealign = true, bPredefined = true;
|
|
53920
|
-
await ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
|
|
53925
|
+
// let bRealign = true, bPredefined = true;
|
|
53926
|
+
// await ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
|
|
53927
|
+
|
|
53928
|
+
ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(ic.chainidArray);
|
|
53929
|
+
await ic.realignParserCls.realignOnStructAlign();
|
|
53930
|
+
|
|
53921
53931
|
// reset annotations
|
|
53922
53932
|
$("#" + ic.pre + "dl_annotations").html("");
|
|
53923
53933
|
ic.bAnnoShown = false;
|
|
@@ -58488,7 +58498,7 @@ class RealignParser {
|
|
|
58488
58498
|
}
|
|
58489
58499
|
}
|
|
58490
58500
|
|
|
58491
|
-
getSeqCoorResid(resiArray, chainid) { let ic = this.icn3d, me = ic.icn3dui;
|
|
58501
|
+
getSeqCoorResid(resiArray, chainid, bNCBI) { let ic = this.icn3d, me = ic.icn3dui;
|
|
58492
58502
|
let seq = '', coorArray = [], residArray = [];
|
|
58493
58503
|
let hAtoms = {};
|
|
58494
58504
|
|
|
@@ -58496,15 +58506,7 @@ class RealignParser {
|
|
|
58496
58506
|
if(resiArray[j].indexOf('-') != -1) {
|
|
58497
58507
|
let startEnd = resiArray[j].split('-');
|
|
58498
58508
|
for(let k = parseInt(startEnd[0]); k <= parseInt(startEnd[1]); ++k) {
|
|
58499
|
-
|
|
58500
|
-
//if(me.cfg.usepdbnum === false) k += base - 1;
|
|
58501
|
-
|
|
58502
|
-
//let seqIndex = k - base;
|
|
58503
|
-
let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
|
|
58504
|
-
// if(ic.bNCBI) {
|
|
58505
|
-
// let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
|
|
58506
|
-
// if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
|
|
58507
|
-
// }
|
|
58509
|
+
let seqIndex = (bNCBI) ? k : ic.setSeqAlignCls.getPosFromResi(chainid, k);
|
|
58508
58510
|
|
|
58509
58511
|
// don't align solvent or chemicals
|
|
58510
58512
|
if(!ic.chainsSeq[chainid] || !ic.chainsSeq[chainid][seqIndex] || me.parasCls.b62ResArray.indexOf(ic.chainsSeq[chainid][seqIndex].name.toUpperCase()) == -1) continue;
|
|
@@ -58516,20 +58518,14 @@ class RealignParser {
|
|
|
58516
58518
|
residArray.push(chainid + '_' + k);
|
|
58517
58519
|
}
|
|
58518
58520
|
}
|
|
58521
|
+
else if(resiArray[j] == 0) { // 0 means the whole chain
|
|
58522
|
+
let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.chains[chainid]);
|
|
58523
|
+
residArray = Object.keys(residueHash);
|
|
58524
|
+
}
|
|
58519
58525
|
else { // one residue
|
|
58520
|
-
|
|
58521
|
-
//let k = parseInt(resiArray[j]);
|
|
58522
58526
|
let k = resiArray[j];
|
|
58523
|
-
// from VAST neighbor page, use NCBI residue number
|
|
58524
|
-
//if(me.cfg.usepdbnum === false) k += base - 1;
|
|
58525
|
-
|
|
58526
|
-
//let seqIndex = k - base;
|
|
58527
|
-
let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
|
|
58528
58527
|
|
|
58529
|
-
|
|
58530
|
-
// let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
|
|
58531
|
-
// if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
|
|
58532
|
-
// }
|
|
58528
|
+
let seqIndex = (bNCBI) ? k : ic.setSeqAlignCls.getPosFromResi(chainid, k);
|
|
58533
58529
|
|
|
58534
58530
|
if(!ic.chainsSeq[chainid][seqIndex]) continue;
|
|
58535
58531
|
|
|
@@ -68530,9 +68526,10 @@ class LoadScript {
|
|
|
68530
68526
|
|
|
68531
68527
|
if(command.indexOf('load') !== -1) { // 'load pdb [pdbid]'
|
|
68532
68528
|
let load_parameters = command.split(' | ');
|
|
68533
|
-
|
|
68534
68529
|
let loadStr = load_parameters[0];
|
|
68535
|
-
|
|
68530
|
+
|
|
68531
|
+
// do not reset me.cfg.inpara from "command=..." part if it was not empty
|
|
68532
|
+
if(load_parameters.length > 1 && !me.cfg.inpara) {
|
|
68536
68533
|
let firstSpacePos = load_parameters[load_parameters.length - 1].indexOf(' ');
|
|
68537
68534
|
me.cfg.inpara = load_parameters[load_parameters.length - 1].substr(firstSpacePos + 1);
|
|
68538
68535
|
if(me.cfg.inpara === 'undefined') {
|
|
@@ -81910,7 +81907,7 @@ class iCn3DUI {
|
|
|
81910
81907
|
//even when multiple iCn3D viewers are shown together.
|
|
81911
81908
|
this.pre = this.cfg.divid + "_";
|
|
81912
81909
|
|
|
81913
|
-
this.REVISION = '3.34.
|
|
81910
|
+
this.REVISION = '3.34.1';
|
|
81914
81911
|
|
|
81915
81912
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
81916
81913
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|
|
@@ -82100,7 +82097,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
82100
82097
|
await ic.realignParserCls.realignChainOnSeqAlign(undefined, chainidArray, bRealign, bPredefined);
|
|
82101
82098
|
}
|
|
82102
82099
|
}
|
|
82103
|
-
else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
|
|
82100
|
+
// else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
|
|
82101
|
+
else if(me.cfg.matchedchains !== undefined) {
|
|
82104
82102
|
let stru_t = Object.keys(ic.structures)[0];
|
|
82105
82103
|
|
|
82106
82104
|
let chain_t = stru_t + '_' + me.cfg.masterchain;
|
|
@@ -82128,7 +82126,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
82128
82126
|
ic.chainidArray = [chain_t].concat(chainidArray);
|
|
82129
82127
|
ic.chainidArray = ic.chainalignParserCls.addPostfixForChainids(ic.chainidArray);
|
|
82130
82128
|
|
|
82131
|
-
me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
|
|
82129
|
+
// me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
|
|
82132
82130
|
|
|
82133
82131
|
ic.loadCmd = 'vast_search_chainid ' + ic.chainidArray;
|
|
82134
82132
|
me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
|
|
@@ -82354,7 +82352,8 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
82354
82352
|
ic.bChainAlign = true;
|
|
82355
82353
|
ic.inputid = me.cfg.chainalign;
|
|
82356
82354
|
let resrangeStr = (me.cfg.resrange) ? ' | resrange ' + me.cfg.resrange : '';
|
|
82357
|
-
|
|
82355
|
+
let resdef = (me.cfg.resdef) ? me.cfg.resdef : '';
|
|
82356
|
+
ic.loadCmd = 'load chainalignment ' + me.cfg.chainalign + ' | resnum ' + me.cfg.resnum + ' | resdef ' + resdef + ' | aligntool ' + me.cfg.aligntool + ' | parameters ' + me.cfg.inpara + resrangeStr;
|
|
82358
82357
|
me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
|
|
82359
82358
|
await ic.chainalignParserCls.downloadChainalignment(me.cfg.chainalign);
|
|
82360
82359
|
}
|