icn3d 3.37.0 → 3.37.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 +62 -46
- package/icn3d.min.js +3 -3
- package/icn3d.module.js +62 -46
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -12003,9 +12003,9 @@ class ClickMenu {
|
|
|
12003
12003
|
|
|
12004
12004
|
$("#" + me.pre + "newvs2").on('submit', function() {
|
|
12005
12005
|
// fill the pdbstr
|
|
12006
|
-
let
|
|
12006
|
+
let bVastSearch = true;
|
|
12007
|
+
let pdbstr = ic.saveFileCls.getAtomPDB(ic.hAtoms, undefined, undefined, undefined, undefined, undefined, undefined, bVastSearch);
|
|
12007
12008
|
$("#" + me.pre + "pdbstr").val(pdbstr);
|
|
12008
|
-
|
|
12009
12009
|
return true;
|
|
12010
12010
|
});
|
|
12011
12011
|
|
|
@@ -14918,7 +14918,7 @@ class SetDialog {
|
|
|
14918
14918
|
html += '<div style="width:550px;">You can define your own reference numbers in a custom file using Excel, and then export it as a CSV file. An example file is shown below with cells separated by commas.<br>';
|
|
14919
14919
|
html += '<pre>refnum,11,12,,21,22,,10C,11C,20C<br>';
|
|
14920
14920
|
html += '1TUP_A,100,101,,,132,,,,<br>';
|
|
14921
|
-
html += '1TUP_B,110,111,,141,142
|
|
14921
|
+
html += '1TUP_B,110,111,,141,142,,,,<br>';
|
|
14922
14922
|
html += '1TUP_C,,,,,,,200,201,230</pre>';
|
|
14923
14923
|
html += 'The first row defines the reference residue numbers, which could be any strings. The 1st cell could be anything. The rest cells are reference residue numbers (e.g., 11, 21, 10C, etc.) or empty cells. Each chain has a separate row. The first cell of the second row is the chain ID "1TUP_A". The rest cells are the corresponding real residue numbers for reference residue numbers in the first row. For example, the reference numbers for residues 100, 101, and 132 in the chain 1TUP_A are 11, 12, and 22, respectively. The fourth row shows another set of reference numners for the chain "1TUP_C". It could be a chain from a different structure.<br><br>';
|
|
14924
14924
|
html += 'To select all residues corresponding to the reference numbers, you can simplay replace ":" with "%" in the <a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#selectb" target="_blank">Specification</a>. For example, "%12" selects the residue 101 in 1TUP_A and the residue 111 in 1TUP_B. ".A%12" has the chain "A" filter and selects the residue 101 in 1TUP_A.<br>';
|
|
@@ -20170,8 +20170,8 @@ class SetHtml {
|
|
|
20170
20170
|
});
|
|
20171
20171
|
}
|
|
20172
20172
|
|
|
20173
|
-
|
|
20174
|
-
async loadPng(imageStr) { let me = this.icn3dui, ic = me.icn3d;
|
|
20173
|
+
async loadPng(imageStr, command, bRender) { let me = this.icn3dui, ic = me.icn3d;
|
|
20174
|
+
// async loadPng(imageStr) { let me = this.icn3dui, ic = me.icn3d;
|
|
20175
20175
|
let matchedStr = 'Share Link: ';
|
|
20176
20176
|
let pos = imageStr.indexOf(matchedStr);
|
|
20177
20177
|
let matchedStrState = "Start of state file======\n";
|
|
@@ -20192,8 +20192,8 @@ class SetHtml {
|
|
|
20192
20192
|
let posData = imageStr.indexOf(matchedStrData);
|
|
20193
20193
|
ic.bInputfile =(posData == -1) ? false : true;
|
|
20194
20194
|
ic.bInputPNGWithData = ic.bInputfile;
|
|
20195
|
-
|
|
20196
|
-
|
|
20195
|
+
let commandStr = (command) ? command.replace(/;/g, "\n") : '';
|
|
20196
|
+
// let commandStr = '';
|
|
20197
20197
|
|
|
20198
20198
|
// let statefile;
|
|
20199
20199
|
// if(ic.bInputfile) {
|
|
@@ -20214,31 +20214,37 @@ class SetHtml {
|
|
|
20214
20214
|
//statefile = decodeURIComponent(statefile);
|
|
20215
20215
|
statefile = decodeURIComponent(statefile + "\n" + commandStr);
|
|
20216
20216
|
|
|
20217
|
-
|
|
20218
|
-
|
|
20219
|
-
|
|
20217
|
+
if(bRender) {
|
|
20218
|
+
if(type === 'pdb') {
|
|
20219
|
+
await ic.pdbParserCls.loadPdbData(data);
|
|
20220
20220
|
|
|
20221
|
-
|
|
20222
|
-
|
|
20223
|
-
|
|
20224
|
-
}
|
|
20225
|
-
else {
|
|
20226
|
-
if(type === 'mol2') {
|
|
20227
|
-
await ic.mol2ParserCls.loadMol2Data(data);
|
|
20228
|
-
}
|
|
20229
|
-
else if(type === 'sdf') {
|
|
20230
|
-
await ic.sdfParserCls.loadSdfData(data);
|
|
20221
|
+
ic.commands = [];
|
|
20222
|
+
ic.optsHistory = [];
|
|
20223
|
+
//await ic.loadScriptCls.loadScript(statefile, true);
|
|
20231
20224
|
}
|
|
20232
|
-
else
|
|
20233
|
-
|
|
20234
|
-
|
|
20235
|
-
|
|
20236
|
-
|
|
20225
|
+
else {
|
|
20226
|
+
if(type === 'mol2') {
|
|
20227
|
+
await ic.mol2ParserCls.loadMol2Data(data);
|
|
20228
|
+
}
|
|
20229
|
+
else if(type === 'sdf') {
|
|
20230
|
+
await ic.sdfParserCls.loadSdfData(data);
|
|
20231
|
+
}
|
|
20232
|
+
else if(type === 'xyz') {
|
|
20233
|
+
await ic.xyzParserCls.loadXyzData(data);
|
|
20234
|
+
}
|
|
20235
|
+
else if(type === 'mmcif') {
|
|
20236
|
+
await ic.mmcifParserCls.loadMmcifData(data);
|
|
20237
|
+
}
|
|
20238
|
+
ic.commands = [];
|
|
20239
|
+
ic.optsHistory = [];
|
|
20240
|
+
//await ic.loadScriptCls.loadScript(statefile, true);
|
|
20237
20241
|
}
|
|
20238
|
-
|
|
20239
|
-
|
|
20240
|
-
|
|
20241
|
-
|
|
20242
|
+
|
|
20243
|
+
await ic.loadScriptCls.loadScript(statefile, true);
|
|
20244
|
+
|
|
20245
|
+
// me.htmlCls.clickMenuCls.setLogCmd('load iCn3D PNG image ' + $("#" + me.pre + "pngimage").val(), false);
|
|
20246
|
+
}
|
|
20247
|
+
/*
|
|
20242
20248
|
}
|
|
20243
20249
|
else { // url length > 4000
|
|
20244
20250
|
//var matchedStrState = "Start of state file======\n";
|
|
@@ -43003,8 +43009,6 @@ class AnnoDomain {
|
|
|
43003
43009
|
}
|
|
43004
43010
|
}
|
|
43005
43011
|
|
|
43006
|
-
if(bNotShowDomain) continue;
|
|
43007
|
-
|
|
43008
43012
|
// save 3D domain info for node.js script
|
|
43009
43013
|
if(me.bNode) {
|
|
43010
43014
|
let domainName = '3D domain ' +(index+1).toString();
|
|
@@ -43019,13 +43023,15 @@ class AnnoDomain {
|
|
|
43019
43023
|
// 0-based
|
|
43020
43024
|
let obj = {};
|
|
43021
43025
|
// let resi = ic.ParserUtilsCls.getResi(chnid, j);
|
|
43022
|
-
let resid = ic.ncbi2resid
|
|
43026
|
+
let resid = ic.ncbi2resid[chnid + '_' + j];
|
|
43023
43027
|
obj[resid] = domainName;
|
|
43024
43028
|
ic.resid2domain[chnid].push(obj);
|
|
43025
43029
|
}
|
|
43026
43030
|
}
|
|
43027
43031
|
}
|
|
43028
43032
|
|
|
43033
|
+
if(bNotShowDomain) continue;
|
|
43034
|
+
|
|
43029
43035
|
let htmlTmp2 = '<div class="icn3d-seqTitle icn3d-link icn3d-blue" 3ddomain="' +(index+1).toString() + '" from="' + fromArray + '" to="' + toArray + '" shorttitle="' + title + '" index="' + index + '" setname="' + chnid + '_3d_domain_' +(index+1).toString() + '" anno="sequence" chain="' + chnid + '" title="' + fulltitle + '">' + title + ' </div>';
|
|
43030
43036
|
let htmlTmp3 = '<span class="icn3d-residueNum" title="residue count">' + resCnt.toString() + ' Res</span>';
|
|
43031
43037
|
html3 += htmlTmp2 + htmlTmp3 + '<br>';
|
|
@@ -50606,7 +50612,7 @@ class LineGraph {
|
|
|
50606
50612
|
}
|
|
50607
50613
|
else {
|
|
50608
50614
|
++linkedNodeCnt[mappingid];
|
|
50609
|
-
linkedNodeInterDiff[mappingid] += link.n;
|
|
50615
|
+
linkedNodeInterDiff[mappingid] += link.n;
|
|
50610
50616
|
|
|
50611
50617
|
linkedNodeInterDiffBool[mappingid] = (linkedNodeInterDiff[mappingid] / link.n == linkedNodeCnt[mappingid]) ? 0 : 1;
|
|
50612
50618
|
}
|
|
@@ -50660,7 +50666,7 @@ class LineGraph {
|
|
|
50660
50666
|
let linkDiff = me.hashUtilsCls.cloneHash(link);
|
|
50661
50667
|
linkDiff.source += separatorDiff + ic.chainsMapping[chainid1][resid1];
|
|
50662
50668
|
linkDiff.target += separatorDiff + ic.chainsMapping[chainid2][resid2];
|
|
50663
|
-
|
|
50669
|
+
|
|
50664
50670
|
if(linkedNodeCnt[mappingid] == structureArray.length && (bIgRef || linkedNodeInterDiffBool[mappingid] == 0)) {
|
|
50665
50671
|
linkArraySplitCommon[index].push(linkCommon);
|
|
50666
50672
|
}
|
|
@@ -51353,6 +51359,7 @@ class GetGraph {
|
|
|
51353
51359
|
nodeArray2.push(node);
|
|
51354
51360
|
}
|
|
51355
51361
|
}
|
|
51362
|
+
|
|
51356
51363
|
// sort array
|
|
51357
51364
|
nodeArray1.sort(function(a,b) {
|
|
51358
51365
|
return thisClass.compNode(a, b);
|
|
@@ -51360,6 +51367,7 @@ class GetGraph {
|
|
|
51360
51367
|
nodeArray2.sort(function(a,b) {
|
|
51361
51368
|
return thisClass.compNode(a, b, bReverseNode);
|
|
51362
51369
|
});
|
|
51370
|
+
|
|
51363
51371
|
return {"nodeArray1": nodeArray1, "nodeArray2": nodeArray2, "name2node": name2nodeCommon};
|
|
51364
51372
|
}
|
|
51365
51373
|
updateGraphJson(struc, index, nodeArray1, nodeArray2, linkArray) { let ic = this.icn3d, me = ic.icn3dui;
|
|
@@ -51664,7 +51672,9 @@ class GetGraph {
|
|
|
51664
51672
|
}
|
|
51665
51673
|
|
|
51666
51674
|
for(let linkStr in linkstr2cnt) {
|
|
51667
|
-
|
|
51675
|
+
// do not differentiate the number of contacts
|
|
51676
|
+
let n = (value == me.htmlCls.contactInsideValue || value == me.htmlCls.contactValue) ? 1 : linkstr2cnt[linkStr];
|
|
51677
|
+
hbondStr += ', {' + linkStr + ', "n": ' + n + '}';
|
|
51668
51678
|
}
|
|
51669
51679
|
|
|
51670
51680
|
return hbondStr;
|
|
@@ -58504,8 +58514,7 @@ class PdbParser {
|
|
|
58504
58514
|
await ic.mmcifParserCls.loadMmcifData(data);
|
|
58505
58515
|
}
|
|
58506
58516
|
else if(type === 'icn3dpng') {
|
|
58507
|
-
|
|
58508
|
-
await me.htmlCls.setHtmlCls.loadPng(data);
|
|
58517
|
+
await me.htmlCls.setHtmlCls.loadPng(data, command, true);
|
|
58509
58518
|
}
|
|
58510
58519
|
else if(type === 'pae') {
|
|
58511
58520
|
me.htmlCls.dialogCls.openDlg('dl_alignerrormap', 'Show Predicted Aligned Error (PAE) map');
|
|
@@ -58635,7 +58644,7 @@ class PdbParser {
|
|
|
58635
58644
|
}
|
|
58636
58645
|
|
|
58637
58646
|
async execStatefile(structure, statefile) {let ic = this.icn3d, me = ic.icn3dui;
|
|
58638
|
-
|
|
58647
|
+
if(!statefile) return;
|
|
58639
58648
|
|
|
58640
58649
|
let commandArray = statefile.trim().split('\n');
|
|
58641
58650
|
commandArray = ['select $' + structure].concat(commandArray);
|
|
@@ -63991,7 +64000,8 @@ class LoadPDB {
|
|
|
63991
64000
|
this.icn3d = icn3d;
|
|
63992
64001
|
}
|
|
63993
64002
|
|
|
63994
|
-
getStructureId(id, moleculeNum, bMutation) { let ic = this.icn3d; ic.icn3dui;
|
|
64003
|
+
getStructureId(id, moleculeNum, bMutation, bNMR) { let ic = this.icn3d; ic.icn3dui;
|
|
64004
|
+
id = (bNMR && ic.idNMR) ? ic.idNMR : id;
|
|
63995
64005
|
let structure = id;
|
|
63996
64006
|
|
|
63997
64007
|
if(id == ic.defaultPdbId || bMutation || ic.structures.hasOwnProperty(id)) { // bMutation: side chain prediction
|
|
@@ -64058,6 +64068,7 @@ class LoadPDB {
|
|
|
64058
64068
|
//let chainMissingResidueArray = {}
|
|
64059
64069
|
|
|
64060
64070
|
let id = (pdbid) ? pdbid : ic.defaultPdbId;
|
|
64071
|
+
let oriId = id;
|
|
64061
64072
|
|
|
64062
64073
|
let structure = id;
|
|
64063
64074
|
|
|
@@ -64077,6 +64088,7 @@ class LoadPDB {
|
|
|
64077
64088
|
|
|
64078
64089
|
///id = line.substr(62, 4).trim();
|
|
64079
64090
|
id = line.substr(62).trim();
|
|
64091
|
+
oriId = id;
|
|
64080
64092
|
|
|
64081
64093
|
if(id == '') {
|
|
64082
64094
|
if(bAppend) {
|
|
@@ -64088,7 +64100,7 @@ class LoadPDB {
|
|
|
64088
64100
|
}
|
|
64089
64101
|
}
|
|
64090
64102
|
|
|
64091
|
-
structure = this.getStructureId(id, moleculeNum, bMutation);
|
|
64103
|
+
structure = this.getStructureId(id, moleculeNum, bMutation, bNMR);
|
|
64092
64104
|
|
|
64093
64105
|
ic.molTitle = '';
|
|
64094
64106
|
ic.molTitleHash = {};
|
|
@@ -64159,6 +64171,7 @@ class LoadPDB {
|
|
|
64159
64171
|
else if (remarkType == 210) {
|
|
64160
64172
|
if((line.substr(11, 32).trim() == 'EXPERIMENT TYPE') && line.substr(45).trim() == 'NMR') {
|
|
64161
64173
|
bNMR = true;
|
|
64174
|
+
ic.idNMR = oriId;
|
|
64162
64175
|
}
|
|
64163
64176
|
}
|
|
64164
64177
|
else if (remarkType == 350 && line.substr(13, 5) == 'BIOMT') {
|
|
@@ -64212,7 +64225,7 @@ class LoadPDB {
|
|
|
64212
64225
|
++moleculeNum;
|
|
64213
64226
|
id = ic.defaultPdbId;
|
|
64214
64227
|
|
|
64215
|
-
structure = this.getStructureId(id, moleculeNum, bMutation);
|
|
64228
|
+
structure = this.getStructureId(id, moleculeNum, bMutation, bNMR);
|
|
64216
64229
|
//helices = [];
|
|
64217
64230
|
//sheets = [];
|
|
64218
64231
|
if(!bNMR) {
|
|
@@ -64235,7 +64248,7 @@ class LoadPDB {
|
|
|
64235
64248
|
segId = line.substr(72, 4).trim();
|
|
64236
64249
|
|
|
64237
64250
|
if(bFirstAtom) {
|
|
64238
|
-
structure = this.getStructureId(id, moleculeNum, bMutation);
|
|
64251
|
+
structure = this.getStructureId(id, moleculeNum, bMutation, bNMR);
|
|
64239
64252
|
|
|
64240
64253
|
bFirstAtom = false;
|
|
64241
64254
|
}
|
|
@@ -64243,7 +64256,7 @@ class LoadPDB {
|
|
|
64243
64256
|
++moleculeNum;
|
|
64244
64257
|
id = ic.defaultPdbId;
|
|
64245
64258
|
|
|
64246
|
-
structure = this.getStructureId(id, moleculeNum, bMutation);
|
|
64259
|
+
structure = this.getStructureId(id, moleculeNum, bMutation, bNMR);
|
|
64247
64260
|
|
|
64248
64261
|
//helices = [];
|
|
64249
64262
|
//sheets = [];
|
|
@@ -79398,7 +79411,7 @@ class SaveFile {
|
|
|
79398
79411
|
}
|
|
79399
79412
|
|
|
79400
79413
|
//getAtomPDB: function(atomHash, bPqr, bPdb, bNoChem) { let ic = this.icn3d, me = ic.icn3dui;
|
|
79401
|
-
getAtomPDB(atomHash, bPqr, bNoChem, bNoHeader, chainResi2pdb, pdbid, bMergeIntoOne) { let ic = this.icn3d, me = ic.icn3dui;
|
|
79414
|
+
getAtomPDB(atomHash, bPqr, bNoChem, bNoHeader, chainResi2pdb, pdbid, bMergeIntoOne, bVastSearch) { let ic = this.icn3d, me = ic.icn3dui;
|
|
79402
79415
|
let pdbStr = '';
|
|
79403
79416
|
|
|
79404
79417
|
// get all phosphate groups in lipids
|
|
@@ -79475,7 +79488,7 @@ class SaveFile {
|
|
|
79475
79488
|
for(let i = 0, il = ssArray.length; i < il; ++i) {
|
|
79476
79489
|
let ssObj = ssArray[i];
|
|
79477
79490
|
|
|
79478
|
-
if(ssObj.ss != prevSs) {
|
|
79491
|
+
if(ssObj.ss != prevSs || ssObj.ssbegin) {
|
|
79479
79492
|
// print prev
|
|
79480
79493
|
stru2header[stru] += this.printPrevSecondary(bHelix, bSheet, prevRealSsObj, ssCnt);
|
|
79481
79494
|
|
|
@@ -79673,6 +79686,7 @@ class SaveFile {
|
|
|
79673
79686
|
//line +=(atom.chain.length <= 1) ? atom.chain.padStart(1, ' ') : atom.chain.substr(0, 1);
|
|
79674
79687
|
if(atom.chain.length >= 2) {
|
|
79675
79688
|
let chainTmp = atom.chain.replace(/_/gi, '').substr(0, 2);
|
|
79689
|
+
if(bVastSearch) chainTmp = ' ' + chainTmp.substr(0,1); // VAST search only support one lettter chain ID
|
|
79676
79690
|
line += chainTmp;
|
|
79677
79691
|
}
|
|
79678
79692
|
else if(atom.chain.length == 1) {
|
|
@@ -79751,7 +79765,9 @@ class SaveFile {
|
|
|
79751
79765
|
}
|
|
79752
79766
|
else {
|
|
79753
79767
|
line += "1.00".padStart(6, ' ');
|
|
79754
|
-
line +=(atom.b) ? parseFloat(atom.b).toFixed(2).toString().padStart(6, ' ') : ' '.padStart(6, ' ');
|
|
79768
|
+
// line +=(atom.b) ? parseFloat(atom.b).toFixed(2).toString().padStart(6, ' ') : ' '.padStart(6, ' ');
|
|
79769
|
+
let defaultBFactor = (bVastSearch) ? "1.0" : " ";
|
|
79770
|
+
line +=(atom.b) ? parseFloat(atom.b).toFixed(2).toString().padStart(6, ' ') : defaultBFactor.padStart(6, ' ');
|
|
79755
79771
|
line += ' '.padStart(10, ' ');
|
|
79756
79772
|
line += atom.elem.padStart(2, ' ');
|
|
79757
79773
|
line += ' '.padStart(2, ' ');
|