icn3d 3.9.0 → 3.11.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 +1111 -399
- package/package.json +1 -1
package/icn3d.js
CHANGED
|
@@ -4087,6 +4087,10 @@ class ParasCls {
|
|
|
4087
4087
|
coil: this.thr(0x6080FF) //this.thr(0xEEEEEE) //this.thr(0x6080FF)
|
|
4088
4088
|
};
|
|
4089
4089
|
|
|
4090
|
+
this.resn2restype = {
|
|
4091
|
+
"ALA": 1, "ARG": 4, "ASN": 7, "ASP": 10, "CYS": 13, "GLN": 16, "GLU": 19, "GLY": 22, "HIS": 25, "ILE": 28, "LEU": 31, "LYS": 34, "MET": 37, "PHE": 40, "PRO": 43, "SER": 46, "THR": 49, "TRP": 52, "TYR": 55, "VAL": 58
|
|
4092
|
+
};
|
|
4093
|
+
|
|
4090
4094
|
// https://www.ncbi.nlm.nih.gov/Class/FieldGuide/BLOSUM62.txt, range from -4 to 11
|
|
4091
4095
|
this.b62ResArray = ['A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F',
|
|
4092
4096
|
'P', 'S', 'T', 'W', 'Y', 'V', 'B', 'Z', 'X', '*']; // length: 24
|
|
@@ -16052,19 +16056,21 @@ class LineGraph {
|
|
|
16052
16056
|
nodeArray1Split[i] = nodeArraysTmp.nodeArray1;
|
|
16053
16057
|
nodeArray2Split[i] = nodeArraysTmp.nodeArray2;
|
|
16054
16058
|
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
|
|
16065
|
-
|
|
16066
|
-
|
|
16067
|
-
|
|
16059
|
+
if(Object.keys(ic.chainsMapping).length > 0) {
|
|
16060
|
+
// common interactions
|
|
16061
|
+
bCommonDiff = 1;
|
|
16062
|
+
nodeArraysTmp = ic.getGraphCls.getNodeTopBottom(nameHashSplit[i], name2node, undefined, bCommonDiff, nameHashSplitCommon[i]);
|
|
16063
|
+
nodeArray1SplitCommon[i] = nodeArraysTmp.nodeArray1;
|
|
16064
|
+
nodeArray2SplitCommon[i] = nodeArraysTmp.nodeArray2;
|
|
16065
|
+
name2node = me.hashUtilsCls.unionHash(name2node, nodeArraysTmp.name2node);
|
|
16066
|
+
|
|
16067
|
+
// different interactions
|
|
16068
|
+
bCommonDiff = 2;
|
|
16069
|
+
nodeArraysTmp = ic.getGraphCls.getNodeTopBottom(nameHashSplit[i], name2node, undefined, bCommonDiff, nameHashSplitDiff[i]);
|
|
16070
|
+
nodeArray1SplitDiff[i] = nodeArraysTmp.nodeArray1;
|
|
16071
|
+
nodeArray2SplitDiff[i] = nodeArraysTmp.nodeArray2;
|
|
16072
|
+
name2node = me.hashUtilsCls.unionHash(name2node, nodeArraysTmp.name2node);
|
|
16073
|
+
}
|
|
16068
16074
|
|
|
16069
16075
|
len1Split[i] = nodeArray1Split[i].length;
|
|
16070
16076
|
len2Split[i] = nodeArray2Split[i].length;
|
|
@@ -16089,19 +16095,19 @@ class LineGraph {
|
|
|
16089
16095
|
//width =(Math.max(len1b, len2b) + 2) *(r + gap) + 2 * marginX + legendWidth;
|
|
16090
16096
|
heightAll =(me.utilsCls.sumArray(len1Split) + 2*strucArray.length) *(r + gap) + 4 * marginY
|
|
16091
16097
|
+ 2 * legendWidth + textHeight*strucArray.length;
|
|
16092
|
-
// show common and diff interaction as well
|
|
16093
|
-
heightAll *= 3;
|
|
16094
16098
|
|
|
16095
16099
|
width = (maxWidth + 2) * (r + gap) + 2 * marginX + legendWidth;
|
|
16096
16100
|
|
|
16097
16101
|
} else {
|
|
16098
16102
|
height = 110 + textHeight;
|
|
16099
16103
|
heightAll = height * strucArray.length;
|
|
16100
|
-
// show common and diff interaction as well
|
|
16101
|
-
heightAll *= 3;
|
|
16102
16104
|
|
|
16103
16105
|
width = (maxWidth + 2) * (r + gap) + 2 * marginX;
|
|
16104
16106
|
}
|
|
16107
|
+
|
|
16108
|
+
// show common and diff interaction as well
|
|
16109
|
+
if(Object.keys(ic.chainsMapping).length > 0) heightAll *= 3;
|
|
16110
|
+
|
|
16105
16111
|
let id, graphWidth;
|
|
16106
16112
|
if(bScatterplot) {
|
|
16107
16113
|
ic.scatterplotWidth = 2 * width;
|
|
@@ -16124,17 +16130,19 @@ class LineGraph {
|
|
|
16124
16130
|
heightFinal = result.heightFinal;
|
|
16125
16131
|
html += result.html;
|
|
16126
16132
|
|
|
16127
|
-
|
|
16128
|
-
|
|
16133
|
+
if(Object.keys(ic.chainsMapping).length > 0) {
|
|
16134
|
+
bCommonDiff = 1;
|
|
16135
|
+
result = this.drawGraphPerType(bCommonDiff, structureArray, bScatterplot, nodeArray1SplitCommon, nodeArray2SplitCommon, linkArraySplitCommon, name2node, heightFinal, height, textHeight, len1Split, r, gap, marginY);
|
|
16129
16136
|
|
|
16130
|
-
|
|
16131
|
-
|
|
16137
|
+
heightFinal = result.heightFinal;
|
|
16138
|
+
html += result.html;
|
|
16132
16139
|
|
|
16133
|
-
|
|
16134
|
-
|
|
16140
|
+
bCommonDiff = 2;
|
|
16141
|
+
result = this.drawGraphPerType(bCommonDiff, structureArray, bScatterplot, nodeArray1SplitDiff, nodeArray2SplitDiff, linkArraySplitDiff, name2node, heightFinal, height, textHeight, len1Split, r, gap, marginY);
|
|
16135
16142
|
|
|
16136
|
-
|
|
16137
|
-
|
|
16143
|
+
heightFinal = result.heightFinal;
|
|
16144
|
+
html += result.html;
|
|
16145
|
+
}
|
|
16138
16146
|
|
|
16139
16147
|
html += "</svg>";
|
|
16140
16148
|
} else {
|
|
@@ -16786,7 +16794,7 @@ class ViewInterPairs {
|
|
|
16786
16794
|
dataType: "script",
|
|
16787
16795
|
cache: true,
|
|
16788
16796
|
tryCount : 0,
|
|
16789
|
-
retryLimit : 1
|
|
16797
|
+
retryLimit : 0, //1
|
|
16790
16798
|
success: function(data) {
|
|
16791
16799
|
ic.bD3 = true;
|
|
16792
16800
|
|
|
@@ -17409,39 +17417,52 @@ class ShowInter {
|
|
|
17409
17417
|
}
|
|
17410
17418
|
}
|
|
17411
17419
|
|
|
17412
|
-
showHydrogens() { let ic = this.icn3d
|
|
17413
|
-
|
|
17414
|
-
|
|
17415
|
-
|
|
17416
|
-
|
|
17417
|
-
|
|
17418
|
-
|
|
17419
|
-
|
|
17420
|
-
|
|
17421
|
-
|
|
17422
|
-
|
|
17423
|
-
|
|
17424
|
-
|
|
17425
|
-
|
|
17426
|
-
|
|
17427
|
-
|
|
17420
|
+
showHydrogens() { let ic = this.icn3d, me = ic.icn3dui;
|
|
17421
|
+
// get hydrogen atoms for currently selected atoms
|
|
17422
|
+
if(me.cfg.cid !== undefined) {
|
|
17423
|
+
for(let i in ic.hAtoms) {
|
|
17424
|
+
let atom = ic.atoms[i];
|
|
17425
|
+
|
|
17426
|
+
//if(atom.name !== 'H') {
|
|
17427
|
+
if(atom.elem.substr(0, 1) !== 'H') {
|
|
17428
|
+
ic.atoms[atom.serial].bonds = ic.atoms[atom.serial].bonds2.concat();
|
|
17429
|
+
ic.atoms[atom.serial].bondOrder = ic.atoms[atom.serial].bondOrder2.concat();
|
|
17430
|
+
for(let j = 0, jl = ic.atoms[atom.serial].bonds.length; j < jl; ++j) {
|
|
17431
|
+
let serial = ic.atoms[atom.serial].bonds[j];
|
|
17432
|
+
//if(ic.atoms[serial].name === 'H') {
|
|
17433
|
+
if(atom.elem.substr(0, 1) === 'H') {
|
|
17434
|
+
ic.dAtoms[serial] = 1;
|
|
17435
|
+
ic.hAtoms[serial] = 1;
|
|
17436
|
+
}
|
|
17437
|
+
}
|
|
17438
|
+
}
|
|
17439
|
+
}
|
|
17440
|
+
}
|
|
17441
|
+
else {
|
|
17442
|
+
for(let serial in ic.atoms) {
|
|
17443
|
+
ic.dAtoms[serial] = 1;
|
|
17444
|
+
ic.hAtoms[serial] = 1;
|
|
17445
|
+
}
|
|
17446
|
+
}
|
|
17428
17447
|
}
|
|
17448
|
+
|
|
17429
17449
|
hideHydrogens() { let ic = this.icn3d; ic.icn3dui;
|
|
17430
17450
|
// remove hydrogen atoms for currently selected atoms
|
|
17431
17451
|
for(let i in ic.hAtoms) {
|
|
17432
17452
|
let atom = ic.atoms[i];
|
|
17433
|
-
if(atom.name === 'H') {
|
|
17453
|
+
//if(atom.name === 'H') {
|
|
17454
|
+
if(atom.elem.substr(0, 1) === 'H') {
|
|
17434
17455
|
if(ic.atoms[atom.serial].bonds.length > 0) {
|
|
17435
17456
|
let otherSerial = ic.atoms[atom.serial].bonds[0];
|
|
17436
17457
|
//ic.atoms[atom.serial].bonds = [];
|
|
17437
|
-
let pos = ic.atoms[otherSerial].bonds.indexOf(atom.serial);
|
|
17458
|
+
let pos = (ic.atoms[otherSerial].bonds) ? ic.atoms[otherSerial].bonds.indexOf(atom.serial) : -1;
|
|
17438
17459
|
if(pos !== -1) {
|
|
17439
17460
|
ic.atoms[otherSerial].bonds.splice(pos, 1);
|
|
17440
|
-
ic.atoms[otherSerial].bondOrder.splice(pos, 1);
|
|
17461
|
+
if(ic.atoms[otherSerial].bondOrder) ic.atoms[otherSerial].bondOrder.splice(pos, 1);
|
|
17441
17462
|
}
|
|
17442
17463
|
}
|
|
17443
17464
|
delete ic.dAtoms[atom.serial];
|
|
17444
|
-
delete ic.hAtoms[atom.serial];
|
|
17465
|
+
delete ic.hAtoms[atom.serial];
|
|
17445
17466
|
}
|
|
17446
17467
|
}
|
|
17447
17468
|
}
|
|
@@ -17662,6 +17683,10 @@ class SetColor {
|
|
|
17662
17683
|
colorSpectrum(atoms) { let ic = this.icn3d, me = ic.icn3dui;
|
|
17663
17684
|
let idx = 0;
|
|
17664
17685
|
let cnt = 0;
|
|
17686
|
+
|
|
17687
|
+
// for selected atoms
|
|
17688
|
+
atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
|
|
17689
|
+
|
|
17665
17690
|
for (let i in atoms) {
|
|
17666
17691
|
let atom = ic.atoms[i];
|
|
17667
17692
|
if(!atom.het) ++cnt;
|
|
@@ -17680,6 +17705,10 @@ class SetColor {
|
|
|
17680
17705
|
colorRainbow(atoms) { let ic = this.icn3d, me = ic.icn3dui;
|
|
17681
17706
|
let idx = 0;
|
|
17682
17707
|
let cnt = 0;
|
|
17708
|
+
|
|
17709
|
+
// for selected atoms
|
|
17710
|
+
atoms = me.hashUtilsCls.intHash(atoms, ic.hAtoms);
|
|
17711
|
+
|
|
17683
17712
|
for (let i in atoms) {
|
|
17684
17713
|
let atom = ic.atoms[i];
|
|
17685
17714
|
if(!atom.het) ++cnt;
|
|
@@ -17740,6 +17769,31 @@ class SetColor {
|
|
|
17740
17769
|
this.colorSpectrum(ic.chains[chainid]);
|
|
17741
17770
|
}
|
|
17742
17771
|
break;
|
|
17772
|
+
|
|
17773
|
+
case 'structure':
|
|
17774
|
+
let index = -1, prevStructure = '', colorLength = me.parasCls.stdChainColors.length;
|
|
17775
|
+
for (let i in atoms) {
|
|
17776
|
+
let atom = ic.atoms[i];
|
|
17777
|
+
|
|
17778
|
+
if(atom.structure != prevStructure) {
|
|
17779
|
+
++index;
|
|
17780
|
+
|
|
17781
|
+
index = index % colorLength;
|
|
17782
|
+
}
|
|
17783
|
+
|
|
17784
|
+
if(!atom.het) {
|
|
17785
|
+
atom.color = me.parasCls.stdChainColors[index];
|
|
17786
|
+
ic.atomPrevColors[i] = atom.color;
|
|
17787
|
+
}
|
|
17788
|
+
else {
|
|
17789
|
+
atom.color = me.parasCls.atomColors[atom.elem];
|
|
17790
|
+
ic.atomPrevColors[i] = atom.color;
|
|
17791
|
+
}
|
|
17792
|
+
|
|
17793
|
+
prevStructure = atom.structure;
|
|
17794
|
+
}
|
|
17795
|
+
break;
|
|
17796
|
+
|
|
17743
17797
|
case 'chain':
|
|
17744
17798
|
if(ic.chainsColor !== undefined && Object.keys(ic.chainsColor).length > 0) { // mmdb input
|
|
17745
17799
|
this.setMmdbChainColor();
|
|
@@ -19437,7 +19491,7 @@ class Scap {
|
|
|
19437
19491
|
dataType: "text",
|
|
19438
19492
|
cache: true,
|
|
19439
19493
|
tryCount : 0,
|
|
19440
|
-
retryLimit : 1
|
|
19494
|
+
retryLimit : 0, //1
|
|
19441
19495
|
beforeSend: function() {
|
|
19442
19496
|
ic.ParserUtilsCls.showLoading();
|
|
19443
19497
|
},
|
|
@@ -19641,7 +19695,7 @@ class Symd {
|
|
|
19641
19695
|
dataType: "jsonp",
|
|
19642
19696
|
cache: true,
|
|
19643
19697
|
tryCount : 0,
|
|
19644
|
-
retryLimit : 1
|
|
19698
|
+
retryLimit : 0, //1
|
|
19645
19699
|
beforeSend: function() {
|
|
19646
19700
|
ic.ParserUtilsCls.showLoading();
|
|
19647
19701
|
},
|
|
@@ -20008,7 +20062,7 @@ class Symd {
|
|
|
20008
20062
|
dataType: "json",
|
|
20009
20063
|
cache: true,
|
|
20010
20064
|
tryCount : 0,
|
|
20011
|
-
retryLimit : 1
|
|
20065
|
+
retryLimit : 0, //1
|
|
20012
20066
|
success: function(data) {
|
|
20013
20067
|
let symmetryArray = data.rcsb_struct_symmetry;
|
|
20014
20068
|
let rot, centerFrom, centerTo;
|
|
@@ -20192,7 +20246,9 @@ class LoadPDB {
|
|
|
20192
20246
|
|
|
20193
20247
|
// modified from iview (http://istar.cse.cuhk.edu.hk/iview/)
|
|
20194
20248
|
//This PDB parser feeds the viewer with the content of a PDB file, pdbData.
|
|
20195
|
-
loadPDB(src, pdbid, bOpm, bVector, bMutation, bAppend) { let ic = this.icn3d, me = ic.icn3dui;
|
|
20249
|
+
loadPDB(src, pdbid, bOpm, bVector, bMutation, bAppend, type, bLastQuery) { let ic = this.icn3d, me = ic.icn3dui;
|
|
20250
|
+
let hAtoms = {};
|
|
20251
|
+
|
|
20196
20252
|
let bNMR = false;
|
|
20197
20253
|
let lines = src.split('\n');
|
|
20198
20254
|
|
|
@@ -20249,11 +20305,13 @@ class LoadPDB {
|
|
|
20249
20305
|
|
|
20250
20306
|
let structure = "stru";
|
|
20251
20307
|
|
|
20308
|
+
let bHeader = false;
|
|
20309
|
+
|
|
20252
20310
|
for (let i in lines) {
|
|
20253
20311
|
let line = lines[i];
|
|
20254
20312
|
let record = line.substr(0, 6);
|
|
20255
20313
|
|
|
20256
|
-
if (record === 'HEADER') {
|
|
20314
|
+
if (record === 'HEADER' && !bHeader) {
|
|
20257
20315
|
// if(bOpm === undefined || !bOpm) ic.bSecondaryStructure = true;
|
|
20258
20316
|
|
|
20259
20317
|
///id = line.substr(62, 4).trim();
|
|
@@ -20271,12 +20329,14 @@ class LoadPDB {
|
|
|
20271
20329
|
|
|
20272
20330
|
structure = id;
|
|
20273
20331
|
|
|
20274
|
-
if(id == 'stru' || bMutation || (bAppend && id.length != 4)) { // bMutation: side chain prediction
|
|
20275
|
-
|
|
20332
|
+
//if(id == 'stru' || bMutation || (bAppend && id.length != 4)) { // bMutation: side chain prediction
|
|
20333
|
+
if(id == 'stru' || bMutation) { // bMutation: side chain prediction
|
|
20334
|
+
structure = (moleculeNum === 1) ? id : id + moleculeNum.toString();
|
|
20276
20335
|
}
|
|
20277
20336
|
|
|
20278
20337
|
ic.molTitle = '';
|
|
20279
20338
|
|
|
20339
|
+
bHeader = true; // read the header once only
|
|
20280
20340
|
} else if (record === 'TITLE ') {
|
|
20281
20341
|
let name = line.substr(10);
|
|
20282
20342
|
ic.molTitle += name.trim() + " ";
|
|
@@ -20321,42 +20381,9 @@ class LoadPDB {
|
|
|
20321
20381
|
|
|
20322
20382
|
if(j === startResi) sheetStart.push(resid);
|
|
20323
20383
|
if(j === endResi) sheetEnd.push(resid);
|
|
20324
|
-
}
|
|
20325
|
-
/*
|
|
20326
|
-
sheets.push({
|
|
20327
|
-
structure: structure,
|
|
20328
|
-
chain: startChain,
|
|
20329
|
-
initialResidue: startResi,
|
|
20330
|
-
initialInscode: line.substr(26, 1),
|
|
20331
|
-
terminalResidue: endResi,
|
|
20332
|
-
terminalInscode: line.substr(37, 1),
|
|
20333
|
-
});
|
|
20334
|
-
*/
|
|
20384
|
+
}
|
|
20335
20385
|
} else if (record === 'HBOND ') {
|
|
20336
20386
|
if(bOpm === undefined || !bOpm) ic.bSecondaryStructure = true;
|
|
20337
|
-
/*
|
|
20338
|
-
//HBOND A 1536 N2 A 59 ND2 -19.130 83.151 52.266 -18.079 81.613 49.427 3.40
|
|
20339
|
-
bCalculateHbond = false;
|
|
20340
|
-
|
|
20341
|
-
let chemicalChain = line.substr(6, 1);
|
|
20342
|
-
let chemicalResi = line.substr(8, 4).trim();
|
|
20343
|
-
let chemicalAtom = line.substr(14, 4).trim();
|
|
20344
|
-
let proteinChain = line.substr(18, 1);
|
|
20345
|
-
let proteinResi = line.substr(20, 4).trim();
|
|
20346
|
-
let proteinAtom = line.substr(25, 4).trim();
|
|
20347
|
-
|
|
20348
|
-
let chemical_x = parseFloat(line.substr(30, 8));
|
|
20349
|
-
let chemical_y = parseFloat(line.substr(38, 8));
|
|
20350
|
-
let chemical_z = parseFloat(line.substr(46, 8));
|
|
20351
|
-
let protein_x = parseFloat(line.substr(54, 8));
|
|
20352
|
-
let protein_y = parseFloat(line.substr(62, 8));
|
|
20353
|
-
let protein_z = parseFloat(line.substr(70, 8));
|
|
20354
|
-
|
|
20355
|
-
let dist = line.substr(78, 8).trim();
|
|
20356
|
-
|
|
20357
|
-
ic.hbondpnts.push(new THREE.Vector3(chemical_x, chemical_y, chemical_z));
|
|
20358
|
-
ic.hbondpnts.push(new THREE.Vector3(protein_x, protein_y, protein_z));
|
|
20359
|
-
*/
|
|
20360
20387
|
} else if (record === 'SSBOND') {
|
|
20361
20388
|
ic.bSsbondProvided = true;
|
|
20362
20389
|
//SSBOND 1 CYS E 48 CYS E 51 2555
|
|
@@ -20434,8 +20461,9 @@ class LoadPDB {
|
|
|
20434
20461
|
id = 'stru';
|
|
20435
20462
|
|
|
20436
20463
|
structure = id;
|
|
20437
|
-
if(id == 'stru' || bMutation || (bAppend && id.length != 4)) { // bMutation: side chain prediction
|
|
20438
|
-
|
|
20464
|
+
//if(id == 'stru' || bMutation || (bAppend && id.length != 4)) { // bMutation: side chain prediction
|
|
20465
|
+
if(id == 'stru' || bMutation) { // bMutation: side chain prediction
|
|
20466
|
+
structure = (moleculeNum === 1) ? id : id + moleculeNum.toString();
|
|
20439
20467
|
}
|
|
20440
20468
|
|
|
20441
20469
|
//helices = [];
|
|
@@ -20453,6 +20481,12 @@ class LoadPDB {
|
|
|
20453
20481
|
ic.pmid = line.substr(19).trim();
|
|
20454
20482
|
}
|
|
20455
20483
|
} else if (record === 'ATOM ' || record === 'HETATM') {
|
|
20484
|
+
structure = id;
|
|
20485
|
+
//if(id == 'stru' || bMutation || (bAppend && id.length != 4)) { // bMutation: side chain prediction
|
|
20486
|
+
if(id == 'stru' || bMutation) { // bMutation: side chain prediction
|
|
20487
|
+
structure = (moleculeNum === 1) ? id : id + moleculeNum.toString();
|
|
20488
|
+
}
|
|
20489
|
+
|
|
20456
20490
|
let alt = line.substr(16, 1);
|
|
20457
20491
|
//if (alt !== " " && alt !== "A") continue;
|
|
20458
20492
|
|
|
@@ -20542,6 +20576,7 @@ class LoadPDB {
|
|
|
20542
20576
|
|
|
20543
20577
|
ic.dAtoms[serial] = 1;
|
|
20544
20578
|
ic.hAtoms[serial] = 1;
|
|
20579
|
+
hAtoms[serial] = 1;
|
|
20545
20580
|
|
|
20546
20581
|
// Assign secondary structures from the input
|
|
20547
20582
|
// if a residue is assigned both sheet and helix, it is assigned as sheet
|
|
@@ -20837,9 +20872,23 @@ class LoadPDB {
|
|
|
20837
20872
|
ic.oriMaxD = ic.maxD;
|
|
20838
20873
|
ic.oriCenter = ic.center.clone();
|
|
20839
20874
|
|
|
20875
|
+
if(type === 'target') {
|
|
20876
|
+
ic.oriMaxD = ic.maxD;
|
|
20877
|
+
ic.center1 = ic.center;
|
|
20878
|
+
}
|
|
20879
|
+
else if(type === 'query') {
|
|
20880
|
+
if(ic.oriMaxD < ic.maxD) ic.oriMaxD = ic.maxD;
|
|
20881
|
+
|
|
20882
|
+
ic.center2 = ic.center;
|
|
20883
|
+
ic.center = new THREE.Vector3(0,0,0);
|
|
20884
|
+
}
|
|
20885
|
+
|
|
20840
20886
|
if(bVector) { // just need to get the vector of the largest chain
|
|
20841
20887
|
return this.getChainCalpha(ic.chains, ic.atoms);
|
|
20842
20888
|
}
|
|
20889
|
+
else {
|
|
20890
|
+
return hAtoms;
|
|
20891
|
+
}
|
|
20843
20892
|
}
|
|
20844
20893
|
|
|
20845
20894
|
adjustSeq(chainMissingResidueArray) { let ic = this.icn3d; ic.icn3dui;
|
|
@@ -21039,7 +21088,7 @@ class LoadAtomData {
|
|
|
21039
21088
|
|
|
21040
21089
|
//This function was used to parse atom "data" to set up parameters for the 3D viewer. "type" is mmcifid or mmdbid.
|
|
21041
21090
|
//"id" is the MMDB ID or mmCIF ID.
|
|
21042
|
-
loadAtomDataIn(data, id, type, seqalign, alignType, chainidInput, chainIndex, bLastQuery) { let ic = this.icn3d, me = ic.icn3dui;
|
|
21091
|
+
loadAtomDataIn(data, id, type, seqalign, alignType, chainidInput, chainIndex, bLastQuery, bNoSeqalign) { let ic = this.icn3d, me = ic.icn3dui;
|
|
21043
21092
|
//ic.init();
|
|
21044
21093
|
ic.pmin = new THREE.Vector3( 9999, 9999, 9999);
|
|
21045
21094
|
ic.pmax = new THREE.Vector3(-9999,-9999,-9999);
|
|
@@ -21047,12 +21096,14 @@ class LoadAtomData {
|
|
|
21047
21096
|
|
|
21048
21097
|
let atoms = data.atoms;
|
|
21049
21098
|
|
|
21050
|
-
let serialBase =(alignType === undefined || alignType === 'target') ? 0 : ic.lastTargetSerial;
|
|
21099
|
+
//let serialBase =(alignType === undefined || alignType === 'target') ? 0 : ic.lastTargetSerial;
|
|
21100
|
+
let serialBase = (ic.atoms) ? Object.keys(ic.atoms).length : 0;
|
|
21101
|
+
|
|
21051
21102
|
let serial = serialBase;
|
|
21052
21103
|
|
|
21053
21104
|
let serial2structure = {}; // for "align" only
|
|
21054
21105
|
let mmdbid2pdbid = {}; // for "align" only
|
|
21055
|
-
|
|
21106
|
+
/*
|
|
21056
21107
|
if(alignType === undefined || alignType === 'target') {
|
|
21057
21108
|
ic.pmid = data.pubmedId;
|
|
21058
21109
|
|
|
@@ -21062,6 +21113,12 @@ class LoadAtomData {
|
|
|
21062
21113
|
else {
|
|
21063
21114
|
ic.pmid2 = data.pubmedId;
|
|
21064
21115
|
}
|
|
21116
|
+
*/
|
|
21117
|
+
|
|
21118
|
+
ic.pmid = data.pubmedId;
|
|
21119
|
+
|
|
21120
|
+
if(ic.chainid2title === undefined) ic.chainid2title = {};
|
|
21121
|
+
if(ic.chainid2sid === undefined) ic.chainid2sid = {};
|
|
21065
21122
|
|
|
21066
21123
|
let chainid2kind = {}, chainid2color = {};
|
|
21067
21124
|
|
|
@@ -21125,11 +21182,7 @@ class LoadAtomData {
|
|
|
21125
21182
|
let pdbidTmp = data.pdbId;
|
|
21126
21183
|
let chainHash = {};
|
|
21127
21184
|
|
|
21128
|
-
if(
|
|
21129
|
-
ic.alignmolid2color = [];
|
|
21130
|
-
//ic.alignmolid2color[0] = {}
|
|
21131
|
-
//ic.alignmolid2color[1] = {}
|
|
21132
|
-
}
|
|
21185
|
+
if(ic.alignmolid2color === undefined) ic.alignmolid2color = [];
|
|
21133
21186
|
|
|
21134
21187
|
let molidCnt = 1;
|
|
21135
21188
|
for(let molid in data.moleculeInfor) {
|
|
@@ -21196,7 +21249,6 @@ class LoadAtomData {
|
|
|
21196
21249
|
let CSerial, prevCSerial, OSerial, prevOSerial;
|
|
21197
21250
|
|
|
21198
21251
|
let biopolymerChainsHash = {};
|
|
21199
|
-
|
|
21200
21252
|
for(let i in atoms) {
|
|
21201
21253
|
++serial;
|
|
21202
21254
|
|
|
@@ -21335,24 +21387,7 @@ class LoadAtomData {
|
|
|
21335
21387
|
if(type === 'mmdbid') {
|
|
21336
21388
|
atm.coord = new THREE.Vector3(atm.coord[0], atm.coord[1], atm.coord[2]);
|
|
21337
21389
|
if(ic.q_rotation !== undefined && ic.t_trans_add.length > 0 && !me.cfg.resnum && !me.cfg.resdef) {
|
|
21338
|
-
|
|
21339
|
-
atm.coord.x += ic.t_trans_add[chainIndex].x;
|
|
21340
|
-
atm.coord.y += ic.t_trans_add[chainIndex].y;
|
|
21341
|
-
atm.coord.z += ic.t_trans_add[chainIndex].z;
|
|
21342
|
-
}
|
|
21343
|
-
else if(alignType === 'query') {
|
|
21344
|
-
atm.coord.x -= ic.q_trans_sub[chainIndex].x;
|
|
21345
|
-
atm.coord.y -= ic.q_trans_sub[chainIndex].y;
|
|
21346
|
-
atm.coord.z -= ic.q_trans_sub[chainIndex].z;
|
|
21347
|
-
|
|
21348
|
-
let x = atm.coord.x * ic.q_rotation[chainIndex].x1 + atm.coord.y * ic.q_rotation[chainIndex].y1 + atm.coord.z * ic.q_rotation[chainIndex].z1;
|
|
21349
|
-
let y = atm.coord.x * ic.q_rotation[chainIndex].x2 + atm.coord.y * ic.q_rotation[chainIndex].y2 + atm.coord.z * ic.q_rotation[chainIndex].z2;
|
|
21350
|
-
let z = atm.coord.x * ic.q_rotation[chainIndex].x3 + atm.coord.y * ic.q_rotation[chainIndex].y3 + atm.coord.z * ic.q_rotation[chainIndex].z3;
|
|
21351
|
-
|
|
21352
|
-
atm.coord.x = x;
|
|
21353
|
-
atm.coord.y = y;
|
|
21354
|
-
atm.coord.z = z;
|
|
21355
|
-
}
|
|
21390
|
+
atm = ic.chainalignParserCls.transformAtom(atm, chainIndex, alignType);
|
|
21356
21391
|
}
|
|
21357
21392
|
}
|
|
21358
21393
|
else {
|
|
@@ -21557,8 +21592,7 @@ class LoadAtomData {
|
|
|
21557
21592
|
prevMolid = molid;
|
|
21558
21593
|
}
|
|
21559
21594
|
|
|
21560
|
-
//
|
|
21561
|
-
ic.lastTargetSerial = serial;
|
|
21595
|
+
//ic.lastTargetSerial = serial;
|
|
21562
21596
|
|
|
21563
21597
|
// adjust biopolymer type
|
|
21564
21598
|
for(let chainid in biopolymerChainsHash) {
|
|
@@ -21748,7 +21782,7 @@ class LoadAtomData {
|
|
|
21748
21782
|
if(type === 'align' && seqalign !== undefined && ic.bFullUi) {
|
|
21749
21783
|
ic.setSeqAlignCls.setSeqAlign(seqalign, data.alignedStructures);
|
|
21750
21784
|
} // if(align
|
|
21751
|
-
else if(type === 'mmdbid' && alignType === 'query' && ic.bFullUi && ic.q_rotation !== undefined && !me.cfg.resnum && !me.cfg.resdef) {
|
|
21785
|
+
else if(type === 'mmdbid' && alignType === 'query' && ic.bFullUi && ic.q_rotation !== undefined && !me.cfg.resnum && !me.cfg.resdef && !bNoSeqalign) {
|
|
21752
21786
|
ic.setSeqAlignCls.setSeqAlignChain(chainidInput, chainIndex);
|
|
21753
21787
|
|
|
21754
21788
|
let bReverse = false;
|
|
@@ -21760,8 +21794,11 @@ class LoadAtomData {
|
|
|
21760
21794
|
$("#" + ic.pre + "dl_sequence2").html(oriHtml + seqObj.sequencesHtml);
|
|
21761
21795
|
$("#" + ic.pre + "dl_sequence2").width(me.htmlCls.RESIDUE_WIDTH * seqObj.maxSeqCnt + 200);
|
|
21762
21796
|
}
|
|
21797
|
+
else if(type === 'mmdbid' && alignType === 'target') {
|
|
21798
|
+
hAtoms = ic.hAtoms;
|
|
21799
|
+
}
|
|
21763
21800
|
|
|
21764
|
-
if(type === 'mmdbid' &&(alignType === 'target' || alignType === 'query') && ic.q_rotation === undefined) {
|
|
21801
|
+
if(type === 'mmdbid' && (alignType === 'target' || alignType === 'query') && ic.q_rotation === undefined) {
|
|
21765
21802
|
if(alignType === 'target' || alignType === 'query') {
|
|
21766
21803
|
for(let i in atoms) {
|
|
21767
21804
|
let atom = atoms[i];
|
|
@@ -21822,7 +21859,7 @@ class SdfParser {
|
|
|
21822
21859
|
dataType: 'text',
|
|
21823
21860
|
cache: true,
|
|
21824
21861
|
tryCount : 0,
|
|
21825
|
-
retryLimit : 1
|
|
21862
|
+
retryLimit : 0, //1
|
|
21826
21863
|
beforeSend: function() {
|
|
21827
21864
|
ic.ParserUtilsCls.showLoading();
|
|
21828
21865
|
},
|
|
@@ -22633,7 +22670,7 @@ class PdbParser {
|
|
|
22633
22670
|
dataType: dataType,
|
|
22634
22671
|
cache: true,
|
|
22635
22672
|
tryCount : 0,
|
|
22636
|
-
retryLimit : 1
|
|
22673
|
+
retryLimit : 0, //1
|
|
22637
22674
|
beforeSend: function() {
|
|
22638
22675
|
ic.ParserUtilsCls.showLoading();
|
|
22639
22676
|
},
|
|
@@ -22645,6 +22682,9 @@ class PdbParser {
|
|
|
22645
22682
|
ic.deferredOpm = $.Deferred(function() {
|
|
22646
22683
|
//ic.loadPdbOpmData(data, pdbid);
|
|
22647
22684
|
if(bAf) {
|
|
22685
|
+
// add UniProt ID into the header
|
|
22686
|
+
let header = 'HEADER ' + pdbid + '\n';
|
|
22687
|
+
data = header + data;
|
|
22648
22688
|
ic.opmParserCls.parseAtomData(data, pdbid, undefined, 'pdb', undefined);
|
|
22649
22689
|
}
|
|
22650
22690
|
else {
|
|
@@ -22692,7 +22732,7 @@ class PdbParser {
|
|
|
22692
22732
|
dataType: dataType,
|
|
22693
22733
|
cache: true,
|
|
22694
22734
|
tryCount : 0,
|
|
22695
|
-
retryLimit : 1
|
|
22735
|
+
retryLimit : 0, //1
|
|
22696
22736
|
beforeSend: function() {
|
|
22697
22737
|
ic.ParserUtilsCls.showLoading();
|
|
22698
22738
|
},
|
|
@@ -22738,8 +22778,14 @@ class PdbParser {
|
|
|
22738
22778
|
|
|
22739
22779
|
//Atom "data" from PDB file was parsed to set up parameters for the 3D viewer. The deferred parameter
|
|
22740
22780
|
//was resolved after the parsing so that other javascript code can be executed.
|
|
22741
|
-
loadPdbData(data, pdbid, bOpm, bAppend) { let ic = this.icn3d, me = ic.icn3dui;
|
|
22742
|
-
|
|
22781
|
+
loadPdbData(data, pdbid, bOpm, bAppend, type, bLastQuery, bNoDssp) { let ic = this.icn3d, me = ic.icn3dui;
|
|
22782
|
+
if(!bAppend && (type === undefined || type === 'target')) {
|
|
22783
|
+
// if a command contains "load...", the commands should not be cleared with init()
|
|
22784
|
+
let bKeepCmd = (ic.bCommandLoad) ? true : false;
|
|
22785
|
+
if(!ic.bStatefile) ic.init(bKeepCmd);
|
|
22786
|
+
}
|
|
22787
|
+
|
|
22788
|
+
let hAtoms = ic.loadPDBCls.loadPDB(data, pdbid, bOpm, undefined, undefined, bAppend, type, bLastQuery); // defined in the core library
|
|
22743
22789
|
|
|
22744
22790
|
if(me.cfg.opmid === undefined) ic.ParserUtilsCls.transformToOpmOri(pdbid);
|
|
22745
22791
|
|
|
@@ -22775,17 +22821,23 @@ class PdbParser {
|
|
|
22775
22821
|
}
|
|
22776
22822
|
|
|
22777
22823
|
// if(!ic.bSecondaryStructure && Object.keys(ic.proteins).length > 0) {
|
|
22778
|
-
if((!ic.bSecondaryStructure || bCalcSecondary) && Object.keys(ic.proteins).length > 0) {
|
|
22779
|
-
|
|
22780
|
-
let bCalphaOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(ic.proteins, ic.atoms));//, 'CA');
|
|
22781
|
-
ic.dsspCls.applyDssp(bCalphaOnly, bAppend);
|
|
22782
|
-
}); // end of me.deferred = $.Deferred(function() {
|
|
22783
|
-
|
|
22784
|
-
return ic.deferredSecondary.promise();
|
|
22824
|
+
if((!ic.bSecondaryStructure || bCalcSecondary) && Object.keys(ic.proteins).length > 0 && !bNoDssp) {
|
|
22825
|
+
this.applyCommandDssp(bAppend);
|
|
22785
22826
|
}
|
|
22786
22827
|
else {
|
|
22787
22828
|
this.loadPdbDataRender(bAppend);
|
|
22788
22829
|
}
|
|
22830
|
+
|
|
22831
|
+
return hAtoms;
|
|
22832
|
+
}
|
|
22833
|
+
|
|
22834
|
+
applyCommandDssp(bAppend) { let ic = this.icn3d, me = ic.icn3dui;
|
|
22835
|
+
ic.deferredSecondary = $.Deferred(function() {
|
|
22836
|
+
let bCalphaOnly = me.utilsCls.isCalphaPhosOnly(me.hashUtilsCls.hash2Atoms(ic.proteins, ic.atoms));//, 'CA');
|
|
22837
|
+
ic.dsspCls.applyDssp(bCalphaOnly, bAppend);
|
|
22838
|
+
}); // end of me.deferred = $.Deferred(function() {
|
|
22839
|
+
|
|
22840
|
+
return ic.deferredSecondary.promise();
|
|
22789
22841
|
}
|
|
22790
22842
|
|
|
22791
22843
|
loadPdbDataRender(bAppend) { let ic = this.icn3d, me = ic.icn3dui;
|
|
@@ -23619,7 +23671,7 @@ class AlignParser {
|
|
|
23619
23671
|
dataType: dataType,
|
|
23620
23672
|
cache: true,
|
|
23621
23673
|
//tryCount : 0,
|
|
23622
|
-
//retryLimit : 1
|
|
23674
|
+
//retryLimit : 0, //1
|
|
23623
23675
|
success: function(opmdata) {
|
|
23624
23676
|
ic.selectedPdbid = mmdbidArray[0];
|
|
23625
23677
|
|
|
@@ -23646,7 +23698,7 @@ class AlignParser {
|
|
|
23646
23698
|
dataType: dataType,
|
|
23647
23699
|
cache: true,
|
|
23648
23700
|
//tryCount : 0,
|
|
23649
|
-
//retryLimit : 1
|
|
23701
|
+
//retryLimit : 0, //1
|
|
23650
23702
|
success: function(opmdata) {
|
|
23651
23703
|
ic.selectedPdbid = mmdbidArray[1];
|
|
23652
23704
|
|
|
@@ -23708,7 +23760,7 @@ class OpmParser {
|
|
|
23708
23760
|
dataType: dataType,
|
|
23709
23761
|
cache: true,
|
|
23710
23762
|
tryCount : 0,
|
|
23711
|
-
retryLimit : 1
|
|
23763
|
+
retryLimit : 0, //1
|
|
23712
23764
|
beforeSend: function() {
|
|
23713
23765
|
ic.ParserUtilsCls.showLoading();
|
|
23714
23766
|
},
|
|
@@ -23752,7 +23804,7 @@ class OpmParser {
|
|
|
23752
23804
|
dataType: dataType,
|
|
23753
23805
|
cache: true,
|
|
23754
23806
|
tryCount : 0,
|
|
23755
|
-
retryLimit : 1
|
|
23807
|
+
retryLimit : 0, //1
|
|
23756
23808
|
success: function(opmdata) {
|
|
23757
23809
|
thisClass.setOpmData(opmdata); // set ic.bOpm
|
|
23758
23810
|
|
|
@@ -23924,7 +23976,7 @@ class MmdbParser {
|
|
|
23924
23976
|
//ic.loadAtomDataCls.loadAtomDataIn(data, id, 'mmdbid', undefined, type);
|
|
23925
23977
|
}
|
|
23926
23978
|
|
|
23927
|
-
parseMmdbData(data, type, chainid, chainIndex, bLastQuery) { let ic = this.icn3d; ic.icn3dui;
|
|
23979
|
+
parseMmdbData(data, type, chainid, chainIndex, bLastQuery, bNoTransformNoSeqalign) { let ic = this.icn3d; ic.icn3dui;
|
|
23928
23980
|
if(type === undefined) {
|
|
23929
23981
|
//ic.deferredOpm = $.Deferred(function() {
|
|
23930
23982
|
let id =(data.pdbId !== undefined) ? data.pdbId : data.mmdbId;
|
|
@@ -23941,7 +23993,7 @@ class MmdbParser {
|
|
|
23941
23993
|
|
|
23942
23994
|
let id =(data.pdbId !== undefined) ? data.pdbId : data.mmdbId;
|
|
23943
23995
|
|
|
23944
|
-
let hAtoms = ic.loadAtomDataCls.loadAtomDataIn(data, id, 'mmdbid', undefined, type, chainid, chainIndex, bLastQuery);
|
|
23996
|
+
let hAtoms = ic.loadAtomDataCls.loadAtomDataIn(data, id, 'mmdbid', undefined, type, chainid, chainIndex, bLastQuery, bNoTransformNoSeqalign);
|
|
23945
23997
|
|
|
23946
23998
|
this.loadMmdbOpmDataPart2(data, id, type);
|
|
23947
23999
|
|
|
@@ -23985,7 +24037,7 @@ class MmdbParser {
|
|
|
23985
24037
|
dataType: 'jsonp',
|
|
23986
24038
|
cache: true,
|
|
23987
24039
|
tryCount : 0,
|
|
23988
|
-
retryLimit : 1
|
|
24040
|
+
retryLimit : 0, //1
|
|
23989
24041
|
beforeSend: function() {
|
|
23990
24042
|
ic.ParserUtilsCls.showLoading();
|
|
23991
24043
|
},
|
|
@@ -24014,7 +24066,7 @@ class MmdbParser {
|
|
|
24014
24066
|
dataType: 'jsonp',
|
|
24015
24067
|
cache: true,
|
|
24016
24068
|
tryCount : 0,
|
|
24017
|
-
retryLimit : 1
|
|
24069
|
+
retryLimit : 0, //1
|
|
24018
24070
|
beforeSend: function() {
|
|
24019
24071
|
ic.ParserUtilsCls.showLoading();
|
|
24020
24072
|
},
|
|
@@ -24251,7 +24303,7 @@ class MmdbParser {
|
|
|
24251
24303
|
dataType: 'json',
|
|
24252
24304
|
cache: true,
|
|
24253
24305
|
tryCount : 0,
|
|
24254
|
-
retryLimit : 1
|
|
24306
|
+
retryLimit : 0, //1
|
|
24255
24307
|
beforeSend: function() {
|
|
24256
24308
|
//ic.ParserUtilsCls.showLoading();
|
|
24257
24309
|
},
|
|
@@ -24519,9 +24571,77 @@ class RealignParser {
|
|
|
24519
24571
|
}
|
|
24520
24572
|
|
|
24521
24573
|
let bRealign = true;
|
|
24574
|
+
|
|
24522
24575
|
this.realignChainOnSeqAlign(undefined, chainidArray, bRealign);
|
|
24523
24576
|
}
|
|
24524
24577
|
|
|
24578
|
+
realignOnStructAlign() { let ic = this.icn3d, me = ic.icn3dui;
|
|
24579
|
+
// each 3D domain should have at least 3 secondary structures
|
|
24580
|
+
let minSseCnt = 3;
|
|
24581
|
+
let struct2domain = {};
|
|
24582
|
+
for(let struct in ic.structures) {
|
|
24583
|
+
struct2domain[struct] = {};
|
|
24584
|
+
let chainidArray = ic.structures[struct];
|
|
24585
|
+
for(let i = 0, il = chainidArray.length; i < il; ++i) {
|
|
24586
|
+
let chainid = chainidArray[i];
|
|
24587
|
+
let atoms = me.hashUtilsCls.intHash(ic.hAtoms, ic.chains[chainid]);
|
|
24588
|
+
let sseCnt = 0;
|
|
24589
|
+
for(let serial in atoms) {
|
|
24590
|
+
if(ic.atoms[serial].ssbegin) ++sseCnt;
|
|
24591
|
+
if(sseCnt == minSseCnt) {
|
|
24592
|
+
struct2domain[struct][chainid] = atoms;
|
|
24593
|
+
break;
|
|
24594
|
+
}
|
|
24595
|
+
}
|
|
24596
|
+
}
|
|
24597
|
+
}
|
|
24598
|
+
|
|
24599
|
+
let ajaxArray = [], chainidPairArray = [];
|
|
24600
|
+
let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
|
|
24601
|
+
let structArray = Object.keys(struct2domain);
|
|
24602
|
+
for(let s = 0, sl = structArray.length; s < sl; ++s) {
|
|
24603
|
+
let struct1 = structArray[s];
|
|
24604
|
+
let chainidArray1 = Object.keys(struct2domain[struct1]);
|
|
24605
|
+
if(chainidArray1.length == 0) continue;
|
|
24606
|
+
for(let t = s+1, tl = structArray.length; t < tl; ++t) {
|
|
24607
|
+
let struct2 = structArray[t];
|
|
24608
|
+
let chainidArray2 = Object.keys(struct2domain[struct2]);
|
|
24609
|
+
if(chainidArray2.length == 0) continue;
|
|
24610
|
+
|
|
24611
|
+
for(let i = 0, il = chainidArray1.length; i < il; ++i) {
|
|
24612
|
+
let chainid1 = chainidArray1[i];
|
|
24613
|
+
for(let j = 0, jl = chainidArray2.length; j < jl; ++j) {
|
|
24614
|
+
let chainid2 = chainidArray2[j];
|
|
24615
|
+
|
|
24616
|
+
let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct1][chainid1]);
|
|
24617
|
+
let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(struct2domain[struct2][chainid2]);
|
|
24618
|
+
|
|
24619
|
+
let alignAjax = $.ajax({
|
|
24620
|
+
url: urlalign,
|
|
24621
|
+
type: 'POST',
|
|
24622
|
+
data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
|
|
24623
|
+
dataType: 'jsonp',
|
|
24624
|
+
cache: true
|
|
24625
|
+
});
|
|
24626
|
+
|
|
24627
|
+
ajaxArray.push(alignAjax);
|
|
24628
|
+
chainidPairArray.push(chainid1 + ',' + chainid2); // chainid2 is target
|
|
24629
|
+
}
|
|
24630
|
+
}
|
|
24631
|
+
}
|
|
24632
|
+
}
|
|
24633
|
+
|
|
24634
|
+
//https://stackoverflow.com/questions/14352139/multiple-ajax-calls-from-array-and-handle-callback-when-completed
|
|
24635
|
+
//https://stackoverflow.com/questions/5518181/jquery-deferreds-when-and-the-fail-callback-arguments
|
|
24636
|
+
$.when.apply(undefined, ajaxArray).then(function() {
|
|
24637
|
+
let dataArray =(chainidPairArray.length == 1) ? [arguments] : Array.from(arguments);
|
|
24638
|
+
ic.chainalignParserCls.downloadChainalignmentPart2bRealign(dataArray, chainidPairArray);
|
|
24639
|
+
})
|
|
24640
|
+
.fail(function() {
|
|
24641
|
+
var aaa = 1; //alert("These structures can NOT be aligned to each other...");
|
|
24642
|
+
});
|
|
24643
|
+
}
|
|
24644
|
+
|
|
24525
24645
|
realignChainOnSeqAlign(chainresiCalphaHash2, chainidArray, bRealign, bPredefined) { let ic = this.icn3d, me = ic.icn3dui;
|
|
24526
24646
|
let thisClass = this;
|
|
24527
24647
|
|
|
@@ -24534,7 +24654,7 @@ class RealignParser {
|
|
|
24534
24654
|
|
|
24535
24655
|
let mmdbid_t;
|
|
24536
24656
|
let ajaxArray = [];
|
|
24537
|
-
let url =
|
|
24657
|
+
let url = me.htmlCls.baseUrl + 'pwaln/pwaln.fcgi?from=chainalign';
|
|
24538
24658
|
|
|
24539
24659
|
let predefinedResArray, predefinedRes;
|
|
24540
24660
|
|
|
@@ -24579,13 +24699,6 @@ class RealignParser {
|
|
|
24579
24699
|
if(i == 0 || bPredefined) { // master
|
|
24580
24700
|
let base = parseInt(ic.chainsSeq[chainid][0].resi);
|
|
24581
24701
|
|
|
24582
|
-
//let resRange;
|
|
24583
|
-
//if(bRealign) {
|
|
24584
|
-
// let seqLen = ic.chainsSeq[chainid].length;
|
|
24585
|
-
// let lastResi = ic.chainsSeq[chainid][seqLen - 1].resi;
|
|
24586
|
-
// resRange = base.toString() + '-' + lastResi.toString();
|
|
24587
|
-
//}
|
|
24588
|
-
|
|
24589
24702
|
let resiArray = [];
|
|
24590
24703
|
if(bRealign) {
|
|
24591
24704
|
//resiArray = [resRange];
|
|
@@ -24686,11 +24799,11 @@ class RealignParser {
|
|
|
24686
24799
|
let seq2 = struct2SeqHash[fromStruct];
|
|
24687
24800
|
|
|
24688
24801
|
let queryAjax = $.ajax({
|
|
24689
|
-
|
|
24690
|
-
|
|
24691
|
-
|
|
24692
|
-
|
|
24693
|
-
|
|
24802
|
+
url: url,
|
|
24803
|
+
type: 'POST',
|
|
24804
|
+
data : {'targets': seq1, 'queries': seq2},
|
|
24805
|
+
dataType: 'jsonp',
|
|
24806
|
+
cache: true
|
|
24694
24807
|
});
|
|
24695
24808
|
|
|
24696
24809
|
ajaxArray.push(queryAjax);
|
|
@@ -24704,8 +24817,8 @@ class RealignParser {
|
|
|
24704
24817
|
//https://stackoverflow.com/questions/14352139/multiple-ajax-calls-from-array-and-handle-callback-when-completed
|
|
24705
24818
|
//https://stackoverflow.com/questions/5518181/jquery-deferreds-when-and-the-fail-callback-arguments
|
|
24706
24819
|
$.when.apply(undefined, ajaxArray).then(function() {
|
|
24707
|
-
|
|
24708
|
-
|
|
24820
|
+
let dataArray =(chainidArray.length == 2) ? [arguments] : Array.from(arguments);
|
|
24821
|
+
thisClass.parseChainRealignData(Array.from(dataArray), chainresiCalphaHash2, chainidArray, struct2SeqHash, struct2CoorHash, struct2resid, bRealign);
|
|
24709
24822
|
})
|
|
24710
24823
|
.fail(function() {
|
|
24711
24824
|
var aaa = 1; //alert("The realignment did not work...");
|
|
@@ -24743,17 +24856,33 @@ class ChainalignParser {
|
|
|
24743
24856
|
}
|
|
24744
24857
|
|
|
24745
24858
|
downloadChainalignmentPart2(data1, data2Array, chainresiCalphaHash2, chainidArray) { let ic = this.icn3d, me = ic.icn3dui;
|
|
24746
|
-
|
|
24747
|
-
//ic.mmdb_data_q = [];
|
|
24748
|
-
|
|
24749
|
-
let hAtoms = {};
|
|
24750
|
-
hAtoms = ic.mmdbParserCls.parseMmdbData(data1, 'target', chainidArray[0], 0);
|
|
24859
|
+
let thisClass = this;
|
|
24751
24860
|
|
|
24861
|
+
let hAtoms = {}, hAtomsTmp = {};
|
|
24862
|
+
let mmdbid_t, mmdbid_q;
|
|
24863
|
+
mmdbid_t = chainidArray[0].substr(0, chainidArray[0].indexOf('_'));
|
|
24752
24864
|
let bLastQuery = false;
|
|
24865
|
+
if(mmdbid_t.length > 4) {
|
|
24866
|
+
let bAppend = false, bNoDssp = true;
|
|
24867
|
+
hAtoms = ic.pdbParserCls.loadPdbData(data1, mmdbid_t, false, bAppend, 'target', bLastQuery, bNoDssp);
|
|
24868
|
+
}
|
|
24869
|
+
else {
|
|
24870
|
+
let bNoSeqalign = true;
|
|
24871
|
+
hAtoms = ic.mmdbParserCls.parseMmdbData(data1, 'target', chainidArray[0], 0, bLastQuery, bNoSeqalign);
|
|
24872
|
+
}
|
|
24873
|
+
|
|
24753
24874
|
for(let i = 0, il = data2Array.length; i < il; ++i) {
|
|
24754
24875
|
if(i == data2Array.length - 1) bLastQuery = true;
|
|
24755
24876
|
// each alignment has a chainIndex i
|
|
24756
|
-
|
|
24877
|
+
mmdbid_q = chainidArray[i + 1].substr(0, chainidArray[i + 1].indexOf('_'));
|
|
24878
|
+
if(mmdbid_q.length > 4) {
|
|
24879
|
+
let bAppend = true, bNoDssp = true;
|
|
24880
|
+
hAtomsTmp = ic.pdbParserCls.loadPdbData(data2Array[i], mmdbid_q, false, bAppend, 'query', bLastQuery, bNoDssp);
|
|
24881
|
+
}
|
|
24882
|
+
else {
|
|
24883
|
+
let bNoSeqalign = true;
|
|
24884
|
+
hAtomsTmp = ic.mmdbParserCls.parseMmdbData(data2Array[i], 'query', chainidArray[i + 1], i, bLastQuery, bNoSeqalign);
|
|
24885
|
+
}
|
|
24757
24886
|
hAtoms = me.hashUtilsCls.unionHash(hAtoms, hAtomsTmp);
|
|
24758
24887
|
}
|
|
24759
24888
|
|
|
@@ -24764,10 +24893,258 @@ class ChainalignParser {
|
|
|
24764
24893
|
ic.realignParserCls.realignChainOnSeqAlign(chainresiCalphaHash2, chainidArray, undefined, true);
|
|
24765
24894
|
}
|
|
24766
24895
|
else {
|
|
24767
|
-
|
|
24896
|
+
// calculate secondary structures with applyCommandDssp
|
|
24897
|
+
$.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
|
|
24898
|
+
// dynamicly align pairs in ic.afChainIndexHash
|
|
24899
|
+
let ajaxArray = [], indexArray = [], struArray = [];
|
|
24900
|
+
let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
|
|
24901
|
+
|
|
24902
|
+
for(let index in ic.afChainIndexHash) {
|
|
24903
|
+
let idArray = ic.afChainIndexHash[index].split('_');
|
|
24904
|
+
mmdbid_q = idArray[0];
|
|
24905
|
+
let chain_q = idArray[1];
|
|
24906
|
+
mmdbid_t = idArray[2];
|
|
24907
|
+
let chain_t = idArray[3];
|
|
24908
|
+
|
|
24909
|
+
let jsonStr_q = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_q + '_' + chain_q]);
|
|
24910
|
+
|
|
24911
|
+
let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(ic.chains[mmdbid_t + '_' + chain_t]);
|
|
24912
|
+
|
|
24913
|
+
let alignAjax = $.ajax({
|
|
24914
|
+
url: urlalign,
|
|
24915
|
+
type: 'POST',
|
|
24916
|
+
data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
|
|
24917
|
+
dataType: 'jsonp',
|
|
24918
|
+
cache: true
|
|
24919
|
+
});
|
|
24920
|
+
|
|
24921
|
+
ajaxArray.push(alignAjax);
|
|
24922
|
+
indexArray.push(index - 1);
|
|
24923
|
+
struArray.push(mmdbid_q);
|
|
24924
|
+
}
|
|
24925
|
+
|
|
24926
|
+
//https://stackoverflow.com/questions/14352139/multiple-ajax-calls-from-array-and-handle-callback-when-completed
|
|
24927
|
+
//https://stackoverflow.com/questions/5518181/jquery-deferreds-when-and-the-fail-callback-arguments
|
|
24928
|
+
$.when.apply(undefined, ajaxArray).then(function() {
|
|
24929
|
+
let dataArray =(indexArray.length == 1) ? [arguments] : Array.from(arguments);
|
|
24930
|
+
thisClass.downloadChainalignmentPart2b(chainresiCalphaHash2, chainidArray, hAtoms, dataArray, indexArray, mmdbid_t, struArray);
|
|
24931
|
+
})
|
|
24932
|
+
.fail(function() {
|
|
24933
|
+
var aaa = 1; //alert("These structures can NOT be aligned to each other...");
|
|
24934
|
+
});
|
|
24935
|
+
});
|
|
24768
24936
|
}
|
|
24769
24937
|
}
|
|
24770
24938
|
|
|
24939
|
+
downloadChainalignmentPart2b(chainresiCalphaHash2, chainidArray, hAtoms, dataArray, indexArray, mmdbid_t, struArray) { let ic = this.icn3d, me = ic.icn3dui;
|
|
24940
|
+
let bTargetTransformed = (ic.qt_start_end[0]) ? true : false;
|
|
24941
|
+
|
|
24942
|
+
// modify the previous trans and rotation matrix
|
|
24943
|
+
for(let i = 0, il = dataArray.length; i < il; ++i) {
|
|
24944
|
+
let align = dataArray[i][0];
|
|
24945
|
+
|
|
24946
|
+
let mmdbid_q = struArray[i];
|
|
24947
|
+
let index = indexArray[i];
|
|
24948
|
+
|
|
24949
|
+
let bEqualMmdbid = (mmdbid_q == mmdbid_t);
|
|
24950
|
+
let bEqualChain = false;
|
|
24951
|
+
|
|
24952
|
+
let queryData = {}; // check whether undefined
|
|
24953
|
+
|
|
24954
|
+
this.processAlign(align, index, queryData, bEqualMmdbid, bEqualChain);
|
|
24955
|
+
}
|
|
24956
|
+
|
|
24957
|
+
// transform the target if not yet
|
|
24958
|
+
if(!bTargetTransformed) {
|
|
24959
|
+
this.transformStructure(mmdbid_t, indexArray[0], 'target');
|
|
24960
|
+
}
|
|
24961
|
+
|
|
24962
|
+
// transform the rest
|
|
24963
|
+
for(let i = 0, il = dataArray.length; i < il; ++i) {
|
|
24964
|
+
let mmdbid_q = struArray[i];
|
|
24965
|
+
let index = indexArray[i];
|
|
24966
|
+
|
|
24967
|
+
this.transformStructure(mmdbid_q, index, 'query');
|
|
24968
|
+
}
|
|
24969
|
+
|
|
24970
|
+
/*
|
|
24971
|
+
// transform the target
|
|
24972
|
+
this.transformStructure(mmdbid_t, 0, 'target');
|
|
24973
|
+
|
|
24974
|
+
// transform the queries
|
|
24975
|
+
for(let i = 1, il = chainidArray.length; i < il; ++i) {
|
|
24976
|
+
let mmdbid_q = chainidArray[i].substr(0, chainidArray[i].indexOf('_'));
|
|
24977
|
+
|
|
24978
|
+
this.transformStructure(mmdbid_q, i - 1, 'query');
|
|
24979
|
+
}
|
|
24980
|
+
*/
|
|
24981
|
+
|
|
24982
|
+
let hAtomsTmp = {}, hAtomsAll = {};
|
|
24983
|
+
// set up the view of sequence alignment
|
|
24984
|
+
for(let i = 1, il = chainidArray.length; i < il; ++i) {
|
|
24985
|
+
if(ic.bFullUi && ic.q_rotation !== undefined && !me.cfg.resnum && !me.cfg.resdef) {
|
|
24986
|
+
hAtomsTmp = ic.setSeqAlignCls.setSeqAlignChain(chainidArray[i], i-1);
|
|
24987
|
+
|
|
24988
|
+
hAtomsAll = me.hashUtilsCls.unionHash(hAtomsAll, hAtomsTmp);
|
|
24989
|
+
|
|
24990
|
+
let bReverse = false;
|
|
24991
|
+
let seqObj = me.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(ic.alnChains), undefined, undefined, false, undefined, bReverse);
|
|
24992
|
+
let oriHtml = $("#" + ic.pre + "dl_sequence2").html();
|
|
24993
|
+
|
|
24994
|
+
$("#" + ic.pre + "dl_sequence2").html(oriHtml + seqObj.sequencesHtml);
|
|
24995
|
+
$("#" + ic.pre + "dl_sequence2").width(me.htmlCls.RESIDUE_WIDTH * seqObj.maxSeqCnt + 200);
|
|
24996
|
+
}
|
|
24997
|
+
}
|
|
24998
|
+
|
|
24999
|
+
// highlight all aligned atoms
|
|
25000
|
+
ic.hAtoms = me.hashUtilsCls.cloneHash(hAtomsTmp);
|
|
25001
|
+
|
|
25002
|
+
// do the rest
|
|
25003
|
+
this.downloadChainalignmentPart3(chainresiCalphaHash2, chainidArray, ic.hAtoms);
|
|
25004
|
+
}
|
|
25005
|
+
|
|
25006
|
+
downloadChainalignmentPart2bRealign(dataArray, chainidPairArray) { let ic = this.icn3d, me = ic.icn3dui;
|
|
25007
|
+
// set trans and rotation matrix
|
|
25008
|
+
ic.t_trans_add = [];
|
|
25009
|
+
ic.q_trans_sub = [];
|
|
25010
|
+
ic.q_rotation = [];
|
|
25011
|
+
ic.qt_start_end = [];
|
|
25012
|
+
|
|
25013
|
+
let mmdbid2cnt = {}, mmdbidpairHash = {};
|
|
25014
|
+
|
|
25015
|
+
for(let i = 0, il = dataArray.length; i < il; ++i) {
|
|
25016
|
+
let align = dataArray[i][0];
|
|
25017
|
+
|
|
25018
|
+
let bEqualMmdbid = false;
|
|
25019
|
+
let bEqualChain = false;
|
|
25020
|
+
|
|
25021
|
+
let queryData = {}; // check whether undefined
|
|
25022
|
+
|
|
25023
|
+
let bNoAlert = true;
|
|
25024
|
+
let bAligned = this.processAlign(align, i, queryData, bEqualMmdbid, bEqualChain, bNoAlert);
|
|
25025
|
+
|
|
25026
|
+
if(bAligned) {
|
|
25027
|
+
let chainpair = chainidPairArray[i].split(',');
|
|
25028
|
+
let mmdbid1 = chainpair[0].substr(0, chainpair[0].indexOf('_'));
|
|
25029
|
+
let mmdbid2 = chainpair[1].substr(0, chainpair[1].indexOf('_'));
|
|
25030
|
+
if(mmdbidpairHash.hasOwnProperty(mmdbid1 + '_' + mmdbid2)) { // aligned already
|
|
25031
|
+
continue;
|
|
25032
|
+
}
|
|
25033
|
+
else {
|
|
25034
|
+
mmdbid2cnt[mmdbid1] = (mmdbid2cnt[mmdbid1] === undefined) ? 1 : ++mmdbid2cnt[mmdbid1];
|
|
25035
|
+
mmdbid2cnt[mmdbid2] = (mmdbid2cnt[mmdbid2] === undefined) ? 1 : ++mmdbid2cnt[mmdbid2];
|
|
25036
|
+
|
|
25037
|
+
mmdbidpairHash[mmdbid1 + '_' + mmdbid2] = chainpair + ',' + i;
|
|
25038
|
+
}
|
|
25039
|
+
}
|
|
25040
|
+
}
|
|
25041
|
+
/*
|
|
25042
|
+
// find the max aligned mmdbid as mmdbid_t
|
|
25043
|
+
let cnt = 0, mmdbid_t;
|
|
25044
|
+
for(let mmdbidpair in mmdbidpairHash) {
|
|
25045
|
+
let mmdbidArray = mmdbidpair.split('_');
|
|
25046
|
+
if(mmdbid2cnt[mmdbidArray[0]] > cnt) {
|
|
25047
|
+
cnt = mmdbid2cnt[mmdbidArray[0]];
|
|
25048
|
+
mmdbid_t = mmdbidArray[0];
|
|
25049
|
+
}
|
|
25050
|
+
if(mmdbid2cnt[mmdbidArray[1]] > cnt) {
|
|
25051
|
+
cnt = mmdbid2cnt[mmdbidArray[1]];
|
|
25052
|
+
mmdbid_t = mmdbidArray[1];
|
|
25053
|
+
}
|
|
25054
|
+
}
|
|
25055
|
+
*/
|
|
25056
|
+
let aligType;
|
|
25057
|
+
// transform all pairs
|
|
25058
|
+
let allChainidHash = {}, hAtoms = {};
|
|
25059
|
+
for(let mmdbidpair in mmdbidpairHash) {
|
|
25060
|
+
let mmdbidArray = mmdbidpair.split('_');
|
|
25061
|
+
let chainidArray = mmdbidpairHash[mmdbidpair].split(',');
|
|
25062
|
+
let index = chainidArray[2];
|
|
25063
|
+
|
|
25064
|
+
// chainid2 is target
|
|
25065
|
+
aligType = 'query';
|
|
25066
|
+
this.transformStructure(mmdbidArray[0], index, aligType);
|
|
25067
|
+
|
|
25068
|
+
aligType = 'target';
|
|
25069
|
+
this.transformStructure(mmdbidArray[1], index, aligType);
|
|
25070
|
+
|
|
25071
|
+
allChainidHash[chainidArray[0]] = 1;
|
|
25072
|
+
allChainidHash[chainidArray[1]] = 1;
|
|
25073
|
+
|
|
25074
|
+
hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.chains[chainidArray[0]]);
|
|
25075
|
+
hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.chains[chainidArray[1]]);
|
|
25076
|
+
}
|
|
25077
|
+
|
|
25078
|
+
// set up the view of sequence alignment for each pair
|
|
25079
|
+
for(let mmdbidpair in mmdbidpairHash) {
|
|
25080
|
+
if(ic.q_rotation !== undefined) {
|
|
25081
|
+
let chainidArray = mmdbidpairHash[mmdbidpair].split(',');
|
|
25082
|
+
|
|
25083
|
+
ic.setSeqAlignCls.setSeqAlignChain(undefined, undefined, chainidArray);
|
|
25084
|
+
|
|
25085
|
+
let bReverse = false;
|
|
25086
|
+
let seqObj = me.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(ic.alnChains), undefined, undefined, false, undefined, bReverse);
|
|
25087
|
+
let oriHtml = $("#" + ic.pre + "dl_sequence2").html();
|
|
25088
|
+
|
|
25089
|
+
$("#" + ic.pre + "dl_sequence2").html(oriHtml + seqObj.sequencesHtml);
|
|
25090
|
+
$("#" + ic.pre + "dl_sequence2").width(me.htmlCls.RESIDUE_WIDTH * seqObj.maxSeqCnt + 200);
|
|
25091
|
+
}
|
|
25092
|
+
}
|
|
25093
|
+
|
|
25094
|
+
//this.downloadChainalignmentPart3(undefined, Object.keys(allChainidHash), hAtoms);
|
|
25095
|
+
|
|
25096
|
+
ic.dAtoms = hAtoms;
|
|
25097
|
+
ic.hAtoms = hAtoms;
|
|
25098
|
+
|
|
25099
|
+
ic.opts['color'] = 'identity';
|
|
25100
|
+
//ic.setColorCls.setColorByOptions(ic.opts, ic.atoms);
|
|
25101
|
+
ic.setColorCls.setColorByOptions(ic.opts, ic.hAtoms);
|
|
25102
|
+
|
|
25103
|
+
me.htmlCls.dialogCls.openDlg('dl_alignment', 'Select residues in aligned sequences');
|
|
25104
|
+
|
|
25105
|
+
ic.drawCls.draw();
|
|
25106
|
+
ic.hlUpdateCls.updateHlAll();
|
|
25107
|
+
|
|
25108
|
+
if(ic.deferredRealignByStruct !== undefined) ic.deferredRealignByStruct.resolve();
|
|
25109
|
+
}
|
|
25110
|
+
|
|
25111
|
+
transformStructure(mmdbid, index, alignType) { let ic = this.icn3d, me = ic.icn3dui;
|
|
25112
|
+
let chainidArray = ic.structures[mmdbid];
|
|
25113
|
+
|
|
25114
|
+
for(let i = 0, il = chainidArray.length; i < il; ++i) {
|
|
25115
|
+
for(let serial in ic.chains[chainidArray[i]]) {
|
|
25116
|
+
let atm = ic.atoms[serial];
|
|
25117
|
+
//atm.coord = new THREE.Vector3(atm.coord[0], atm.coord[1], atm.coord[2]);
|
|
25118
|
+
if(ic.q_rotation !== undefined && ic.t_trans_add.length > 0 && !me.cfg.resnum && !me.cfg.resdef) {
|
|
25119
|
+
atm = this.transformAtom(atm, index, alignType);
|
|
25120
|
+
}
|
|
25121
|
+
}
|
|
25122
|
+
}
|
|
25123
|
+
}
|
|
25124
|
+
|
|
25125
|
+
transformAtom(atm, index, alignType) { let ic = this.icn3d; ic.icn3dui;
|
|
25126
|
+
if(alignType === 'target') ;
|
|
25127
|
+
else if(alignType === 'query') {
|
|
25128
|
+
atm.coord.x -= ic.q_trans_sub[index].x;
|
|
25129
|
+
atm.coord.y -= ic.q_trans_sub[index].y;
|
|
25130
|
+
atm.coord.z -= ic.q_trans_sub[index].z;
|
|
25131
|
+
|
|
25132
|
+
let x = atm.coord.x * ic.q_rotation[index].x1 + atm.coord.y * ic.q_rotation[index].y1 + atm.coord.z * ic.q_rotation[index].z1;
|
|
25133
|
+
let y = atm.coord.x * ic.q_rotation[index].x2 + atm.coord.y * ic.q_rotation[index].y2 + atm.coord.z * ic.q_rotation[index].z2;
|
|
25134
|
+
let z = atm.coord.x * ic.q_rotation[index].x3 + atm.coord.y * ic.q_rotation[index].y3 + atm.coord.z * ic.q_rotation[index].z3;
|
|
25135
|
+
|
|
25136
|
+
x -= ic.t_trans_add[index].x;
|
|
25137
|
+
y -= ic.t_trans_add[index].y;
|
|
25138
|
+
z -= ic.t_trans_add[index].z;
|
|
25139
|
+
|
|
25140
|
+
atm.coord.x = x;
|
|
25141
|
+
atm.coord.y = y;
|
|
25142
|
+
atm.coord.z = z;
|
|
25143
|
+
}
|
|
25144
|
+
|
|
25145
|
+
return atm;
|
|
25146
|
+
}
|
|
25147
|
+
|
|
24771
25148
|
downloadChainalignmentPart3(chainresiCalphaHash2, chainidArray, hAtoms) { let ic = this.icn3d, me = ic.icn3dui;
|
|
24772
25149
|
// select all
|
|
24773
25150
|
let allAtoms = {};
|
|
@@ -24791,7 +25168,8 @@ class ChainalignParser {
|
|
|
24791
25168
|
|
|
24792
25169
|
ic.ParserUtilsCls.renderStructure();
|
|
24793
25170
|
|
|
24794
|
-
if(ic.chainidArray.length > 2) {
|
|
25171
|
+
//if(ic.chainidArray.length > 2) {
|
|
25172
|
+
if(chainidArray.length > 2) {
|
|
24795
25173
|
let residuesHash = {};
|
|
24796
25174
|
for(let i in hAtoms) {
|
|
24797
25175
|
let atom = ic.atoms[i];
|
|
@@ -24813,10 +25191,9 @@ class ChainalignParser {
|
|
|
24813
25191
|
ic.html2ddgm = '';
|
|
24814
25192
|
|
|
24815
25193
|
// by default, open the seq alignment window
|
|
24816
|
-
|
|
24817
|
-
if(me.cfg.showalignseq) {
|
|
25194
|
+
//if(me.cfg.showalignseq) {
|
|
24818
25195
|
me.htmlCls.dialogCls.openDlg('dl_alignment', 'Select residues in aligned sequences');
|
|
24819
|
-
}
|
|
25196
|
+
//}
|
|
24820
25197
|
|
|
24821
25198
|
if(me.cfg.show2d && ic.bFullUi) {
|
|
24822
25199
|
me.htmlCls.dialogCls.openDlg('dl_2ddgm', 'Interactions');
|
|
@@ -24852,15 +25229,30 @@ class ChainalignParser {
|
|
|
24852
25229
|
let pos1 = alignArray[0].indexOf('_');
|
|
24853
25230
|
ic.mmdbid_t = alignArray[0].substr(0, pos1).toUpperCase();
|
|
24854
25231
|
ic.chain_t = alignArray[0].substr(pos1+1);
|
|
24855
|
-
let url_t = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&b=1&s=1&ft=1&bu=" + me.cfg.bu + "&uid=" + ic.mmdbid_t;
|
|
24856
|
-
if(me.cfg.inpara !== undefined) url_t += me.cfg.inpara;
|
|
24857
25232
|
|
|
24858
25233
|
let ajaxArray = [];
|
|
24859
|
-
let targetAjax
|
|
24860
|
-
|
|
24861
|
-
|
|
24862
|
-
|
|
24863
|
-
|
|
25234
|
+
let targetAjax;
|
|
25235
|
+
|
|
25236
|
+
let url_t;
|
|
25237
|
+
if(ic.mmdbid_t.length > 4) {
|
|
25238
|
+
url_t = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_t + "-F1-model_v2.pdb";
|
|
25239
|
+
|
|
25240
|
+
targetAjax = $.ajax({
|
|
25241
|
+
url: url_t,
|
|
25242
|
+
dataType: 'text',
|
|
25243
|
+
cache: true
|
|
25244
|
+
});
|
|
25245
|
+
}
|
|
25246
|
+
else {
|
|
25247
|
+
url_t = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&b=1&s=1&ft=1&bu=" + me.cfg.bu + "&uid=" + ic.mmdbid_t;
|
|
25248
|
+
if(me.cfg.inpara !== undefined) url_t += me.cfg.inpara;
|
|
25249
|
+
|
|
25250
|
+
targetAjax = $.ajax({
|
|
25251
|
+
url: url_t,
|
|
25252
|
+
dataType: 'jsonp',
|
|
25253
|
+
cache: true
|
|
25254
|
+
});
|
|
25255
|
+
}
|
|
24864
25256
|
|
|
24865
25257
|
ajaxArray.push(targetAjax);
|
|
24866
25258
|
|
|
@@ -24870,34 +25262,59 @@ class ChainalignParser {
|
|
|
24870
25262
|
ic.pdbid_chain2title = {};
|
|
24871
25263
|
if(ic.chainids2resids === undefined) ic.chainids2resids = {}; // ic.chainids2resids[chainid1][chainid2] = [resid, resid]
|
|
24872
25264
|
|
|
25265
|
+
ic.afChainIndexHash = {};
|
|
24873
25266
|
for(let index = 1, indexLen = alignArray.length; index < indexLen; ++index) {
|
|
24874
25267
|
let pos2 = alignArray[index].indexOf('_');
|
|
24875
25268
|
ic.mmdbid_q = alignArray[index].substr(0, pos2).toUpperCase();
|
|
24876
25269
|
ic.chain_q = alignArray[index].substr(pos2+1);
|
|
24877
25270
|
|
|
24878
|
-
let
|
|
25271
|
+
let url_q, queryAjax;
|
|
25272
|
+
if(ic.mmdbid_q.length > 4) {
|
|
25273
|
+
url_q = "https://alphafold.ebi.ac.uk/files/AF-" + ic.mmdbid_q + "-F1-model_v2.pdb";
|
|
24879
25274
|
|
|
24880
|
-
|
|
24881
|
-
|
|
24882
|
-
|
|
24883
|
-
|
|
25275
|
+
queryAjax = $.ajax({
|
|
25276
|
+
url: url_q,
|
|
25277
|
+
dataType: 'text',
|
|
25278
|
+
cache: true
|
|
25279
|
+
});
|
|
25280
|
+
}
|
|
25281
|
+
else {
|
|
25282
|
+
url_q = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&b=1&s=1&ft=1&bu=" + me.cfg.bu + "&uid=" + ic.mmdbid_q;
|
|
25283
|
+
if(me.cfg.inpara !== undefined) url_q += me.cfg.inpara;
|
|
24884
25284
|
|
|
24885
|
-
|
|
24886
|
-
|
|
24887
|
-
|
|
24888
|
-
|
|
24889
|
-
|
|
25285
|
+
queryAjax = $.ajax({
|
|
25286
|
+
url: url_q,
|
|
25287
|
+
dataType: 'jsonp',
|
|
25288
|
+
cache: true
|
|
25289
|
+
});
|
|
25290
|
+
}
|
|
24890
25291
|
|
|
24891
25292
|
ajaxArray.push(queryAjax);
|
|
25293
|
+
}
|
|
25294
|
+
|
|
25295
|
+
for(let index = 1, indexLen = alignArray.length; index < indexLen; ++index) {
|
|
25296
|
+
let pos2 = alignArray[index].indexOf('_');
|
|
25297
|
+
ic.mmdbid_q = alignArray[index].substr(0, pos2).toUpperCase();
|
|
25298
|
+
ic.chain_q = alignArray[index].substr(pos2+1);
|
|
24892
25299
|
|
|
24893
25300
|
if(!me.cfg.resnum && !me.cfg.resdef) {
|
|
24894
|
-
let
|
|
24895
|
-
url: urlalign,
|
|
24896
|
-
dataType: 'jsonp',
|
|
24897
|
-
cache: true
|
|
24898
|
-
});
|
|
25301
|
+
let chainalignFinal = ic.mmdbid_q + "_" + ic.chain_q + "," + ic.mmdbid_t + "_" + ic.chain_t;
|
|
24899
25302
|
|
|
24900
|
-
|
|
25303
|
+
if(ic.mmdbid_t.length == 4 && ic.mmdbid_q.length == 4) {
|
|
25304
|
+
let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainpairs=" + chainalignFinal;
|
|
25305
|
+
|
|
25306
|
+
let alignAjax = $.ajax({
|
|
25307
|
+
url: urlalign,
|
|
25308
|
+
dataType: 'jsonp',
|
|
25309
|
+
cache: true
|
|
25310
|
+
});
|
|
25311
|
+
|
|
25312
|
+
ajaxArray.push(alignAjax);
|
|
25313
|
+
}
|
|
25314
|
+
else {
|
|
25315
|
+
// get the dynamic alignment after loading the structures
|
|
25316
|
+
ic.afChainIndexHash[index] = ic.mmdbid_q + "_" + ic.chain_q + "_" + ic.mmdbid_t + "_" + ic.chain_t;
|
|
25317
|
+
}
|
|
24901
25318
|
}
|
|
24902
25319
|
}
|
|
24903
25320
|
|
|
@@ -24921,6 +25338,8 @@ class ChainalignParser {
|
|
|
24921
25338
|
//var data2 = v2[0];
|
|
24922
25339
|
// index = 0: the mmdb data of target
|
|
24923
25340
|
let targetData = dataArray[0][0];
|
|
25341
|
+
let header = 'HEADER ' + mmdbid_t + '\n';
|
|
25342
|
+
if(mmdbid_t.length > 4) targetData = header + targetData;
|
|
24924
25343
|
|
|
24925
25344
|
ic.t_trans_add = [];
|
|
24926
25345
|
ic.q_trans_sub = [];
|
|
@@ -24932,56 +25351,53 @@ class ChainalignParser {
|
|
|
24932
25351
|
|
|
24933
25352
|
let queryDataArray = [];
|
|
24934
25353
|
|
|
24935
|
-
let
|
|
24936
|
-
|
|
24937
|
-
for(let index = 1, indexl = dataArray.length; index < indexl; index += step) {
|
|
25354
|
+
for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
|
|
24938
25355
|
let queryData = dataArray[index][0];
|
|
24939
25356
|
|
|
24940
|
-
let
|
|
24941
|
-
let
|
|
24942
|
-
let mmdbid_q = chainidArray[index2].substr(0, pos2).toUpperCase();
|
|
24943
|
-
let chain_q = chainidArray[index2].substr(pos2+1);
|
|
25357
|
+
let pos = chainidArray[index].indexOf('_');
|
|
25358
|
+
let mmdbid_q = chainidArray[index].substr(0, pos).toUpperCase();
|
|
24944
25359
|
|
|
24945
|
-
|
|
24946
|
-
|
|
24947
|
-
) {
|
|
24948
|
-
ic.mmdbidArray.push(mmdbid_q);
|
|
25360
|
+
let header = 'HEADER ' + mmdbid_q + '\n';
|
|
25361
|
+
if(mmdbid_q.length > 4) queryData = header + queryData;
|
|
24949
25362
|
|
|
24950
|
-
|
|
24951
|
-
|
|
25363
|
+
if(queryData !== undefined && JSON.stringify(queryData).indexOf('Oops there was a problem') === -1
|
|
25364
|
+
) {
|
|
25365
|
+
ic.mmdbidArray.push(mmdbid_q);
|
|
25366
|
+
queryDataArray.push(queryData);
|
|
24952
25367
|
}
|
|
24953
25368
|
else {
|
|
24954
|
-
|
|
24955
|
-
|
|
24956
|
-
|
|
24957
|
-
|
|
24958
|
-
}
|
|
25369
|
+
var aaa = 1; //alert("The coordinate data can NOT be retrieved for the structure " + mmdbid_q + "...");
|
|
25370
|
+
return;
|
|
25371
|
+
}
|
|
25372
|
+
}
|
|
24959
25373
|
|
|
24960
|
-
|
|
24961
|
-
|
|
24962
|
-
|
|
24963
|
-
|
|
24964
|
-
ic.t_trans_add.push({"x":0, "y":0, "z":0});
|
|
24965
|
-
ic.q_trans_sub.push({"x":0, "y":0, "z":0});
|
|
24966
|
-
ic.q_rotation.push({"x1":1, "y1":0, "z1":0, "x2":0, "y2":1, "z2":0, "x3":0, "y3":0, "z3":1});
|
|
24967
|
-
ic.qt_start_end.push(undefined);
|
|
24968
|
-
}
|
|
24969
|
-
else if(align === undefined || align.length == 0) {
|
|
24970
|
-
if(!me.cfg.command) var aaa = 1; //alert('These two chains ' + chainidArray[index2] + ' can not align to each other. ' + 'Please select sequences from these two chains in the "Sequences & Annotations" window, ' + 'and click "Realign Selection" in the "File" menu to align your selection.');
|
|
25374
|
+
let missedChainCnt = 0;
|
|
25375
|
+
//for(let index = chainidArray.length, indexl = dataArray.length; index < indexl; index += step) {
|
|
25376
|
+
for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
|
|
25377
|
+
let queryData = queryDataArray[index - 1];
|
|
24971
25378
|
|
|
24972
|
-
|
|
24973
|
-
|
|
24974
|
-
|
|
24975
|
-
|
|
24976
|
-
|
|
24977
|
-
|
|
24978
|
-
|
|
24979
|
-
|
|
24980
|
-
}
|
|
25379
|
+
let pos = chainidArray[index].indexOf('_');
|
|
25380
|
+
let mmdbid_q = chainidArray[index].substr(0, pos).toUpperCase();
|
|
25381
|
+
let chain_q = chainidArray[index].substr(pos+1);
|
|
25382
|
+
|
|
25383
|
+
if(!me.cfg.resnum && !me.cfg.resdef) {
|
|
25384
|
+
let index2 = chainidArray.length + index - 1;
|
|
25385
|
+
if(ic.afChainIndexHash.hasOwnProperty(index)) {
|
|
25386
|
+
++missedChainCnt;
|
|
24981
25387
|
|
|
24982
|
-
|
|
25388
|
+
// need to pass C-alpha coords and get transformation matrix from backend
|
|
25389
|
+
ic.t_trans_add[index-1] = {"x":0, "y":0, "z":0};
|
|
25390
|
+
ic.q_trans_sub[index-1] = {"x":0, "y":0, "z":0};
|
|
25391
|
+
ic.q_rotation[index-1] = {"x1":1, "y1":0, "z1":0, "x2":0, "y2":1, "z2":0, "x3":0, "y3":0, "z3":1};
|
|
25392
|
+
ic.qt_start_end[index-1] = undefined;
|
|
25393
|
+
}
|
|
25394
|
+
else {
|
|
25395
|
+
let align = dataArray[index2 - missedChainCnt][0];
|
|
24983
25396
|
|
|
24984
|
-
|
|
25397
|
+
let bEqualMmdbid = (mmdbid_q == mmdbid_t);
|
|
25398
|
+
let bEqualChain = (chain_q == chain_t);
|
|
25399
|
+
|
|
25400
|
+
this.processAlign(align, index-1, queryData, bEqualMmdbid, bEqualChain);
|
|
24985
25401
|
}
|
|
24986
25402
|
}
|
|
24987
25403
|
}
|
|
@@ -24991,6 +25407,52 @@ class ChainalignParser {
|
|
|
24991
25407
|
this.loadOpmDataForChainalign(targetData, queryDataArray, chainidArray, ic.mmdbidArray);
|
|
24992
25408
|
}
|
|
24993
25409
|
|
|
25410
|
+
processAlign(align, index, queryData, bEqualMmdbid, bEqualChain, bNoAlert) { let ic = this.icn3d, me = ic.icn3dui;
|
|
25411
|
+
let bAligned = false;
|
|
25412
|
+
if(!align && !bNoAlert) {
|
|
25413
|
+
var aaa = 1; //alert("These chains can not be aligned by VAST server. You can specify the residue range and try it again.");
|
|
25414
|
+
return bAligned;
|
|
25415
|
+
}
|
|
25416
|
+
|
|
25417
|
+
if(queryData !== undefined && JSON.stringify(queryData).indexOf('Oops there was a problem') === -1
|
|
25418
|
+
&& align !== undefined && JSON.stringify(align).indexOf('Oops there was a problem') === -1
|
|
25419
|
+
) {
|
|
25420
|
+
if((align === undefined || align.length == 0) && bEqualMmdbid && bEqualChain) {
|
|
25421
|
+
ic.t_trans_add[index] = {"x":0, "y":0, "z":0};
|
|
25422
|
+
ic.q_trans_sub[index] = {"x":0, "y":0, "z":0};
|
|
25423
|
+
ic.q_rotation[index] = {"x1":1, "y1":0, "z1":0, "x2":0, "y2":1, "z2":0, "x3":0, "y3":0, "z3":1};
|
|
25424
|
+
ic.qt_start_end[index] = undefined;
|
|
25425
|
+
}
|
|
25426
|
+
else if(align === undefined || align.length == 0) {
|
|
25427
|
+
if(!me.cfg.command && !bNoAlert) var aaa = 1; //alert('These two chains can not align to each other. ' + 'Please select sequences from these two chains in the "Sequences & Annotations" window, ' + 'and click "Realign Selection" in the "File" menu to align your selection.');
|
|
25428
|
+
|
|
25429
|
+
ic.t_trans_add[index] = {"x":0, "y":0, "z":0};
|
|
25430
|
+
ic.q_trans_sub[index] = {"x":0, "y":0, "z":0};
|
|
25431
|
+
ic.q_rotation[index] = {"x1":1, "y1":0, "z1":0, "x2":0, "y2":1, "z2":0, "x3":0, "y3":0, "z3":1};
|
|
25432
|
+
ic.qt_start_end[index] = undefined;
|
|
25433
|
+
|
|
25434
|
+
me.cfg.showanno = 1;
|
|
25435
|
+
me.cfg.showalignseq = 0;
|
|
25436
|
+
}
|
|
25437
|
+
else {
|
|
25438
|
+
/*
|
|
25439
|
+
ic.t_trans_add.push(align[0].t_trans_add);
|
|
25440
|
+
ic.q_trans_sub.push(align[0].q_trans_sub);
|
|
25441
|
+
ic.q_rotation.push(align[0].q_rotation);
|
|
25442
|
+
ic.qt_start_end.push(align[0].segs);
|
|
25443
|
+
*/
|
|
25444
|
+
ic.t_trans_add[index] = align[0].t_trans_add;
|
|
25445
|
+
ic.q_trans_sub[index] = align[0].q_trans_sub;
|
|
25446
|
+
ic.q_rotation[index] = align[0].q_rotation;
|
|
25447
|
+
ic.qt_start_end[index] = align[0].segs;
|
|
25448
|
+
|
|
25449
|
+
bAligned = true;
|
|
25450
|
+
}
|
|
25451
|
+
}
|
|
25452
|
+
|
|
25453
|
+
return bAligned;
|
|
25454
|
+
}
|
|
25455
|
+
|
|
24994
25456
|
loadOpmDataForChainalign(data1, data2, chainidArray, mmdbidArray) { let ic = this.icn3d, me = ic.icn3dui;
|
|
24995
25457
|
let thisClass = this;
|
|
24996
25458
|
|
|
@@ -25008,7 +25470,7 @@ class ChainalignParser {
|
|
|
25008
25470
|
dataType: 'jsonp',
|
|
25009
25471
|
cache: true,
|
|
25010
25472
|
//tryCount : 0,
|
|
25011
|
-
//retryLimit : 1
|
|
25473
|
+
//retryLimit : 0, //1
|
|
25012
25474
|
success: function(data) {
|
|
25013
25475
|
let mmdbid = data.mmdbid;
|
|
25014
25476
|
ic.selectedPdbid = mmdbid;
|
|
@@ -25026,7 +25488,7 @@ class ChainalignParser {
|
|
|
25026
25488
|
dataType: 'text',
|
|
25027
25489
|
cache: true,
|
|
25028
25490
|
//tryCount : 0,
|
|
25029
|
-
//retryLimit : 1
|
|
25491
|
+
//retryLimit : 0, //1
|
|
25030
25492
|
success: function(opmdata) {
|
|
25031
25493
|
ic.bOpm = true;
|
|
25032
25494
|
let bVector = true;
|
|
@@ -26729,6 +27191,22 @@ class LoadScript {
|
|
|
26729
27191
|
|
|
26730
27192
|
return;
|
|
26731
27193
|
}
|
|
27194
|
+
else if(ic.commands[i].trim().indexOf('realign on structure align') == 0) {
|
|
27195
|
+
let strArray = ic.commands[i].split("|||");
|
|
27196
|
+
let command = strArray[0].trim();
|
|
27197
|
+
|
|
27198
|
+
let paraArray = command.split(' | ');
|
|
27199
|
+
if(paraArray.length == 2) {
|
|
27200
|
+
let nameArray = paraArray[1].split(',');
|
|
27201
|
+
ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
|
|
27202
|
+
}
|
|
27203
|
+
|
|
27204
|
+
$.when(thisClass.applyCommandRealignByStruct(command)).then(function() {
|
|
27205
|
+
thisClass.execCommandsBase(i + 1, end, steps);
|
|
27206
|
+
});
|
|
27207
|
+
|
|
27208
|
+
return;
|
|
27209
|
+
}
|
|
26732
27210
|
else if(ic.commands[i].trim().indexOf('graph interaction pairs') == 0) {
|
|
26733
27211
|
let strArray = ic.commands[i].split("|||");
|
|
26734
27212
|
let command = strArray[0].trim();
|
|
@@ -26909,6 +27387,14 @@ class LoadScript {
|
|
|
26909
27387
|
}
|
|
26910
27388
|
thisClass.applyCommandRealign(lastCommand);
|
|
26911
27389
|
}
|
|
27390
|
+
else if(lastCommand.indexOf('realign on structure align') == 0) {
|
|
27391
|
+
let paraArray = lastCommand.split(' | ');
|
|
27392
|
+
if(paraArray.length == 2) {
|
|
27393
|
+
let nameArray = paraArray[1].split(',');
|
|
27394
|
+
ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
|
|
27395
|
+
}
|
|
27396
|
+
thisClass.applyCommandRealignByStruct(lastCommand);
|
|
27397
|
+
}
|
|
26912
27398
|
else if(lastCommand.indexOf('graph interaction pairs') == 0) {
|
|
26913
27399
|
thisClass.applyCommandGraphinteraction(lastCommand);
|
|
26914
27400
|
}
|
|
@@ -27121,6 +27607,21 @@ class LoadScript {
|
|
|
27121
27607
|
return ic.deferredRealign.promise();
|
|
27122
27608
|
}
|
|
27123
27609
|
|
|
27610
|
+
applyCommandRealignByStructBase(command) { let ic = this.icn3d; ic.icn3dui;
|
|
27611
|
+
ic.realignParserCls.realignOnStructAlign();
|
|
27612
|
+
}
|
|
27613
|
+
|
|
27614
|
+
applyCommandRealignByStruct(command) { let ic = this.icn3d; ic.icn3dui;
|
|
27615
|
+
let thisClass = this;
|
|
27616
|
+
|
|
27617
|
+
// chain functions together
|
|
27618
|
+
ic.deferredRealignByStruct = new $.Deferred(function() {
|
|
27619
|
+
thisClass.applyCommandRealignByStructBase(command);
|
|
27620
|
+
}); // end of me.deferred = $.Deferred(function() {
|
|
27621
|
+
|
|
27622
|
+
return ic.deferredRealignByStruct.promise();
|
|
27623
|
+
}
|
|
27624
|
+
|
|
27124
27625
|
applyCommandAfmapBase(command, bFull) { let ic = this.icn3d; ic.icn3dui;
|
|
27125
27626
|
let afid = command.substr(command.lastIndexOf(' ') + 1);
|
|
27126
27627
|
|
|
@@ -28219,18 +28720,28 @@ class Domain3d {
|
|
|
28219
28720
|
//
|
|
28220
28721
|
//c2b_NewSplitChain(string asymId, let seqLen, let* x0, let* y0, let* z0) { let ic = this.icn3d, me = ic.icn3dui;
|
|
28221
28722
|
// x0, y0, z0: array of x,y,z coordinates of C-alpha atoms
|
|
28222
|
-
c2b_NewSplitChain(chnid, dcut) { let ic = this.icn3d
|
|
28723
|
+
//c2b_NewSplitChain(chnid, dcut) { let ic = this.icn3d, me = ic.icn3dui;
|
|
28724
|
+
c2b_NewSplitChain(atoms, dcut) { let ic = this.icn3d; ic.icn3dui;
|
|
28223
28725
|
let x0 = [], y0 = [], z0 = [];
|
|
28224
28726
|
|
|
28225
|
-
//substruct: array of secondary structures, each of which has the keys: From (1-based), To (1-based), Sheet (0 or 1)
|
|
28727
|
+
//substruct: array of secondary structures, each of which has the keys: From (1-based), To (1-based), Sheet (0 or 1), also add these paras: x1, y1, z1, x2, y2, z2
|
|
28226
28728
|
let substruct = [];
|
|
28729
|
+
// determine residue ranges for each subdomain
|
|
28730
|
+
let subdomains = [];
|
|
28731
|
+
|
|
28227
28732
|
// sheets: array of sheets, each of which has the key: sheet_num (beta sandwich has two sheets, e.g., 0 and 1), adj_strand1 (not used), adj_strand2
|
|
28228
28733
|
let sheets = [];
|
|
28229
28734
|
|
|
28735
|
+
let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(atoms);
|
|
28736
|
+
let residueArray = Object.keys(residueHash);
|
|
28737
|
+
residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
|
|
28738
|
+
|
|
28230
28739
|
let substructItem = {};
|
|
28231
28740
|
let resiOffset = 0;
|
|
28232
|
-
for(let i = 0; i <
|
|
28233
|
-
|
|
28741
|
+
for(let i = 0; i < residueArray.length; ++i) {
|
|
28742
|
+
let resid = residueArray[i];
|
|
28743
|
+
|
|
28744
|
+
let resi = resid.substr(resid.lastIndexOf('_') + 1);
|
|
28234
28745
|
if(i == 0) {
|
|
28235
28746
|
resiOffset = resi - 1;
|
|
28236
28747
|
|
|
@@ -28241,7 +28752,7 @@ class Domain3d {
|
|
|
28241
28752
|
}
|
|
28242
28753
|
}
|
|
28243
28754
|
|
|
28244
|
-
let resid = chnid + "_" + resi;
|
|
28755
|
+
//let resid = chnid + "_" + resi;
|
|
28245
28756
|
let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
|
|
28246
28757
|
|
|
28247
28758
|
if(atom) {
|
|
@@ -28259,6 +28770,10 @@ class Domain3d {
|
|
|
28259
28770
|
|
|
28260
28771
|
if(atom.ssend) {
|
|
28261
28772
|
substructItem.To = parseInt(resi);
|
|
28773
|
+
substructItem.x2 = atom.coord.x;
|
|
28774
|
+
substructItem.y2 = atom.coord.y;
|
|
28775
|
+
substructItem.z2 = atom.coord.z;
|
|
28776
|
+
|
|
28262
28777
|
substructItem.Sheet = (atom.ss == 'sheet') ? true : false;
|
|
28263
28778
|
substruct.push(substructItem);
|
|
28264
28779
|
substructItem = {};
|
|
@@ -28267,6 +28782,9 @@ class Domain3d {
|
|
|
28267
28782
|
// a residue could be both start and end. check ssend first, then check ssbegin
|
|
28268
28783
|
if(atom.ssbegin) {
|
|
28269
28784
|
substructItem.From = parseInt(resi);
|
|
28785
|
+
substructItem.x1 = atom.coord.x;
|
|
28786
|
+
substructItem.y1 = atom.coord.y;
|
|
28787
|
+
substructItem.z1 = atom.coord.z;
|
|
28270
28788
|
}
|
|
28271
28789
|
}
|
|
28272
28790
|
|
|
@@ -28274,15 +28792,15 @@ class Domain3d {
|
|
|
28274
28792
|
|
|
28275
28793
|
if (nsse <= 3)
|
|
28276
28794
|
// too small, can't split or trim
|
|
28277
|
-
return;
|
|
28795
|
+
return {subdomains: subdomains, substruct: substruct};
|
|
28278
28796
|
|
|
28279
28797
|
if (nsse > this.MAX_SSE) {
|
|
28280
28798
|
// we have a problem...
|
|
28281
28799
|
|
|
28282
|
-
return;
|
|
28800
|
+
return {subdomains: subdomains, substruct: substruct};
|
|
28283
28801
|
}
|
|
28284
28802
|
|
|
28285
|
-
let seqLen =
|
|
28803
|
+
let seqLen = residueArray.length + resiOffset;
|
|
28286
28804
|
|
|
28287
28805
|
// get a list of Calpha-Calpha contacts
|
|
28288
28806
|
///list< pair< pair< int, let >, let > >
|
|
@@ -28526,9 +29044,6 @@ class Domain3d {
|
|
|
28526
29044
|
return v1[0] - v2[0];
|
|
28527
29045
|
});
|
|
28528
29046
|
|
|
28529
|
-
// determine residue ranges for each subdomain
|
|
28530
|
-
let subdomains = [];
|
|
28531
|
-
|
|
28532
29047
|
//for (lplet = list_parts.begin(); lplet != list_parts.end(); lpint++) {
|
|
28533
29048
|
for (let index = 0, indexl = list_parts.length; index < indexl; ++index) {
|
|
28534
29049
|
//vector<int> prts = *lpint;
|
|
@@ -28547,7 +29062,7 @@ class Domain3d {
|
|
|
28547
29062
|
let k = prts[i] - 1;
|
|
28548
29063
|
|
|
28549
29064
|
if ((k < 0) || (k >= substruct.length)) {
|
|
28550
|
-
return;
|
|
29065
|
+
return {subdomains: subdomains, substruct: substruct};
|
|
28551
29066
|
}
|
|
28552
29067
|
|
|
28553
29068
|
//SSE_Rec sserec = substruct[k];
|
|
@@ -28560,13 +29075,23 @@ class Domain3d {
|
|
|
28560
29075
|
|
|
28561
29076
|
if ((k == 0) && (From > 1)) {
|
|
28562
29077
|
// residues with negative residue numbers will not be included
|
|
28563
|
-
for (let j = 1; j < From; j++)
|
|
28564
|
-
resflags[j - 1] = 1;
|
|
29078
|
+
for (let j = 1; j < From; j++) {
|
|
29079
|
+
//resflags[j - 1] = 1;
|
|
29080
|
+
// include at most 10 residues
|
|
29081
|
+
if(From - j <= 10) {
|
|
29082
|
+
resflags[j - 1] = 1;
|
|
29083
|
+
}
|
|
29084
|
+
}
|
|
28565
29085
|
}
|
|
28566
29086
|
|
|
28567
29087
|
if ((k == substruct.length - 1) && (To < seqLen)) {
|
|
28568
|
-
for (let j = To + 1; j <= seqLen; j++)
|
|
28569
|
-
resflags[j - 1] = 1;
|
|
29088
|
+
for (let j = To + 1; j <= seqLen; j++) {
|
|
29089
|
+
//resflags[j - 1] = 1;
|
|
29090
|
+
// include at most 10 residues
|
|
29091
|
+
if(j - To <= 10) {
|
|
29092
|
+
resflags[j - 1] = 1;
|
|
29093
|
+
}
|
|
29094
|
+
}
|
|
28570
29095
|
}
|
|
28571
29096
|
|
|
28572
29097
|
// left side
|
|
@@ -28635,10 +29160,96 @@ class Domain3d {
|
|
|
28635
29160
|
subdomains.push(segments);
|
|
28636
29161
|
}
|
|
28637
29162
|
|
|
28638
|
-
|
|
28639
|
-
|
|
28640
|
-
return subdomains;
|
|
29163
|
+
return {subdomains: subdomains, substruct: substruct};
|
|
28641
29164
|
} // end c2b_NewSplitChain
|
|
29165
|
+
|
|
29166
|
+
getDomainJsonForAlign(atoms) { let ic = this.icn3d, me = ic.icn3dui;
|
|
29167
|
+
let result = this.c2b_NewSplitChain(atoms);
|
|
29168
|
+
|
|
29169
|
+
let subdomains = result.subdomains;
|
|
29170
|
+
let substruct = result.substruct;
|
|
29171
|
+
|
|
29172
|
+
let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(atoms);
|
|
29173
|
+
let residueArray = Object.keys(residueHash);
|
|
29174
|
+
let chnid = residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
|
|
29175
|
+
|
|
29176
|
+
//the whole structure is also considered as a large domain
|
|
29177
|
+
//if(subdomains.length == 0) {
|
|
29178
|
+
//subdomains.push([parseInt(ic.chainsSeq[chnid][0].resi), parseInt(ic.chainsSeq[chnid][ic.chainsSeq[chnid].length - 1].resi)]);
|
|
29179
|
+
subdomains.push([parseInt(residueArray[0].substr(residueArray[0].lastIndexOf('_') + 1)),
|
|
29180
|
+
parseInt(residueArray[residueArray.length-1].substr(residueArray[residueArray.length-1].lastIndexOf('_') + 1))]);
|
|
29181
|
+
//}
|
|
29182
|
+
|
|
29183
|
+
// m_domains1: {"data": [ {"ss": [[1,20,30,x,y,z,x,y,z], [2,50,60,x,y,z,x,y,z]], "domain": [[1,43,x,y,z],[2,58,x,y,z], ...]}, {"ss": [[1,20,30,x,y,z,x,y,z], [2,50,60,x,y,z,x,y,z]],"domain": [[1,43,x,y,z],[2,58,x,y,z], ...]} ] }
|
|
29184
|
+
let jsonStr = '{"data": [';
|
|
29185
|
+
for(let i = 0, il = subdomains.length; i < il; ++i) {
|
|
29186
|
+
if(i > 0) jsonStr += ', ';
|
|
29187
|
+
//secondary structure
|
|
29188
|
+
jsonStr += '{"ss": [';
|
|
29189
|
+
let ssCnt = 0;
|
|
29190
|
+
for(let j = 0, jl = subdomains[i].length; j < jl; j += 2) {
|
|
29191
|
+
let start = subdomains[i][j];
|
|
29192
|
+
let end = subdomains[i][j + 1];
|
|
29193
|
+
|
|
29194
|
+
for(let k = 0, kl = substruct.length; k < kl; ++k) {
|
|
29195
|
+
//ss: sstype ss_start ss_end x1 y1 z1 x2 y2 z2
|
|
29196
|
+
//sstype: 1 (helix), 2 (sheet)
|
|
29197
|
+
let sstype = (substruct[k].Sheet) ? 2 : 1;
|
|
29198
|
+
let from = substruct[k].From;
|
|
29199
|
+
let to = substruct[k].To;
|
|
29200
|
+
|
|
29201
|
+
let residFrom = chnid + "_" + from;
|
|
29202
|
+
let atomFrom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residFrom]);
|
|
29203
|
+
if(!ic.hAtoms.hasOwnProperty(atomFrom.serial)) continue;
|
|
29204
|
+
|
|
29205
|
+
let residTo = chnid + "_" + to;
|
|
29206
|
+
let atomTo = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residTo]);
|
|
29207
|
+
if(!ic.hAtoms.hasOwnProperty(atomTo.serial)) continue;
|
|
29208
|
+
|
|
29209
|
+
if(from >= start && to <= end) {
|
|
29210
|
+
if(ssCnt > 0) jsonStr += ', ';
|
|
29211
|
+
jsonStr += '[' + sstype + ',' + from + ',' + to + ',' + substruct[k].x1.toFixed(2) + ',' + substruct[k].y1.toFixed(2) + ','
|
|
29212
|
+
+ substruct[k].z1.toFixed(2) + ',' + substruct[k].x2.toFixed(2) + ',' + substruct[k].y2.toFixed(2) + ',' + substruct[k].z2.toFixed(2) + ']';
|
|
29213
|
+
++ssCnt;
|
|
29214
|
+
}
|
|
29215
|
+
}
|
|
29216
|
+
}
|
|
29217
|
+
jsonStr += ']';
|
|
29218
|
+
|
|
29219
|
+
// domain
|
|
29220
|
+
jsonStr += ', "domain": [';
|
|
29221
|
+
let domainCnt = 0;
|
|
29222
|
+
for(let j = 0, jl = subdomains[i].length; j < jl; j += 2) {
|
|
29223
|
+
let start = subdomains[i][j];
|
|
29224
|
+
let end = subdomains[i][j + 1];
|
|
29225
|
+
|
|
29226
|
+
for(let k = 0, kl = residueArray.length; k < kl; ++k) {
|
|
29227
|
+
let resid = residueArray[k];
|
|
29228
|
+
|
|
29229
|
+
let resi = resid.substr(resid.lastIndexOf('_') + 1);
|
|
29230
|
+
|
|
29231
|
+
//let resid = chnid + "_" + resi;
|
|
29232
|
+
let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
|
|
29233
|
+
|
|
29234
|
+
if(!atom) continue;
|
|
29235
|
+
if(!ic.hAtoms.hasOwnProperty(atom.serial)) continue;
|
|
29236
|
+
|
|
29237
|
+
//domain: resi, restype, x, y, z
|
|
29238
|
+
let restype = me.parasCls.resn2restype[atom.resn];
|
|
29239
|
+
if(restype !== undefined && resi >= start && resi <= end) {
|
|
29240
|
+
if(domainCnt > 0) jsonStr += ', ';
|
|
29241
|
+
jsonStr += '[' + resi + ',' + restype + ',' + atom.coord.x.toFixed(2) + ','
|
|
29242
|
+
+ atom.coord.y.toFixed(2) + ',' + atom.coord.z.toFixed(2) + ']';
|
|
29243
|
+
++domainCnt;
|
|
29244
|
+
}
|
|
29245
|
+
}
|
|
29246
|
+
}
|
|
29247
|
+
jsonStr += ']}';
|
|
29248
|
+
}
|
|
29249
|
+
jsonStr += ']}';
|
|
29250
|
+
|
|
29251
|
+
return jsonStr;
|
|
29252
|
+
}
|
|
28642
29253
|
}
|
|
28643
29254
|
|
|
28644
29255
|
/**
|
|
@@ -29163,7 +29774,7 @@ class AddTrack {
|
|
|
29163
29774
|
dataType: 'jsonp',
|
|
29164
29775
|
//dataType: 'json',
|
|
29165
29776
|
tryCount : 0,
|
|
29166
|
-
retryLimit : 1
|
|
29777
|
+
retryLimit : 0, //1
|
|
29167
29778
|
success: function(data) {
|
|
29168
29779
|
thisClass.alignSequenceToStructure(chainid, data, title);
|
|
29169
29780
|
},
|
|
@@ -29200,7 +29811,7 @@ class AddTrack {
|
|
|
29200
29811
|
dataType: 'jsonp',
|
|
29201
29812
|
//dataType: 'json',
|
|
29202
29813
|
tryCount : 0,
|
|
29203
|
-
retryLimit : 1
|
|
29814
|
+
retryLimit : 0, //1
|
|
29204
29815
|
success: function(data) {
|
|
29205
29816
|
thisClass.alignSequenceToStructure(chainid, data, title);
|
|
29206
29817
|
},
|
|
@@ -30396,7 +31007,7 @@ class AnnoCddSite {
|
|
|
30396
31007
|
dataType: 'jsonp',
|
|
30397
31008
|
cache: true,
|
|
30398
31009
|
tryCount : 0,
|
|
30399
|
-
retryLimit : 1
|
|
31010
|
+
retryLimit : 0, //1
|
|
30400
31011
|
success: function(data) {
|
|
30401
31012
|
thisClass.parseCddData([data], chnidArray);
|
|
30402
31013
|
if(ic.deferredAnnoCddSite !== undefined) ic.deferredAnnoCddSite.resolve();
|
|
@@ -31596,7 +32207,7 @@ class ApplyCommand {
|
|
|
31596
32207
|
//ic.drawCls.draw();
|
|
31597
32208
|
}
|
|
31598
32209
|
else if(command == 'disulfide bonds') {
|
|
31599
|
-
ic.
|
|
32210
|
+
ic.showInterCls.showSsbonds();
|
|
31600
32211
|
}
|
|
31601
32212
|
else if(command == 'cross linkage') {
|
|
31602
32213
|
ic.showInterCls.showClbonds();
|
|
@@ -33779,30 +34390,61 @@ class SetSeqAlign {
|
|
|
33779
34390
|
seqalign = {};
|
|
33780
34391
|
}
|
|
33781
34392
|
|
|
33782
|
-
setSeqAlignChain(chainid, chainIndex) { let ic = this.icn3d, me = ic.icn3dui;
|
|
34393
|
+
setSeqAlignChain(chainid, chainIndex, chainidArray) { let ic = this.icn3d, me = ic.icn3dui;
|
|
34394
|
+
let hAtoms = {};
|
|
34395
|
+
let mmdbid1, mmdbid2, chain1, chain2, chainid1, chainid2, pos1, pos2;
|
|
33783
34396
|
|
|
33784
|
-
|
|
33785
|
-
|
|
33786
|
-
|
|
34397
|
+
if(chainidArray) {
|
|
34398
|
+
// originally chainid2 is target,chainid1 is query
|
|
34399
|
+
// switch them so that chainid1 is the target
|
|
34400
|
+
chainid1 = chainidArray[1];
|
|
34401
|
+
chainid2 = chainidArray[0];
|
|
33787
34402
|
|
|
33788
|
-
|
|
33789
|
-
let mmdbid2 = chainid.substr(0, pos2).toUpperCase();
|
|
34403
|
+
chainIndex = chainidArray[2];
|
|
33790
34404
|
|
|
33791
|
-
|
|
33792
|
-
|
|
34405
|
+
pos1 = chainid1.indexOf('_');
|
|
34406
|
+
pos2 = chainid2.indexOf('_');
|
|
33793
34407
|
|
|
33794
|
-
|
|
33795
|
-
|
|
33796
|
-
|
|
33797
|
-
|
|
34408
|
+
mmdbid1 = chainid1.substr(0, pos1).toUpperCase();
|
|
34409
|
+
mmdbid2 = chainid2.substr(0, pos2).toUpperCase();
|
|
34410
|
+
|
|
34411
|
+
chain1 = chainid1.substr(pos1 + 1);
|
|
34412
|
+
chain2 = chainid2.substr(pos1 + 1);
|
|
33798
34413
|
|
|
33799
|
-
|
|
33800
|
-
|
|
34414
|
+
if(mmdbid1 == mmdbid2 && chain1 == chain2) {
|
|
34415
|
+
let chainLen = ic.chainsSeq[mmdbid2 + '_' + chain2].length;
|
|
34416
|
+
ic.qt_start_end[chainIndex] = {"q_start":1, "q_end": chainLen, "t_start":1, "t_end": chainLen};
|
|
34417
|
+
}
|
|
33801
34418
|
|
|
33802
|
-
|
|
33803
|
-
|
|
33804
|
-
|
|
34419
|
+
if(mmdbid2 !== undefined && mmdbid2 === mmdbid1) {
|
|
34420
|
+
//chainid1 += me.htmlCls.postfix;
|
|
34421
|
+
chainid2 = mmdbid2 + me.htmlCls.postfix + "_" + chain2;
|
|
34422
|
+
}
|
|
33805
34423
|
}
|
|
34424
|
+
else {
|
|
34425
|
+
//var chainidArray = me.cfg.chainalign.split(',');
|
|
34426
|
+
let pos1 = ic.chainidArray[0].indexOf('_');
|
|
34427
|
+
let pos2 = chainid.indexOf('_');
|
|
34428
|
+
|
|
34429
|
+
mmdbid1 = ic.mmdbid_t; //ic.chainidArray[0].substr(0, pos1).toUpperCase();
|
|
34430
|
+
mmdbid2 = chainid.substr(0, pos2).toUpperCase();
|
|
34431
|
+
|
|
34432
|
+
chain1 = ic.chainidArray[0].substr(pos1 + 1);
|
|
34433
|
+
chain2 = chainid.substr(pos2 + 1);
|
|
34434
|
+
|
|
34435
|
+
if(mmdbid1 == mmdbid2 && chain1 == chain2) {
|
|
34436
|
+
let chainLen = ic.chainsSeq[ic.mmdbid_q + '_' + ic.chain_q].length;
|
|
34437
|
+
ic.qt_start_end[chainIndex] = {"q_start":1, "q_end": chainLen, "t_start":1, "t_end": chainLen};
|
|
34438
|
+
}
|
|
34439
|
+
|
|
34440
|
+
chainid1 = mmdbid1 + "_" + chain1;
|
|
34441
|
+
chainid2 = mmdbid2 + "_" + chain2;
|
|
34442
|
+
|
|
34443
|
+
if(mmdbid2 !== undefined && mmdbid2 === ic.mmdbid_t) {
|
|
34444
|
+
//chainid1 += me.htmlCls.postfix;
|
|
34445
|
+
chainid2 = mmdbid2 + me.htmlCls.postfix + "_" + chain2;
|
|
34446
|
+
}
|
|
34447
|
+
}
|
|
33806
34448
|
|
|
33807
34449
|
ic.conservedName1 = chainid1 + '_cons';
|
|
33808
34450
|
ic.nonConservedName1 = chainid1 + '_ncons';
|
|
@@ -33946,6 +34588,9 @@ class SetSeqAlign {
|
|
|
33946
34588
|
ic.nconsHash2[chainid2 + '_' + resi2] = 1;
|
|
33947
34589
|
}
|
|
33948
34590
|
|
|
34591
|
+
hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.residues[chainid1 + '_' + resi1]);
|
|
34592
|
+
hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.residues[chainid2 + '_' + resi2]);
|
|
34593
|
+
|
|
33949
34594
|
// mapping, use the firstsequence as the reference structure
|
|
33950
34595
|
ic.chainsMapping[chainid1][chainid1 + '_' + resi1] = resn1 + resi1;
|
|
33951
34596
|
ic.chainsMapping[chainid2][chainid2 + '_' + resi2] = resn1 + resi1;
|
|
@@ -33962,6 +34607,8 @@ class SetSeqAlign {
|
|
|
33962
34607
|
prevIndex1 = end1;
|
|
33963
34608
|
prevIndex2 = end2;
|
|
33964
34609
|
} // end for(let i
|
|
34610
|
+
|
|
34611
|
+
return hAtoms;
|
|
33965
34612
|
}
|
|
33966
34613
|
|
|
33967
34614
|
setSeqAlignForRealign(chainid_t, chainid, chainIndex) { let ic = this.icn3d, me = ic.icn3dui;
|
|
@@ -34852,7 +35499,7 @@ class MmcifParser {
|
|
|
34852
35499
|
dataType: dataType,
|
|
34853
35500
|
cache: true,
|
|
34854
35501
|
tryCount : 0,
|
|
34855
|
-
retryLimit : 1
|
|
35502
|
+
retryLimit : 0, //1
|
|
34856
35503
|
beforeSend: function() {
|
|
34857
35504
|
ic.ParserUtilsCls.showLoading();
|
|
34858
35505
|
},
|
|
@@ -34868,7 +35515,7 @@ class MmcifParser {
|
|
|
34868
35515
|
dataType: 'jsonp',
|
|
34869
35516
|
cache: true,
|
|
34870
35517
|
tryCount : 0,
|
|
34871
|
-
retryLimit : 1
|
|
35518
|
+
retryLimit : 0, //1
|
|
34872
35519
|
beforeSend: function() {
|
|
34873
35520
|
ic.ParserUtilsCls.showLoading();
|
|
34874
35521
|
},
|
|
@@ -34936,7 +35583,7 @@ class MmcifParser {
|
|
|
34936
35583
|
dataType: dataType,
|
|
34937
35584
|
cache: true,
|
|
34938
35585
|
tryCount : 0,
|
|
34939
|
-
retryLimit : 1
|
|
35586
|
+
retryLimit : 0, //1
|
|
34940
35587
|
success: function(data) {
|
|
34941
35588
|
// notebook has a problem in posting data to mmcifparser.cgi
|
|
34942
35589
|
if(me.cfg.notebook) {
|
|
@@ -35092,7 +35739,7 @@ class MmcifParser {
|
|
|
35092
35739
|
dataType: 'jsonp',
|
|
35093
35740
|
cache: true,
|
|
35094
35741
|
tryCount : 0,
|
|
35095
|
-
retryLimit : 1
|
|
35742
|
+
retryLimit : 0, //1
|
|
35096
35743
|
success: function(data) {
|
|
35097
35744
|
if(data.emd !== undefined) ic.emd = data.emd;
|
|
35098
35745
|
if(data.organism !== undefined) ic.organism = data.organism;
|
|
@@ -35852,7 +36499,7 @@ class ShowAnno {
|
|
|
35852
36499
|
dataType: 'jsonp',
|
|
35853
36500
|
//dataType: 'json',
|
|
35854
36501
|
tryCount : 0,
|
|
35855
|
-
retryLimit : 1
|
|
36502
|
+
retryLimit : 0, //1
|
|
35856
36503
|
success: function(data) {
|
|
35857
36504
|
ic.seqStructAlignData = data;
|
|
35858
36505
|
thisClass.showAnnoSeqData(nucleotide_chainid, chemical_chainid, chemical_set);
|
|
@@ -35892,7 +36539,7 @@ class ShowAnno {
|
|
|
35892
36539
|
dataType: 'jsonp', //'text',
|
|
35893
36540
|
cache: true,
|
|
35894
36541
|
tryCount : 0,
|
|
35895
|
-
retryLimit : 1
|
|
36542
|
+
retryLimit : 0, //1
|
|
35896
36543
|
success: function(chainid_seq) {
|
|
35897
36544
|
let index = 0;
|
|
35898
36545
|
for(let acc in chainid_seq) {
|
|
@@ -36663,7 +37310,7 @@ class AnnoDomain {
|
|
|
36663
37310
|
}
|
|
36664
37311
|
}
|
|
36665
37312
|
}
|
|
36666
|
-
else {
|
|
37313
|
+
else {
|
|
36667
37314
|
// calculate 3D domains on-the-fly
|
|
36668
37315
|
//ic.protein_chainid[chainArray[i]]
|
|
36669
37316
|
let data = {};
|
|
@@ -36673,8 +37320,15 @@ class AnnoDomain {
|
|
|
36673
37320
|
if(pdbid == structure && ic.protein_chainid.hasOwnProperty(chainid)) {
|
|
36674
37321
|
data.domains[chainid] = {};
|
|
36675
37322
|
data.domains[chainid].domains = [];
|
|
36676
|
-
|
|
36677
|
-
let
|
|
37323
|
+
|
|
37324
|
+
let atoms = ic.chains[chainid];
|
|
37325
|
+
|
|
37326
|
+
let result = ic.domain3dCls.c2b_NewSplitChain(atoms);
|
|
37327
|
+
let subdomains = result.subdomains;
|
|
37328
|
+
//let substruct = result.substruct;
|
|
37329
|
+
|
|
37330
|
+
//let jsonStr = ic.domain3dCls.getDomainJsonForAlign(atoms);
|
|
37331
|
+
|
|
36678
37332
|
for(let i = 0, il = subdomains.length; i < il; ++i) {
|
|
36679
37333
|
// domain item: {"sdid":1722375,"intervals":[[1,104],[269,323]]}
|
|
36680
37334
|
let domain = {};
|
|
@@ -36698,73 +37352,7 @@ class AnnoDomain {
|
|
|
36698
37352
|
}
|
|
36699
37353
|
|
|
36700
37354
|
ic.bAjax3ddomain = true;
|
|
36701
|
-
ic.bAjaxDoneArray[index] = true;
|
|
36702
|
-
|
|
36703
|
-
/*
|
|
36704
|
-
$.ajax({
|
|
36705
|
-
url: url,
|
|
36706
|
-
dataType: 'json',
|
|
36707
|
-
cache: true,
|
|
36708
|
-
tryCount : 0,
|
|
36709
|
-
retryLimit : 1,
|
|
36710
|
-
success: function(data) {
|
|
36711
|
-
ic.mmdb_dataArray[index] = data;
|
|
36712
|
-
for(let chnid in ic.protein_chainid) {
|
|
36713
|
-
if(chnid.indexOf(pdbid) !== -1) {
|
|
36714
|
-
thisClass.showDomainWithData(chnid, ic.mmdb_dataArray[index]);
|
|
36715
|
-
}
|
|
36716
|
-
}
|
|
36717
|
-
// add here after the ajax call
|
|
36718
|
-
ic.showAnnoCls.enableHlSeq();
|
|
36719
|
-
ic.bAjax3ddomain = true;
|
|
36720
|
-
ic.bAjaxDoneArray[index] = true;
|
|
36721
|
-
if(ic.deferred3ddomain !== undefined) {
|
|
36722
|
-
if(me.cfg.align === undefined || me.cfg.chainalign === undefined || ic.bRealign) {
|
|
36723
|
-
ic.deferred3ddomain.resolve();
|
|
36724
|
-
}
|
|
36725
|
-
else {
|
|
36726
|
-
let bAjaxDoneAll = true;
|
|
36727
|
-
for(let i = 0, il = pdbArray.length; i < il; ++i) {
|
|
36728
|
-
bAjaxDoneAll = bAjaxDoneAll && ic.bAjaxDoneArray[i];
|
|
36729
|
-
}
|
|
36730
|
-
if(bAjaxDoneAll) ic.deferred3ddomain.resolve();
|
|
36731
|
-
}
|
|
36732
|
-
}
|
|
36733
|
-
},
|
|
36734
|
-
error : function(xhr, textStatus, errorThrown ) {
|
|
36735
|
-
this.tryCount++;
|
|
36736
|
-
if(this.tryCount <= this.retryLimit) {
|
|
36737
|
-
//try again
|
|
36738
|
-
$.ajax(this);
|
|
36739
|
-
return;
|
|
36740
|
-
}
|
|
36741
|
-
console.log( "No 3D domain data were found for the protein " + pdbid + "..." );
|
|
36742
|
-
for(let chnid in ic.protein_chainid) {
|
|
36743
|
-
if(chnid.indexOf(pdbid) !== -1) {
|
|
36744
|
-
$("#" + ic.pre + "dt_domain_" + chnid).html('');
|
|
36745
|
-
$("#" + ic.pre + "ov_domain_" + chnid).html('');
|
|
36746
|
-
$("#" + ic.pre + "tt_domain_" + chnid).html('');
|
|
36747
|
-
}
|
|
36748
|
-
}
|
|
36749
|
-
ic.showAnnoCls.enableHlSeq();
|
|
36750
|
-
ic.bAjax3ddomain = true;
|
|
36751
|
-
//bAjaxDone1 = true;
|
|
36752
|
-
if(ic.deferred3ddomain !== undefined) {
|
|
36753
|
-
if(me.cfg.align === undefined || me.cfg.chainalign === undefined) {
|
|
36754
|
-
ic.deferred3ddomain.resolve();
|
|
36755
|
-
}
|
|
36756
|
-
else {
|
|
36757
|
-
let bAjaxDoneAll = true;
|
|
36758
|
-
for(let i = 0, il = pdbArray.length; i < il; ++i) {
|
|
36759
|
-
bAjaxDoneAll = bAjaxDoneAll && ic.bAjaxDoneArray[i];
|
|
36760
|
-
}
|
|
36761
|
-
if(bAjaxDoneAll) ic.deferred3ddomain.resolve();
|
|
36762
|
-
}
|
|
36763
|
-
}
|
|
36764
|
-
return;
|
|
36765
|
-
}
|
|
36766
|
-
});
|
|
36767
|
-
*/
|
|
37355
|
+
ic.bAjaxDoneArray[index] = true;
|
|
36768
37356
|
}
|
|
36769
37357
|
}
|
|
36770
37358
|
|
|
@@ -36793,7 +37381,7 @@ class AnnoDomain {
|
|
|
36793
37381
|
|
|
36794
37382
|
if(bCalcDirect) {
|
|
36795
37383
|
proteinname = chnid;
|
|
36796
|
-
domainArray = data.domains[chnid].domains;
|
|
37384
|
+
domainArray = (data.domains[chnid]) ? data.domains[chnid].domains : [];
|
|
36797
37385
|
}
|
|
36798
37386
|
else {
|
|
36799
37387
|
let molinfo = data.moleculeInfor;
|
|
@@ -36928,10 +37516,11 @@ class AnnoSnpClinVar {
|
|
|
36928
37516
|
this.icn3d = icn3d;
|
|
36929
37517
|
}
|
|
36930
37518
|
|
|
36931
|
-
navClinVar(chnid) { let ic = this.icn3d
|
|
37519
|
+
navClinVar(chnid) { let ic = this.icn3d; ic.icn3dui;
|
|
36932
37520
|
let thisClass = this;
|
|
36933
37521
|
ic.currClin[chnid] = - 1;
|
|
36934
|
-
me.myEventCls.onIds("#" + ic.pre + chnid + "_prevclin", "click", function(e) { let ic = thisClass.icn3d;
|
|
37522
|
+
//me.myEventCls.onIds("#" + ic.pre + chnid + "_prevclin", "click", function(e) { let ic = thisClass.icn3d;
|
|
37523
|
+
$(document).on("click", "#" + ic.pre + chnid + "_prevclin", function(e) { let ic = thisClass.icn3d;
|
|
36935
37524
|
e.stopImmediatePropagation();
|
|
36936
37525
|
//e.preventDefault();
|
|
36937
37526
|
let maxLen =(ic.resi2disease_nonempty[chnid] !== undefined) ? Object.keys(ic.resi2disease_nonempty[chnid]).length : 0;
|
|
@@ -36939,20 +37528,24 @@ class AnnoSnpClinVar {
|
|
|
36939
37528
|
if(ic.currClin[chnid] < 0) ic.currClin[chnid] = maxLen - 1; // 0;
|
|
36940
37529
|
thisClass.showClinVarLabelOn3D(chnid);
|
|
36941
37530
|
});
|
|
36942
|
-
me.myEventCls.onIds("#" + ic.pre + chnid + "_nextclin", "click", function(e) { let ic = thisClass.icn3d;
|
|
37531
|
+
//me.myEventCls.onIds("#" + ic.pre + chnid + "_nextclin", "click", function(e) { let ic = thisClass.icn3d;
|
|
37532
|
+
$(document).on("click", "#" + ic.pre + chnid + "_nextclin", function(e) { let ic = thisClass.icn3d;
|
|
36943
37533
|
e.stopImmediatePropagation();
|
|
36944
37534
|
//e.preventDefault();
|
|
36945
37535
|
let maxLen =(ic.resi2disease_nonempty[chnid] !== undefined) ? Object.keys(ic.resi2disease_nonempty[chnid]).length : 0;
|
|
36946
37536
|
++ic.currClin[chnid];
|
|
37537
|
+
|
|
36947
37538
|
if(ic.currClin[chnid] > maxLen - 1) ic.currClin[chnid] = 0; // ic.resi2disease_nonempty[chnid].length - 1;
|
|
36948
37539
|
thisClass.showClinVarLabelOn3D(chnid);
|
|
36949
37540
|
});
|
|
36950
37541
|
}
|
|
36951
37542
|
showClinVarLabelOn3D(chnid) { let ic = this.icn3d, me = ic.icn3dui;
|
|
36952
37543
|
let resiArray = Object.keys(ic.resi2disease_nonempty[chnid]);
|
|
37544
|
+
|
|
36953
37545
|
let chainid, residueid;
|
|
36954
37546
|
chainid = chnid;
|
|
36955
|
-
residueid = chainid + '_' + resiArray[ic.currClin[chnid]];
|
|
37547
|
+
residueid = chainid + '_' + (parseInt(resiArray[ic.currClin[chnid]]) + ic.baseResi[chnid]).toString();
|
|
37548
|
+
|
|
36956
37549
|
let label = '';
|
|
36957
37550
|
let diseaseArray = ic.resi2disease_nonempty[chnid][resiArray[ic.currClin[chnid]]];
|
|
36958
37551
|
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
@@ -36961,6 +37554,8 @@ class AnnoSnpClinVar {
|
|
|
36961
37554
|
break;
|
|
36962
37555
|
}
|
|
36963
37556
|
}
|
|
37557
|
+
if(label == '') label = (diseaseArray.length > 0) ? diseaseArray[0] : "N/A";
|
|
37558
|
+
|
|
36964
37559
|
let position = ic.applyCenterCls.centerAtoms(me.hashUtilsCls.hash2Atoms(ic.residues[residueid], ic.atoms));
|
|
36965
37560
|
//position.center.add(new THREE.Vector3(3.0, 3.0, 3.0)); // shift a little bit
|
|
36966
37561
|
let maxlen = 30;
|
|
@@ -36983,6 +37578,9 @@ class AnnoSnpClinVar {
|
|
|
36983
37578
|
}
|
|
36984
37579
|
ic.drawCls.draw();
|
|
36985
37580
|
}
|
|
37581
|
+
|
|
37582
|
+
//getSnpLine(2, 2, resi2snp, resi2rsnum, resi2clinAllele, resi2disease, resi2index, resi2sig, posarray, posClinArray, 0, chnid, false, bClinvar, undefined, bSnpOnly);
|
|
37583
|
+
|
|
36986
37584
|
getSnpLine(line, totalLineNum, resi2snp, resi2rsnum, resi2clinAllele, resi2disease, resi2index, resi2sig, posarray, posClinArray, bStartEndRes, chnid, bOverview, bClinvar, bTitleOnly, bSnpOnly) { let ic = this.icn3d, me = ic.icn3dui;
|
|
36987
37585
|
let html = '';
|
|
36988
37586
|
let altName = bClinvar ? 'clinvar' : 'snp';
|
|
@@ -37018,22 +37616,25 @@ class AnnoSnpClinVar {
|
|
|
37018
37616
|
else {
|
|
37019
37617
|
html += '<div class="icn3d-seqTitle"></div>';
|
|
37020
37618
|
}
|
|
37619
|
+
|
|
37021
37620
|
let pre = altName;
|
|
37022
37621
|
let snpCnt = 0, clinvarCnt = 0;
|
|
37023
37622
|
let snpTypeHash = {}, currSnpTypeHash = {};
|
|
37024
37623
|
for(let i = 1, il = ic.giSeq[chnid].length; i <= il; ++i) {
|
|
37025
|
-
if(resi2index[i] !== undefined) {
|
|
37624
|
+
if(resi2index[i] !== undefined) {
|
|
37026
37625
|
++snpCnt;
|
|
37027
37626
|
let allDiseaseTitle = '';
|
|
37028
37627
|
for(let j = 0, jl = resi2snp[i].length; j < jl && !bSnpOnly; ++j) {
|
|
37029
37628
|
let diseaseArray = resi2disease[i][j].split('; ');
|
|
37030
37629
|
let sigArray = resi2sig[i][j].split('; ');
|
|
37031
37630
|
let diseaseTitle = '';
|
|
37032
|
-
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
37033
|
-
|
|
37631
|
+
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
37632
|
+
// relax the restriction to show all clinvar
|
|
37633
|
+
//if(diseaseArray[k] != '' && diseaseArray[k] != 'not specified' && diseaseArray[k] != 'not provided') {
|
|
37034
37634
|
diseaseTitle += diseaseArray[k] + '(' + sigArray[k] + '); ';
|
|
37035
|
-
}
|
|
37635
|
+
//}
|
|
37036
37636
|
}
|
|
37637
|
+
|
|
37037
37638
|
if(diseaseTitle != '') {
|
|
37038
37639
|
snpTypeHash[i] = 'icn3d-clinvar';
|
|
37039
37640
|
if(j == line - 2) { // just check the current line, "line = 2" means the first SNP
|
|
@@ -37048,6 +37649,7 @@ class AnnoSnpClinVar {
|
|
|
37048
37649
|
if(allDiseaseTitle.indexOf('Pathogenic') != -1) {
|
|
37049
37650
|
snpTypeHash[i] = 'icn3d-clinvar-path';
|
|
37050
37651
|
}
|
|
37652
|
+
|
|
37051
37653
|
if(snpTypeHash[i] == 'icn3d-clinvar' || snpTypeHash[i] == 'icn3d-clinvar-path') {
|
|
37052
37654
|
++clinvarCnt;
|
|
37053
37655
|
}
|
|
@@ -37062,6 +37664,7 @@ class AnnoSnpClinVar {
|
|
|
37062
37664
|
$("#" + ic.pre + 'tt_snp_' + chnid).html('');
|
|
37063
37665
|
return '';
|
|
37064
37666
|
}
|
|
37667
|
+
|
|
37065
37668
|
if(clinvarCnt == 0 && bClinvar) {
|
|
37066
37669
|
$("#" + ic.pre + 'dt_clinvar_' + chnid).html('');
|
|
37067
37670
|
$("#" + ic.pre + 'ov_clinvar_' + chnid).html('');
|
|
@@ -37079,6 +37682,7 @@ class AnnoSnpClinVar {
|
|
|
37079
37682
|
return html + '<br>';
|
|
37080
37683
|
}
|
|
37081
37684
|
html += '<span class="icn3d-seqLine">';
|
|
37685
|
+
|
|
37082
37686
|
let diseaseStr = '';
|
|
37083
37687
|
let prevEmptyWidth = 0;
|
|
37084
37688
|
let prevLineWidth = 0;
|
|
@@ -37101,9 +37705,10 @@ class AnnoSnpClinVar {
|
|
|
37101
37705
|
let sigArray = resi2sig[i][j].split('; ');
|
|
37102
37706
|
let diseaseTitle = '';
|
|
37103
37707
|
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
37104
|
-
|
|
37708
|
+
// relax the restriction to show all clinvar
|
|
37709
|
+
//if(diseaseArray[k] != '' && diseaseArray[k] != 'not specified' && diseaseArray[k] != 'not provided') {
|
|
37105
37710
|
diseaseTitle += diseaseArray[k] + '(' + sigArray[k] + '); ';
|
|
37106
|
-
}
|
|
37711
|
+
//}
|
|
37107
37712
|
}
|
|
37108
37713
|
}
|
|
37109
37714
|
}
|
|
@@ -37132,6 +37737,7 @@ class AnnoSnpClinVar {
|
|
|
37132
37737
|
}
|
|
37133
37738
|
else { // detailed view
|
|
37134
37739
|
html += ic.showSeqCls.insertGap(chnid, i-1, '-');
|
|
37740
|
+
|
|
37135
37741
|
if(resi2index[i] !== undefined) {
|
|
37136
37742
|
if(!bClinvar && line == 1) {
|
|
37137
37743
|
html += '<span>⇓</span>'; // or down triangle ▼
|
|
@@ -37179,7 +37785,8 @@ class AnnoSnpClinVar {
|
|
|
37179
37785
|
let diseaseTitle = '';
|
|
37180
37786
|
let index = 0;
|
|
37181
37787
|
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
37182
|
-
|
|
37788
|
+
// relax the restriction to show all clinvar
|
|
37789
|
+
//if(diseaseArray[k] != '' && diseaseArray[k] != 'not specified' && diseaseArray[k] != 'not provided') {
|
|
37183
37790
|
if(index > 0) {
|
|
37184
37791
|
diseaseTitle += '; ';
|
|
37185
37792
|
}
|
|
@@ -37188,7 +37795,7 @@ class AnnoSnpClinVar {
|
|
|
37188
37795
|
}
|
|
37189
37796
|
diseaseTitle += diseaseArray[k] + '(' + sigArray[k] + ')';
|
|
37190
37797
|
++index;
|
|
37191
|
-
}
|
|
37798
|
+
//}
|
|
37192
37799
|
}
|
|
37193
37800
|
|
|
37194
37801
|
//resi2rsnum, resi2clinAllele,
|
|
@@ -37258,7 +37865,8 @@ class AnnoSnpClinVar {
|
|
|
37258
37865
|
let diseaseTitle = '';
|
|
37259
37866
|
let index = 0;
|
|
37260
37867
|
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
37261
|
-
|
|
37868
|
+
// relax the restriction to show all clinvar
|
|
37869
|
+
//if(diseaseArray[k] != '' && diseaseArray[k] != 'not specified' && diseaseArray[k] != 'not provided') {
|
|
37262
37870
|
if(index > 0) {
|
|
37263
37871
|
diseaseTitle += '; ';
|
|
37264
37872
|
}
|
|
@@ -37267,7 +37875,7 @@ class AnnoSnpClinVar {
|
|
|
37267
37875
|
}
|
|
37268
37876
|
diseaseTitle += diseaseArray[k] + '(' + sigArray[k] + ')';
|
|
37269
37877
|
++index;
|
|
37270
|
-
}
|
|
37878
|
+
//}
|
|
37271
37879
|
}
|
|
37272
37880
|
if(diseaseTitle != '') {
|
|
37273
37881
|
if(diseaseCnt < shownResCnt) snpStr += resi2snp[i][j];
|
|
@@ -37340,6 +37948,7 @@ class AnnoSnpClinVar {
|
|
|
37340
37948
|
}
|
|
37341
37949
|
html += '</span>';
|
|
37342
37950
|
html += '<br>';
|
|
37951
|
+
|
|
37343
37952
|
return html;
|
|
37344
37953
|
}
|
|
37345
37954
|
processSnpClinvar(data, chnid, chnidBase, bSnpOnly, bVirus) { let ic = this.icn3d; ic.icn3dui;
|
|
@@ -37373,7 +37982,7 @@ class AnnoSnpClinVar {
|
|
|
37373
37982
|
let resiStr = snpStr.substr(0, snpStr.length - 3);
|
|
37374
37983
|
let resi = Math.round(resiStr);
|
|
37375
37984
|
snpStr.substr(snpStr.length - 3, 1);
|
|
37376
|
-
let snpRes = snpStr.substr(snpStr.length - 1, 1);
|
|
37985
|
+
let snpRes = snpStr.substr(snpStr.indexOf('>') + 1); //snpStr.substr(snpStr.length - 1, 1);
|
|
37377
37986
|
//var rsnum = bSnpOnly ? '' : fieldArray[4];
|
|
37378
37987
|
let rsnum = fieldArray[4];
|
|
37379
37988
|
let clinAllele = bSnpOnly ? '' : fieldArray[5];
|
|
@@ -37444,7 +38053,7 @@ class AnnoSnpClinVar {
|
|
|
37444
38053
|
htmlClinvar2 += this.getSnpLine(1, 2, resi2snp, resi2rsnum, resi2clinAllele, resi2disease, resi2index, resi2sig, posarray, posClinArray, 1, chnid, true, bClinvar, undefined, bSnpOnly);
|
|
37445
38054
|
htmlClinvar += '</div>';
|
|
37446
38055
|
htmlClinvar2 += '</div>';
|
|
37447
|
-
htmlClinvar3 += '</div>';
|
|
38056
|
+
htmlClinvar3 += '</div>';
|
|
37448
38057
|
$("#" + ic.pre + 'dt_clinvar_' + chnid).html(htmlClinvar);
|
|
37449
38058
|
$("#" + ic.pre + 'ov_clinvar_' + chnid).html(htmlClinvar2);
|
|
37450
38059
|
$("#" + ic.pre + 'tt_clinvar_' + chnid).html(htmlClinvar3);
|
|
@@ -37466,16 +38075,19 @@ class AnnoSnpClinVar {
|
|
|
37466
38075
|
//var url = "https://www.ncbi.nlm.nih.gov/projects/SNP/beVarSearch_mt.cgi?appname=iCn3D&format=bed&report=pdb2bed&acc=" + chnidBase;
|
|
37467
38076
|
//var url = "https://www.ncbi.nlm.nih.gov/Structure/icn3d/clinvar.txt";
|
|
37468
38077
|
let url = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
|
|
38078
|
+
if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
|
|
38079
|
+
url += "&gene=" + ic.chainsGene[chnid].geneSymbol;
|
|
38080
|
+
}
|
|
37469
38081
|
$.ajax({
|
|
37470
38082
|
url: url,
|
|
37471
38083
|
dataType: 'jsonp',
|
|
37472
38084
|
cache: true,
|
|
37473
38085
|
tryCount : 0,
|
|
37474
|
-
retryLimit : 1
|
|
38086
|
+
retryLimit : 0, //1
|
|
37475
38087
|
success: function(indata) {
|
|
37476
38088
|
if(indata && indata.data && indata.data.length > 0) {
|
|
37477
38089
|
let bSnpOnly = false;
|
|
37478
|
-
let data = indata;
|
|
38090
|
+
let data = indata;
|
|
37479
38091
|
thisClass.processSnpClinvar(data, chnid, chnidBase, bSnpOnly);
|
|
37480
38092
|
}
|
|
37481
38093
|
else {
|
|
@@ -37515,7 +38127,7 @@ class AnnoSnpClinVar {
|
|
|
37515
38127
|
dataType: 'jsonp', //'text',
|
|
37516
38128
|
cache: true,
|
|
37517
38129
|
tryCount : 0,
|
|
37518
|
-
retryLimit : 1
|
|
38130
|
+
retryLimit : 0, //1
|
|
37519
38131
|
success: function(data2) {
|
|
37520
38132
|
//ic.chainid2repgi = JSON.parse(data2);
|
|
37521
38133
|
//var gi = ic.chainid2repgi[chnidBase];
|
|
@@ -37551,6 +38163,7 @@ class AnnoSnpClinVar {
|
|
|
37551
38163
|
showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
|
|
37552
38164
|
let thisClass = this;
|
|
37553
38165
|
if(gi !== undefined) {
|
|
38166
|
+
/*
|
|
37554
38167
|
let url3 = "https://www.ncbi.nlm.nih.gov/projects/SNP/beVarSearch.cgi?appname=iCn3D&format=bed&report=pdb2bed&connect=MSSNPSUBMISSION1&gi=" + gi;
|
|
37555
38168
|
|
|
37556
38169
|
$.ajax({
|
|
@@ -37558,20 +38171,24 @@ class AnnoSnpClinVar {
|
|
|
37558
38171
|
dataType: 'text',
|
|
37559
38172
|
cache: true,
|
|
37560
38173
|
tryCount : 0,
|
|
37561
|
-
retryLimit : 1
|
|
38174
|
+
retryLimit : 0, //1
|
|
37562
38175
|
success: function(data3) {
|
|
37563
38176
|
if(data3) {
|
|
37564
38177
|
let bSnpOnly = true;
|
|
37565
38178
|
thisClass.processSnpClinvar(data3, chnid, chnidBase, bSnpOnly);
|
|
37566
38179
|
} //if(data3 != "") {
|
|
37567
38180
|
else {
|
|
38181
|
+
*/
|
|
37568
38182
|
let url4 = "https://www.ncbi.nlm.nih.gov/Structure/vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
|
|
38183
|
+
if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
|
|
38184
|
+
url4 += "&gene=" + ic.chainsGene[chnid].geneSymbol;
|
|
38185
|
+
}
|
|
37569
38186
|
$.ajax({
|
|
37570
38187
|
url: url4,
|
|
37571
38188
|
dataType: 'jsonp', //'text',
|
|
37572
38189
|
cache: true,
|
|
37573
38190
|
tryCount : 0,
|
|
37574
|
-
retryLimit : 1
|
|
38191
|
+
retryLimit : 0, //1
|
|
37575
38192
|
success: function(data4) {
|
|
37576
38193
|
if(data4 && data4.data && data4.data.length > 0) {
|
|
37577
38194
|
let bSnpOnly = true;
|
|
@@ -37595,6 +38212,7 @@ class AnnoSnpClinVar {
|
|
|
37595
38212
|
return;
|
|
37596
38213
|
}
|
|
37597
38214
|
});
|
|
38215
|
+
/*
|
|
37598
38216
|
}
|
|
37599
38217
|
//if(ic.deferredSnp !== undefined) ic.deferredSnp.resolve();
|
|
37600
38218
|
},
|
|
@@ -37610,6 +38228,7 @@ class AnnoSnpClinVar {
|
|
|
37610
38228
|
return;
|
|
37611
38229
|
}
|
|
37612
38230
|
});
|
|
38231
|
+
*/
|
|
37613
38232
|
}
|
|
37614
38233
|
else {
|
|
37615
38234
|
this.processNoSnp(chnid);
|
|
@@ -40252,6 +40871,19 @@ class SetOption {
|
|
|
40252
40871
|
case 'proteins':
|
|
40253
40872
|
atoms = me.hashUtilsCls.intHash(ic.hAtoms, ic.proteins);
|
|
40254
40873
|
if(Object.keys(ic.hAtoms).length < Object.keys(ic.proteins).length) ;
|
|
40874
|
+
|
|
40875
|
+
// remove disulfide bonds
|
|
40876
|
+
if(style == 'nothing') {
|
|
40877
|
+
ic.opts["ssbonds"] = "no";
|
|
40878
|
+
ic.lines['ssbond'] = [];
|
|
40879
|
+
for(let i in atoms) {
|
|
40880
|
+
ic.atoms[i].style2 = 'nothing';
|
|
40881
|
+
}
|
|
40882
|
+
}
|
|
40883
|
+
else {
|
|
40884
|
+
ic.opts["ssbonds"] = "yes";
|
|
40885
|
+
}
|
|
40886
|
+
|
|
40255
40887
|
break;
|
|
40256
40888
|
case 'sidec':
|
|
40257
40889
|
atoms = me.hashUtilsCls.intHash(ic.hAtoms, ic.sidec);
|
|
@@ -44954,8 +45586,12 @@ class ClickMenu {
|
|
|
44954
45586
|
// },
|
|
44955
45587
|
// clkMn1_align: function() {
|
|
44956
45588
|
me.myEventCls.onIds("#" + me.pre + "mn1_align", "click", function(e) { me.icn3d;
|
|
44957
|
-
me.htmlCls.dialogCls.openDlg('dl_align', 'Align two
|
|
45589
|
+
me.htmlCls.dialogCls.openDlg('dl_align', 'Align two PDB structures');
|
|
44958
45590
|
});
|
|
45591
|
+
|
|
45592
|
+
me.myEventCls.onIds("#" + me.pre + "mn1_alignaf", "click", function(e) { me.icn3d;
|
|
45593
|
+
me.htmlCls.dialogCls.openDlg('dl_alignaf', 'Align two AlphaFold structures');
|
|
45594
|
+
});
|
|
44959
45595
|
// },
|
|
44960
45596
|
// clkMn1_chainalign: function() {
|
|
44961
45597
|
me.myEventCls.onIds("#" + me.pre + "mn1_chainalign", "click", function(e) { me.icn3d;
|
|
@@ -45300,13 +45936,14 @@ class ClickMenu {
|
|
|
45300
45936
|
thisClass.setLogCmd("link to compounds " + ic.molTitle + ": " + url, false);
|
|
45301
45937
|
}
|
|
45302
45938
|
else {
|
|
45939
|
+
let url;
|
|
45303
45940
|
if(me.cfg.cid !== undefined) {
|
|
45304
45941
|
url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_pccompound_3d&from_uid=" + ic.inputid;
|
|
45305
45942
|
thisClass.setLogCmd("link to compounds with structure similar to CID " + ic.inputid + ": " + url, false);
|
|
45306
45943
|
}
|
|
45307
45944
|
else {
|
|
45308
45945
|
let idArray = ic.inputid.split('_');
|
|
45309
|
-
|
|
45946
|
+
|
|
45310
45947
|
if(idArray.length === 1) {
|
|
45311
45948
|
url = me.htmlCls.baseUrl + "vastplus/vastplus.cgi?uid=" + ic.inputid;
|
|
45312
45949
|
thisClass.setLogCmd("link to structures similar to " + ic.inputid + ": " + url, false);
|
|
@@ -45925,6 +46562,10 @@ class ClickMenu {
|
|
|
45925
46562
|
ic.setOptionCls.setOption('color', 'chain');
|
|
45926
46563
|
thisClass.setLogCmd('color chain', true);
|
|
45927
46564
|
});
|
|
46565
|
+
me.myEventCls.onIds("#" + me.pre + "mn4_clrStructure", "click", function(e) { let ic = me.icn3d;
|
|
46566
|
+
ic.setOptionCls.setOption('color', 'structure');
|
|
46567
|
+
thisClass.setLogCmd('color structure', true);
|
|
46568
|
+
});
|
|
45928
46569
|
// },
|
|
45929
46570
|
// clkMn4_clrDomain: function() {
|
|
45930
46571
|
me.myEventCls.onIds("#" + me.pre + "mn4_clrdomain", "click", function(e) { let ic = me.icn3d;
|
|
@@ -46869,7 +47510,7 @@ class ClickMenu {
|
|
|
46869
47510
|
me.myEventCls.onIds("#" + me.pre + "mn6_ssbondsYes", "click", function(e) { let ic = me.icn3d;
|
|
46870
47511
|
let select = "disulfide bonds";
|
|
46871
47512
|
thisClass.setLogCmd(select, true);
|
|
46872
|
-
ic.
|
|
47513
|
+
ic.showInterCls.showSsbonds();
|
|
46873
47514
|
});
|
|
46874
47515
|
// },
|
|
46875
47516
|
// clkMn6_ssbondsExport: function() {
|
|
@@ -47294,13 +47935,13 @@ class SetMenu {
|
|
|
47294
47935
|
|
|
47295
47936
|
$('.ui-widget-header').css({
|
|
47296
47937
|
'border': '1px solid ' + borderColor,
|
|
47297
|
-
'background': bkgdColor + ' url("lib/images/' + bkgdImg + '") 50% 50% repeat-x',
|
|
47938
|
+
'background': bkgdColor + ' url("https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/images/' + bkgdImg + '") 50% 50% repeat-x',
|
|
47298
47939
|
'color':'#fff',
|
|
47299
47940
|
'font-weight':'bold'
|
|
47300
47941
|
});
|
|
47301
47942
|
|
|
47302
47943
|
$('.ui-button .ui-icon').css({
|
|
47303
|
-
'background-image': 'url(lib/images/' + iconImg + ')'
|
|
47944
|
+
'background-image': 'url(https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/images/' + iconImg + ')'
|
|
47304
47945
|
});
|
|
47305
47946
|
|
|
47306
47947
|
$('.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited').css({
|
|
@@ -47399,18 +48040,22 @@ class SetMenu {
|
|
|
47399
48040
|
html += "<li><span>Align</span>";
|
|
47400
48041
|
html += "<ul>";
|
|
47401
48042
|
html += me.htmlCls.setHtmlCls.getLink('mn1_blast_rep_id', 'Sequence to Structure');
|
|
47402
|
-
html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Structure to Structure ' + me.htmlCls.wifiStr);
|
|
47403
|
-
|
|
48043
|
+
//html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Structure to Structure ' + me.htmlCls.wifiStr);
|
|
48044
|
+
html += "<li><span>Structure to Structure</span>";
|
|
48045
|
+
html += "<ul>";
|
|
48046
|
+
html += me.htmlCls.setHtmlCls.getLink('mn1_align', 'Two PDB Structures ' + me.htmlCls.wifiStr);
|
|
48047
|
+
html += me.htmlCls.setHtmlCls.getLink('mn1_alignaf', 'Two AlphaFold Structures ' + me.htmlCls.wifiStr);
|
|
48048
|
+
html += "</ul>";
|
|
48049
|
+
|
|
47404
48050
|
html += me.htmlCls.setHtmlCls.getLink('mn1_chainalign', 'Multiple Chains ' + me.htmlCls.wifiStr);
|
|
47405
48051
|
|
|
47406
48052
|
html += "</ul>";
|
|
47407
48053
|
html += "</li>";
|
|
47408
48054
|
|
|
47409
|
-
//html += me.htmlCls.setHtmlCls.getLink('mn2_realignonseqalign', 'Realign Selection');
|
|
47410
|
-
|
|
47411
48055
|
html += "<li id='" + me.pre + "mn2_realignWrap'><span>Realign Selection</span>";
|
|
47412
48056
|
html += "<ul>";
|
|
47413
|
-
html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', '
|
|
48057
|
+
html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignonstruct', 'by Structure Alignment ' + me.htmlCls.wifiStr, true);
|
|
48058
|
+
html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignonseqalign', 'by Sequence Alignment ' + me.htmlCls.wifiStr);
|
|
47414
48059
|
html += me.htmlCls.setHtmlCls.getRadio('mn2_realign', 'mn2_realignresbyres', 'Residue by Residue');
|
|
47415
48060
|
html += "</ul>";
|
|
47416
48061
|
html += "</li>";
|
|
@@ -47833,15 +48478,16 @@ class SetMenu {
|
|
|
47833
48478
|
html += "</ul>";
|
|
47834
48479
|
html += "</li>";
|
|
47835
48480
|
|
|
47836
|
-
if(me.cfg.cid !== undefined) {
|
|
48481
|
+
//if(me.cfg.cid !== undefined) {
|
|
47837
48482
|
html += "<li><span>Hydrogens</span>";
|
|
47838
48483
|
html += "<ul>";
|
|
47839
48484
|
html += me.htmlCls.setHtmlCls.getRadio('mn3_hydrogens', 'mn3_hydrogensYes', 'Show', true);
|
|
47840
48485
|
html += me.htmlCls.setHtmlCls.getRadio('mn3_hydrogens', 'mn3_hydrogensNo', 'Hide');
|
|
47841
48486
|
html += "</ul>";
|
|
47842
48487
|
html += "</li>";
|
|
47843
|
-
}
|
|
47844
|
-
|
|
48488
|
+
//}
|
|
48489
|
+
|
|
48490
|
+
if(me.cfg.cid === undefined) {
|
|
47845
48491
|
html += "<li><span>Glycans</span>";
|
|
47846
48492
|
html += "<ul>";
|
|
47847
48493
|
html += me.htmlCls.setHtmlCls.getRadio('mn3_glycansCart', 'mn3_glycansCartYes', 'Show Cartoon');
|
|
@@ -48255,16 +48901,18 @@ class SetMenu {
|
|
|
48255
48901
|
|
|
48256
48902
|
if(!me.cfg.simplemenu) html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrArea', 'Solvent<br><span style="padding-left:1.5em;">Accessibility</span>');
|
|
48257
48903
|
|
|
48904
|
+
html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrStructure', 'Structure');
|
|
48905
|
+
|
|
48258
48906
|
if(me.cfg.align !== undefined || me.cfg.chainalign !== undefined || me.cfg.blast_rep_id !== undefined) {
|
|
48259
|
-
|
|
48907
|
+
html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrChain', 'Chain');
|
|
48260
48908
|
}
|
|
48261
48909
|
else {
|
|
48262
|
-
|
|
48910
|
+
html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrChain', 'Chain', true);
|
|
48263
48911
|
}
|
|
48264
48912
|
|
|
48265
|
-
if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined) {
|
|
48913
|
+
//if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined) {
|
|
48266
48914
|
html += me.htmlCls.setHtmlCls.getRadio('mn4_clr', 'mn4_clrdomain', '3D Domain');
|
|
48267
|
-
}
|
|
48915
|
+
//}
|
|
48268
48916
|
|
|
48269
48917
|
if(me.cfg.cid === undefined) {
|
|
48270
48918
|
if(!me.cfg.simplemenu) {
|
|
@@ -48610,6 +49258,7 @@ class SetMenu {
|
|
|
48610
49258
|
html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#addclass' target='_blank'>Add New Classes</a></li>";
|
|
48611
49259
|
html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#modifyfunction' target='_blank'>Modify Functions</a></li>";
|
|
48612
49260
|
html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#restfulapi' target='_blank'>RESTful APIs</a></li>";
|
|
49261
|
+
html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#contributors' target='_blank'>Codeathon Contributors</a></li>";
|
|
48613
49262
|
html += "</ul>";
|
|
48614
49263
|
html += "</li>";
|
|
48615
49264
|
}
|
|
@@ -49414,6 +50063,11 @@ class SetDialog {
|
|
|
49414
50063
|
html += me.htmlCls.buttonStr + "reload_align_ori'>All Matching Molecules Superposed</button>" + me.htmlCls.space3 + me.htmlCls.buttonStr + "reload_align_refined'>Invariant Substructure Superposed</button>";
|
|
49415
50064
|
html += "</div>";
|
|
49416
50065
|
|
|
50066
|
+
html += me.htmlCls.divStr + "dl_alignaf' class='" + dialogClass + "'>";
|
|
50067
|
+
html += "Enter two <a href='https://alphafold.ebi.ac.uk/' target='_blank'>AlphaFold Uniprot</a> IDs: <br/><br/>ID1: " + me.htmlCls.inputTextStr + "id='" + me.pre + "alignafid1' value='P41327' size=8>" + me.htmlCls.space3 + me.htmlCls.space3 + "ID2: " + me.htmlCls.inputTextStr + "id='" + me.pre + "alignafid2' value='P41331' size=8><br/><br/>";
|
|
50068
|
+
html += me.htmlCls.buttonStr + "reload_alignaf'>Align</button>";
|
|
50069
|
+
html += "</div>";
|
|
50070
|
+
|
|
49417
50071
|
html += me.htmlCls.divStr + "dl_chainalign' class='" + dialogClass + "'>";
|
|
49418
50072
|
/*
|
|
49419
50073
|
html += "Enter the PDB chain IDs in the form of pdbid_chain(e.g., 1HHO_A, case sensitive): <br/><br/>ID1: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignid1' value='1HHO_A' size=8>" + me.htmlCls.space3 + me.htmlCls.space3 + "ID2: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignid2' value='4N7N_A' size=8><br/><br/>";
|
|
@@ -49422,7 +50076,7 @@ class SetDialog {
|
|
|
49422
50076
|
html += "</div>";
|
|
49423
50077
|
*/
|
|
49424
50078
|
html += "<div style='width:550px'>";
|
|
49425
|
-
html += "All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of
|
|
50079
|
+
html += "All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID_chain (e.g., P69905_A for AlphaFold structures).<br/><br/>";
|
|
49426
50080
|
html += "<b>Chain IDs</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "chainalignids' value='1HHO_A,4N7N_A,2HCO_A' size=50><br/><br/>";
|
|
49427
50081
|
html += "<b>Optional 1</b>, full chains are used for structure alignment<br/><br/>";
|
|
49428
50082
|
html += "<b>Optional 2</b>, sequence alignment (followed by structure alignemnt) based on residue numbers in the First/Master chain: <br>" + me.htmlCls.inputTextStr + "id='" + me.pre + "resalignids' placeholder='1,5,10-50' size=50><br/><br/>";
|
|
@@ -49750,7 +50404,16 @@ class SetDialog {
|
|
|
49750
50404
|
html += "<div style='text-indent:1.1em'><select id='" + me.pre + "atomsCustomRealign' multiple size='5' style='min-width:130px;'>";
|
|
49751
50405
|
html += "</select></div>";
|
|
49752
50406
|
|
|
49753
|
-
html += "<div>2. " + me.htmlCls.buttonStr + "applyRealign'>Realign</button></div><br>";
|
|
50407
|
+
html += "<div>2. " + me.htmlCls.buttonStr + "applyRealign'>Realign by Sequence</button></div><br>";
|
|
50408
|
+
html += "</div>";
|
|
50409
|
+
|
|
50410
|
+
html += me.htmlCls.divStr + "dl_realignbystruct' class='" + dialogClass + "'>";
|
|
50411
|
+
|
|
50412
|
+
html += me.htmlCls.divNowrapStr + "1. Select sets from two structures below <br>or use your current selection:</div><br>";
|
|
50413
|
+
html += "<div style='text-indent:1.1em'><select id='" + me.pre + "atomsCustomRealignByStruct' multiple size='5' style='min-width:130px;'>";
|
|
50414
|
+
html += "</select></div>";
|
|
50415
|
+
|
|
50416
|
+
html += "<div>2. " + me.htmlCls.buttonStr + "applyRealignByStruct'>Realign by Structure</button></div><br>";
|
|
49754
50417
|
html += "</div>";
|
|
49755
50418
|
|
|
49756
50419
|
html += me.htmlCls.divStr + "dl_allinteraction' style='background-color:white' class='" + dialogClass + "'>";
|
|
@@ -50474,12 +51137,31 @@ class Events {
|
|
|
50474
51137
|
if($("#" + me.pre + "atomsCustomRealign").length) {
|
|
50475
51138
|
$("#" + me.pre + "atomsCustomRealign").html(definedAtomsHtml);
|
|
50476
51139
|
}
|
|
50477
|
-
if($("#" + me.pre + "atomsCustomRealign2").length) {
|
|
50478
|
-
|
|
50479
|
-
}
|
|
51140
|
+
//if($("#" + me.pre + "atomsCustomRealign2").length) {
|
|
51141
|
+
// $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
|
|
51142
|
+
//}
|
|
50480
51143
|
if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realign', 'Please select two sets to realign');
|
|
50481
51144
|
$("#" + me.pre + "atomsCustomRealign").resizable();
|
|
50482
|
-
|
|
51145
|
+
//$("#" + me.pre + "atomsCustomRealign2").resizable();
|
|
51146
|
+
});
|
|
51147
|
+
|
|
51148
|
+
me.myEventCls.onIds("#" + me.pre + "mn2_realignonstruct", "click", function(e) { let ic = me.icn3d;
|
|
51149
|
+
if(ic.bSetChainsAdvancedMenu === undefined || !ic.bSetChainsAdvancedMenu) {
|
|
51150
|
+
let prevHAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
|
|
51151
|
+
ic.definedSetsCls.setPredefinedInMenu();
|
|
51152
|
+
ic.bSetChainsAdvancedMenu = true;
|
|
51153
|
+
ic.hAtoms = me.hashUtilsCls.cloneHash(prevHAtoms);
|
|
51154
|
+
}
|
|
51155
|
+
let definedAtomsHtml = ic.definedSetsCls.setAtomMenu(['protein']);
|
|
51156
|
+
if($("#" + me.pre + "atomsCustomRealignByStruct").length) {
|
|
51157
|
+
$("#" + me.pre + "atomsCustomRealignByStruct").html(definedAtomsHtml);
|
|
51158
|
+
}
|
|
51159
|
+
//if($("#" + me.pre + "atomsCustomRealign2").length) {
|
|
51160
|
+
// $("#" + me.pre + "atomsCustomRealign2").html(definedAtomsHtml);
|
|
51161
|
+
//}
|
|
51162
|
+
if(ic.bRender) me.htmlCls.dialogCls.openDlg('dl_realignbystruct', 'Please select two sets to realign');
|
|
51163
|
+
$("#" + me.pre + "atomsCustomRealignByStruct").resizable();
|
|
51164
|
+
//$("#" + me.pre + "atomsCustomRealign2").resizable();
|
|
50483
51165
|
});
|
|
50484
51166
|
// },
|
|
50485
51167
|
// clickApplyRealign: function() {
|
|
@@ -50493,7 +51175,7 @@ class Events {
|
|
|
50493
51175
|
|
|
50494
51176
|
// save the current selection
|
|
50495
51177
|
ic.selectionCls.saveSelectionPrep();
|
|
50496
|
-
let name = '
|
|
51178
|
+
let name = 'realignSetsBySeq';
|
|
50497
51179
|
ic.selectionCls.saveSelection(name, name);
|
|
50498
51180
|
|
|
50499
51181
|
ic.realignParserCls.realignOnSeqAlign();
|
|
@@ -50504,6 +51186,28 @@ class Events {
|
|
|
50504
51186
|
me.htmlCls.clickMenuCls.setLogCmd("realign on seq align", true);
|
|
50505
51187
|
}
|
|
50506
51188
|
});
|
|
51189
|
+
|
|
51190
|
+
me.myEventCls.onIds("#" + me.pre + "applyRealignByStruct", "click", function(e) { let ic = me.icn3d;
|
|
51191
|
+
e.preventDefault();
|
|
51192
|
+
if(!me.cfg.notebook) dialog.dialog( "close" );
|
|
51193
|
+
let nameArray = $("#" + me.pre + "atomsCustomRealignByStruct").val();
|
|
51194
|
+
if(nameArray.length > 0) {
|
|
51195
|
+
ic.hAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
|
|
51196
|
+
}
|
|
51197
|
+
|
|
51198
|
+
// save the current selection
|
|
51199
|
+
ic.selectionCls.saveSelectionPrep();
|
|
51200
|
+
let name = 'realignSetsByStruct';
|
|
51201
|
+
ic.selectionCls.saveSelection(name, name);
|
|
51202
|
+
|
|
51203
|
+
ic.realignParserCls.realignOnStructAlign();
|
|
51204
|
+
if(nameArray.length > 0) {
|
|
51205
|
+
me.htmlCls.clickMenuCls.setLogCmd("realign on structure align | " + nameArray, true);
|
|
51206
|
+
}
|
|
51207
|
+
else {
|
|
51208
|
+
me.htmlCls.clickMenuCls.setLogCmd("realign on structure align", true);
|
|
51209
|
+
}
|
|
51210
|
+
});
|
|
50507
51211
|
// },
|
|
50508
51212
|
|
|
50509
51213
|
// other
|
|
@@ -50675,6 +51379,14 @@ class Events {
|
|
|
50675
51379
|
//window.open( me.htmlCls.baseUrl + 'icn3d/full.html?align=' + alignment + '&showalignseq=1&atype=0', '_blank');
|
|
50676
51380
|
window.open(hostUrl + '?align=' + alignment + '&showalignseq=1&atype=0&bu=1', '_blank');
|
|
50677
51381
|
});
|
|
51382
|
+
|
|
51383
|
+
me.myEventCls.onIds("#" + me.pre + "reload_alignaf", "click", function(e) { me.icn3d;
|
|
51384
|
+
e.preventDefault();
|
|
51385
|
+
if(!me.cfg.notebook) dialog.dialog( "close" );
|
|
51386
|
+
let alignment = $("#" + me.pre + "alignafid1").val() + "_A," + $("#" + me.pre + "alignafid2").val() + "_A";
|
|
51387
|
+
me.htmlCls.clickMenuCls.setLogCmd("load chains " + alignment + " | residues | resdef ", false);
|
|
51388
|
+
window.open(hostUrl + '?chainalign=' + alignment + '&resnum=&resdef=&showalignseq=1', '_blank');
|
|
51389
|
+
});
|
|
50678
51390
|
// },
|
|
50679
51391
|
// clickReload_chainalign: function() {
|
|
50680
51392
|
me.myEventCls.onIds("#" + me.pre + "reload_chainalign", "click", function(e) { me.icn3d;
|
|
@@ -51303,7 +52015,7 @@ class Events {
|
|
|
51303
52015
|
dataType: 'jsonp',
|
|
51304
52016
|
cache: true,
|
|
51305
52017
|
tryCount : 0,
|
|
51306
|
-
retryLimit : 1
|
|
52018
|
+
retryLimit : 0, //1
|
|
51307
52019
|
beforeSend: function() {
|
|
51308
52020
|
ic.ParserUtilsCls.showLoading();
|
|
51309
52021
|
},
|
|
@@ -54105,7 +54817,7 @@ class ContactMap {
|
|
|
54105
54817
|
dataType: dataType,
|
|
54106
54818
|
cache: true,
|
|
54107
54819
|
tryCount : 0,
|
|
54108
|
-
retryLimit : 1
|
|
54820
|
+
retryLimit : 0, //1
|
|
54109
54821
|
success: function(data) {
|
|
54110
54822
|
thisClass.processAfErrorMap(data, bFull);
|
|
54111
54823
|
},
|
|
@@ -56891,7 +57603,7 @@ class iCn3DUI {
|
|
|
56891
57603
|
//even when multiple iCn3D viewers are shown together.
|
|
56892
57604
|
this.pre = this.cfg.divid + "_";
|
|
56893
57605
|
|
|
56894
|
-
this.REVISION = '3.
|
|
57606
|
+
this.REVISION = '3.11.0';
|
|
56895
57607
|
|
|
56896
57608
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
56897
57609
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|
|
@@ -57138,7 +57850,7 @@ iCn3DUI.prototype.show3DStructure = function() { let me = this;
|
|
|
57138
57850
|
url: url,
|
|
57139
57851
|
dataType: 'json',
|
|
57140
57852
|
tryCount : 0,
|
|
57141
|
-
retryLimit : 1
|
|
57853
|
+
retryLimit : 0, //1
|
|
57142
57854
|
success: function(data) {
|
|
57143
57855
|
for(let q = 0, ql = data.BlastOutput2.length; q < ql; ++q) {
|
|
57144
57856
|
if(data.BlastOutput2[q].report.results.search.query_id != me.cfg.query_id) continue;
|
|
@@ -57194,7 +57906,7 @@ iCn3DUI.prototype.show3DStructure = function() { let me = this;
|
|
|
57194
57906
|
url: url,
|
|
57195
57907
|
dataType: 'jsonp',
|
|
57196
57908
|
tryCount : 0,
|
|
57197
|
-
retryLimit : 1
|
|
57909
|
+
retryLimit : 0, //1
|
|
57198
57910
|
success: function(data) {
|
|
57199
57911
|
if(data.InformationList !== undefined && data.InformationList.Information !== undefined) ic.molTitle = data.InformationList.Information[0].Title;
|
|
57200
57912
|
},
|