icn3d 3.34.6 → 3.35.1
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 +184 -75
- package/icn3d.min.js +3 -3
- package/icn3d.module.js +184 -75
- package/package.json +1 -1
package/icn3d.js
CHANGED
|
@@ -37305,7 +37305,6 @@ class HBond {
|
|
|
37305
37305
|
//"threshold" is the maximum distance of hydrogen bonds and has the unit of angstrom.
|
|
37306
37306
|
calculateChemicalHbonds(startAtoms, targetAtoms, threshold, bSaltbridge, type, bInternal) { let ic = this.icn3d, me = ic.icn3dui;
|
|
37307
37307
|
if(Object.keys(startAtoms).length === 0 || Object.keys(targetAtoms).length === 0) return;
|
|
37308
|
-
|
|
37309
37308
|
ic.resid2Residhash = {};
|
|
37310
37309
|
|
|
37311
37310
|
let atomHbond = {};
|
|
@@ -37399,6 +37398,7 @@ class HBond {
|
|
|
37399
37398
|
&& (atom.name === 'N' || atom.name === 'O') && (atomHbond[j].name === 'O' || atomHbond[j].name === 'N') ) {
|
|
37400
37399
|
|
|
37401
37400
|
if(atom.name === atomHbond[j].name) continue;
|
|
37401
|
+
|
|
37402
37402
|
if(atom.structure == atomHbond[j].structure && atom.chain == atomHbond[j].chain && Math.abs(atom.resi - atomHbond[j].resi) <= 1) continue; // peptide bond
|
|
37403
37403
|
|
|
37404
37404
|
// protein backbone hydrogen
|
|
@@ -42225,6 +42225,7 @@ class AnnoSnpClinVar {
|
|
|
42225
42225
|
let altName = bClinvar ? 'clinvar' : 'snp';
|
|
42226
42226
|
// determine whether the SNPis from virus directly
|
|
42227
42227
|
let bVirus = false;
|
|
42228
|
+
|
|
42228
42229
|
for(let resi in resi2rsnum) {
|
|
42229
42230
|
for(let i = 0, il = resi2rsnum[resi].length; i < il; ++i) {
|
|
42230
42231
|
if(resi2rsnum[resi][i] == 0) {
|
|
@@ -42237,7 +42238,8 @@ class AnnoSnpClinVar {
|
|
|
42237
42238
|
|
|
42238
42239
|
if(bStartEndRes) {
|
|
42239
42240
|
let title1 = 'ClinVar', title2 = 'SNP', warning = "", warning2 = "";
|
|
42240
|
-
|
|
42241
|
+
|
|
42242
|
+
if(!bVirus && ic.organism !== undefined && ic.organism.toLowerCase() !== 'human' && ic.organism.toLowerCase() !== 'homo sapiens') {
|
|
42241
42243
|
warning = " <span style='color:#FFA500'>(from human)</span>";
|
|
42242
42244
|
warning2 = " <span style='color:#FFA500'>(based on human sequences and mapped to this structure by sequence similarity)</span>";
|
|
42243
42245
|
}
|
|
@@ -42260,7 +42262,11 @@ class AnnoSnpClinVar {
|
|
|
42260
42262
|
let pre = altName;
|
|
42261
42263
|
let snpCnt = 0, clinvarCnt = 0;
|
|
42262
42264
|
let snpTypeHash = {}, currSnpTypeHash = {};
|
|
42263
|
-
|
|
42265
|
+
let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.chains[chnid]);
|
|
42266
|
+
// for(let i = 1, il = ic.giSeq[chnid].length; i <= il; ++i) {
|
|
42267
|
+
for(let resid in residHash) {
|
|
42268
|
+
let i = resid.split('_')[2];
|
|
42269
|
+
|
|
42264
42270
|
if(resi2index[i] !== undefined) {
|
|
42265
42271
|
++snpCnt;
|
|
42266
42272
|
let allDiseaseTitle = '';
|
|
@@ -42271,7 +42277,11 @@ class AnnoSnpClinVar {
|
|
|
42271
42277
|
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
42272
42278
|
// relax the restriction to show all clinvar
|
|
42273
42279
|
//if(diseaseArray[k] != '' && diseaseArray[k] != 'not specified' && diseaseArray[k] != 'not provided') {
|
|
42274
|
-
diseaseTitle += diseaseArray[k]
|
|
42280
|
+
diseaseTitle += diseaseArray[k];
|
|
42281
|
+
if(sigArray[k] != '') {
|
|
42282
|
+
diseaseTitle += '(' + sigArray[k] + ')';
|
|
42283
|
+
}
|
|
42284
|
+
diseaseTitle += '; ';
|
|
42275
42285
|
//}
|
|
42276
42286
|
}
|
|
42277
42287
|
|
|
@@ -42337,18 +42347,21 @@ class AnnoSnpClinVar {
|
|
|
42337
42347
|
if(ic.seqStartLen && ic.seqStartLen[chnid]) html += ic.showSeqCls.insertMulGap(ic.seqStartLen[chnid], '-');
|
|
42338
42348
|
}
|
|
42339
42349
|
|
|
42340
|
-
for(let
|
|
42350
|
+
for(let index = 1, indexl = ic.giSeq[chnid].length; index <= indexl; ++index) {
|
|
42351
|
+
let pos = ic.ParserUtilsCls.getResi(chnid, index - 1);
|
|
42352
|
+
let i = pos;
|
|
42353
|
+
|
|
42341
42354
|
if(bOverview) {
|
|
42342
42355
|
if(resi2index[i] !== undefined) {
|
|
42343
42356
|
|
|
42344
42357
|
// get the mouse over text
|
|
42345
|
-
let cFull = ic.giSeq[chnid][
|
|
42358
|
+
let cFull = ic.giSeq[chnid][index-1];
|
|
42346
42359
|
let c = cFull;
|
|
42347
42360
|
if(cFull.length > 1) {
|
|
42348
42361
|
c = cFull[0] + '..';
|
|
42349
42362
|
}
|
|
42350
42363
|
// let pos =(i >= ic.matchedPos[chnid] && i-1 - ic.matchedPos[chnid] < ic.chainsSeq[chnid].length) ? ic.chainsSeq[chnid][i-1 - ic.matchedPos[chnid]].resi : ic.baseResi[chnid] + 1 + i-1;
|
|
42351
|
-
|
|
42364
|
+
|
|
42352
42365
|
let snpTitle = pos + c + '>';
|
|
42353
42366
|
for(let j = 0, jl = resi2snp[i].length; j < jl; ++j) {
|
|
42354
42367
|
snpTitle += resi2snp[i][j];
|
|
@@ -42359,24 +42372,28 @@ class AnnoSnpClinVar {
|
|
|
42359
42372
|
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
42360
42373
|
// relax the restriction to show all clinvar
|
|
42361
42374
|
//if(diseaseArray[k] != '' && diseaseArray[k] != 'not specified' && diseaseArray[k] != 'not provided') {
|
|
42362
|
-
diseaseTitle += diseaseArray[k]
|
|
42375
|
+
diseaseTitle += diseaseArray[k];
|
|
42376
|
+
if(sigArray[k] != '') {
|
|
42377
|
+
diseaseTitle += '(' + sigArray[k] + ')';
|
|
42378
|
+
}
|
|
42379
|
+
diseaseTitle += '; ';
|
|
42363
42380
|
//}
|
|
42364
42381
|
}
|
|
42365
42382
|
}
|
|
42366
42383
|
}
|
|
42367
|
-
html += ic.showSeqCls.insertGapOverview(chnid,
|
|
42368
|
-
let emptyWidth = Math.round(ic.seqAnnWidth *(
|
|
42384
|
+
html += ic.showSeqCls.insertGapOverview(chnid, index-1);
|
|
42385
|
+
let emptyWidth = Math.round(ic.seqAnnWidth *(index-1) /(ic.maxAnnoLength + ic.nTotalGap) - prevEmptyWidth - prevLineWidth);
|
|
42369
42386
|
//let emptyWidth =(me.cfg.blast_rep_id == chnid) ? Math.round(ic.seqAnnWidth *(i-1) /(ic.maxAnnoLength + ic.nTotalGap) - prevEmptyWidth - prevLineWidth) : Math.round(ic.seqAnnWidth *(i-1) / ic.maxAnnoLength - prevEmptyWidth - prevLineWidth);
|
|
42370
42387
|
//if(emptyWidth < 0) emptyWidth = 0;
|
|
42371
42388
|
if(bClinvar) {
|
|
42372
|
-
if(snpTypeHash[i] == 'icn3d-clinvar' || snpTypeHash[i] == 'icn3d-clinvar-path') {
|
|
42389
|
+
// if(snpTypeHash[i] == 'icn3d-clinvar' || snpTypeHash[i] == 'icn3d-clinvar-path') {
|
|
42373
42390
|
if(emptyWidth >= 0) {
|
|
42374
42391
|
html += '<div style="display:inline-block; width:' + emptyWidth + 'px;"> </div>';
|
|
42375
42392
|
html += '<div style="display:inline-block; background-color:#000; width:' + widthPerRes + 'px;" title="' + snpTitle + '"> </div>';
|
|
42376
42393
|
prevEmptyWidth += emptyWidth;
|
|
42377
42394
|
prevLineWidth += widthPerRes;
|
|
42378
42395
|
}
|
|
42379
|
-
}
|
|
42396
|
+
// }
|
|
42380
42397
|
}
|
|
42381
42398
|
else {
|
|
42382
42399
|
if(emptyWidth > 0) {
|
|
@@ -42389,20 +42406,20 @@ class AnnoSnpClinVar {
|
|
|
42389
42406
|
}
|
|
42390
42407
|
}
|
|
42391
42408
|
else { // detailed view
|
|
42392
|
-
html += ic.showSeqCls.insertGap(chnid,
|
|
42409
|
+
html += ic.showSeqCls.insertGap(chnid, index-1, '-');
|
|
42393
42410
|
|
|
42394
42411
|
if(resi2index[i] !== undefined) {
|
|
42395
42412
|
if(!bClinvar && line == 1) {
|
|
42396
42413
|
html += '<span>⇓</span>'; // or down triangle ▼
|
|
42397
42414
|
}
|
|
42398
42415
|
else {
|
|
42399
|
-
let cFull = ic.giSeq[chnid][
|
|
42416
|
+
let cFull = ic.giSeq[chnid][index-1];
|
|
42400
42417
|
let c = cFull;
|
|
42401
42418
|
if(cFull.length > 1) {
|
|
42402
42419
|
c = cFull[0] + '..';
|
|
42403
42420
|
}
|
|
42404
42421
|
// let pos =(i >= ic.matchedPos[chnid] && i-1 - ic.matchedPos[chnid] < ic.chainsSeq[chnid].length) ? ic.chainsSeq[chnid][i-1 - ic.matchedPos[chnid]].resi : ic.baseResi[chnid] + 1 + i-1;
|
|
42405
|
-
let pos = ic.ParserUtilsCls.getResi(chnid,
|
|
42422
|
+
// let pos = ic.ParserUtilsCls.getResi(chnid, index - 1);
|
|
42406
42423
|
let snpStr = "", snpTitle = "<div class='snptip'>";
|
|
42407
42424
|
//var snpType = '';
|
|
42408
42425
|
let jl = resi2snp[i].length;
|
|
@@ -42447,7 +42464,10 @@ class AnnoSnpClinVar {
|
|
|
42447
42464
|
else {
|
|
42448
42465
|
if( j === 0 || j === 1) diseaseStr = 'disease="' + diseaseArray[k] + '"';
|
|
42449
42466
|
}
|
|
42450
|
-
diseaseTitle += diseaseArray[k]
|
|
42467
|
+
diseaseTitle += diseaseArray[k];
|
|
42468
|
+
if(sigArray[k] != '') {
|
|
42469
|
+
diseaseTitle += '(' + sigArray[k] + ')';
|
|
42470
|
+
}
|
|
42451
42471
|
++index;
|
|
42452
42472
|
//}
|
|
42453
42473
|
}
|
|
@@ -42517,23 +42537,26 @@ class AnnoSnpClinVar {
|
|
|
42517
42537
|
let diseaseArray = resi2disease[i][j].split('; ');
|
|
42518
42538
|
let sigArray = resi2sig[i][j].split('; ');
|
|
42519
42539
|
let diseaseTitle = '';
|
|
42520
|
-
let
|
|
42540
|
+
let indexTmp = 0;
|
|
42521
42541
|
|
|
42522
42542
|
for(let k = 0, kl = diseaseArray.length; k < kl; ++k) {
|
|
42523
42543
|
// relax the restriction to show all clinvar
|
|
42524
42544
|
//if(diseaseArray[k] != '' && diseaseArray[k] != 'not specified' && diseaseArray[k] != 'not provided') {
|
|
42525
|
-
if(
|
|
42545
|
+
if(indexTmp > 0) {
|
|
42526
42546
|
diseaseTitle += '; ';
|
|
42527
42547
|
}
|
|
42528
42548
|
else {
|
|
42529
42549
|
if( j === 0 || j === 1) diseaseStr = 'disease="' + diseaseArray[k] + '"';
|
|
42530
42550
|
}
|
|
42531
|
-
diseaseTitle += diseaseArray[k]
|
|
42532
|
-
|
|
42551
|
+
diseaseTitle += diseaseArray[k];
|
|
42552
|
+
if(sigArray[k] != '') {
|
|
42553
|
+
diseaseTitle += '(' + sigArray[k] + ')';
|
|
42554
|
+
}
|
|
42555
|
+
++indexTmp;
|
|
42533
42556
|
//}
|
|
42534
42557
|
}
|
|
42535
42558
|
|
|
42536
|
-
if(diseaseTitle != '') {
|
|
42559
|
+
// if(diseaseTitle != '') {
|
|
42537
42560
|
if(diseaseCnt < shownResCnt) snpStr += resi2snp[i][j];
|
|
42538
42561
|
snpTitle += pos + c + '>' + resi2snp[i][j];
|
|
42539
42562
|
//snpType = 'icn3d-clinvar';
|
|
@@ -42546,19 +42569,22 @@ class AnnoSnpClinVar {
|
|
|
42546
42569
|
}
|
|
42547
42570
|
|
|
42548
42571
|
//snpTitle += "<br>Links: <span class='" + ic.pre + "snpin3d icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP in 3D with scap</span>, <span class='" + ic.pre + "snpinter icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP Interactions in 3D</span>, <span class='" + ic.pre + "snppdb icn3d-snplink' snp='" + chnid + "_" + pos + "_" + resi2snp[i][j] + "'>SNP PDB</span>, <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' target='_blank'>ClinVar</a>, <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</a>";
|
|
42549
|
-
snpTitle += "<br>Links: <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' style='color:blue' target='_blank'>ClinVar</a
|
|
42572
|
+
snpTitle += "<br>Links: <a href='https://www.ncbi.nlm.nih.gov/clinvar/?term=" + resi2clinAllele[i][j] + "[AlleleID]' style='color:blue' target='_blank'>ClinVar</a>";
|
|
42573
|
+
if(resi2rsnum[i][j] != 0) {
|
|
42574
|
+
snpTitle += ", <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' style='color:blue' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</a>";
|
|
42575
|
+
}
|
|
42550
42576
|
if(j < jl - 1) {
|
|
42551
42577
|
snpTitle += '<br><br>';
|
|
42552
42578
|
}
|
|
42553
42579
|
++diseaseCnt;
|
|
42554
|
-
} // if(diseaseTitle != '') {
|
|
42580
|
+
// } // if(diseaseTitle != '') {
|
|
42555
42581
|
} // for(let j = start; j < jl && j < end; ++j) {
|
|
42556
42582
|
//if(diseaseCnt > shownResCnt && line == 3) snpStr += '..';
|
|
42557
42583
|
if(diseaseCnt > shownResCnt && line == 2) snpStr += '..';
|
|
42558
42584
|
} // else { // if(bClinvar)
|
|
42559
42585
|
snpTitle += '</div>';
|
|
42560
42586
|
if(bClinvar) {
|
|
42561
|
-
if(snpTypeHash[i] == 'icn3d-clinvar' || snpTypeHash[i] == 'icn3d-clinvar-path') {
|
|
42587
|
+
// if(snpTypeHash[i] == 'icn3d-clinvar' || snpTypeHash[i] == 'icn3d-clinvar-path') {
|
|
42562
42588
|
if(line == 1) {
|
|
42563
42589
|
html += '<span>⇓</span>'; // or down triangle ▼
|
|
42564
42590
|
}
|
|
@@ -42567,13 +42593,14 @@ class AnnoSnpClinVar {
|
|
|
42567
42593
|
html += '<span>-</span>';
|
|
42568
42594
|
}
|
|
42569
42595
|
else {
|
|
42570
|
-
html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" ' + diseaseStr + ' class="icn3d-tooltip icn3d-residue ' + currSnpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42596
|
+
// html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" ' + diseaseStr + ' class="icn3d-tooltip icn3d-residue ' + currSnpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42597
|
+
html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" ' + diseaseStr + ' class="icn3d-tooltip icn3d-residue ' + snpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42571
42598
|
}
|
|
42572
42599
|
}
|
|
42573
|
-
}
|
|
42574
|
-
else {
|
|
42575
|
-
|
|
42576
|
-
}
|
|
42600
|
+
// }
|
|
42601
|
+
// else {
|
|
42602
|
+
// html += '<span>-</span>';
|
|
42603
|
+
// }
|
|
42577
42604
|
}
|
|
42578
42605
|
else {
|
|
42579
42606
|
if(snpStr == '' || snpStr == ' ') {
|
|
@@ -42581,10 +42608,12 @@ class AnnoSnpClinVar {
|
|
|
42581
42608
|
}
|
|
42582
42609
|
else {
|
|
42583
42610
|
if(!bSnpOnly) {
|
|
42584
|
-
html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" ' + diseaseStr + ' class="icn3d-tooltip icn3d-residue ' + currSnpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42611
|
+
// html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" ' + diseaseStr + ' class="icn3d-tooltip icn3d-residue ' + currSnpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42612
|
+
html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" ' + diseaseStr + ' class="icn3d-tooltip icn3d-residue ' + snpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42585
42613
|
}
|
|
42586
42614
|
else {
|
|
42587
|
-
html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" class="icn3d-tooltip icn3d-residue ' + currSnpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42615
|
+
// html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" class="icn3d-tooltip icn3d-residue ' + currSnpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42616
|
+
html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" label title="' + snpTitle + '" class="icn3d-tooltip icn3d-residue ' + snpTypeHash[i] + '">' + snpStr + '</span>';
|
|
42588
42617
|
}
|
|
42589
42618
|
}
|
|
42590
42619
|
}
|
|
@@ -42640,23 +42669,60 @@ class AnnoSnpClinVar {
|
|
|
42640
42669
|
}
|
|
42641
42670
|
}
|
|
42642
42671
|
|
|
42672
|
+
let foundRealSnp = {};
|
|
42643
42673
|
for(let i = 0, il = lineArray.length; i < il; ++i) {
|
|
42644
42674
|
//bSnpOnly: false
|
|
42645
|
-
//1310770 13 14 14Y>H 368771578 150500 Hereditary cancer-predisposing syndrome; Li-Fraumeni syndrome; not specified; Li-Fraumeni syndrome 1 Likely benign; Uncertain significance; Uncertain significance; Uncertain significance
|
|
42646
|
-
//Pdb_gi, Pos from, Pos to, Pos & Amino acid change, rs#, ClinVar Allele ID, Disease name, Clinical significance,
|
|
42675
|
+
//1310770 13 14 14Y>H 368771578 150500 Hereditary cancer-predisposing syndrome; Li-Fraumeni syndrome; not specified; Li-Fraumeni syndrome 1 Likely benign; Uncertain significance; Uncertain significance; Uncertain significance 0
|
|
42676
|
+
//Pdb_gi, Pos from, Pos to, Pos & Amino acid change, rs#, ClinVar Allele ID, Disease name, Clinical significance, [whether data is directly from ClinVar database, 0 or 1]
|
|
42647
42677
|
//bSnpOnly: true
|
|
42648
|
-
//1310770 13 14 14Y>H 1111111
|
|
42678
|
+
//1310770 13 14 14Y>H 1111111 0
|
|
42649
42679
|
if(lineArray[i] != '') {
|
|
42650
42680
|
let fieldArray =(!bSnpOnly || bVirus) ? lineArray[i] : lineArray[i].split('\t');
|
|
42651
42681
|
let snpStr = fieldArray[3];
|
|
42682
|
+
let rsnum = fieldArray[4];
|
|
42683
|
+
let bFromClinVarDb = false;
|
|
42684
|
+
|
|
42685
|
+
if(bSnpOnly) {
|
|
42686
|
+
if(fieldArray.length > 5) bFromClinVarDb = parseInt(fieldArray[5]);
|
|
42687
|
+
}
|
|
42688
|
+
else {
|
|
42689
|
+
if(fieldArray.length > 8) bFromClinVarDb = parseInt(fieldArray[8]);
|
|
42690
|
+
}
|
|
42652
42691
|
if(snpStr == prevSnpStr) continue;
|
|
42653
42692
|
prevSnpStr = snpStr;
|
|
42654
|
-
|
|
42693
|
+
|
|
42694
|
+
let posSymbol = snpStr.indexOf('>');
|
|
42695
|
+
// let resiStr = snpStr.substr(0, snpStr.length - 3);
|
|
42696
|
+
let resiStr = snpStr.substr(0, posSymbol - 1);
|
|
42655
42697
|
let resi = Math.round(resiStr);
|
|
42656
42698
|
|
|
42699
|
+
// if the data is From ClinVar Db directly, the residue numbers are PDB residue numbers. Otherwise, the residue numbers are NCBI residue numbers.
|
|
42700
|
+
let realResi = (bFromClinVarDb) ? resi : ic.ParserUtilsCls.getResi(chnid, resi - 1);
|
|
42701
|
+
|
|
42702
|
+
let realSnp = realResi + snpStr.substr(posSymbol - 1);
|
|
42703
|
+
if(foundRealSnp.hasOwnProperty(realSnp)) {
|
|
42704
|
+
continue;
|
|
42705
|
+
}
|
|
42706
|
+
else {
|
|
42707
|
+
foundRealSnp[realSnp] = 1;
|
|
42708
|
+
}
|
|
42709
|
+
|
|
42710
|
+
let snpResn = snpStr.substr(posSymbol - 1, 1);
|
|
42711
|
+
let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chnid + '_' + realResi]);
|
|
42712
|
+
let oneLetterRes = (atom) ? me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3)) : '';
|
|
42713
|
+
if(!bFromClinVarDb) {
|
|
42714
|
+
oneLetterRes = ic.chainsSeq[chnid][resi - 1].name;
|
|
42715
|
+
}
|
|
42716
|
+
|
|
42717
|
+
if(snpResn != oneLetterRes) {
|
|
42718
|
+
// console.error("The snp " + snpStr + " didn't match the residue name " + oneLetterRes);
|
|
42719
|
+
continue;
|
|
42720
|
+
}
|
|
42721
|
+
|
|
42657
42722
|
if(me.bNode) {
|
|
42658
42723
|
let obj = {};
|
|
42659
|
-
|
|
42724
|
+
// obj[chnid + '_' + resi] = snpStr;
|
|
42725
|
+
obj[chnid + '_' + realResi] = realSnp;
|
|
42660
42726
|
|
|
42661
42727
|
if(bSnpOnly) {
|
|
42662
42728
|
ic.resid2snp[chnid].push(obj);
|
|
@@ -42666,52 +42732,53 @@ class AnnoSnpClinVar {
|
|
|
42666
42732
|
}
|
|
42667
42733
|
}
|
|
42668
42734
|
|
|
42669
|
-
|
|
42670
|
-
|
|
42735
|
+
// let currRes = snpStr.substr(snpStr.length - 3, 1);
|
|
42736
|
+
// let snpRes = snpStr.substr(snpStr.indexOf('>') + 1); //snpStr.substr(snpStr.length - 1, 1);
|
|
42737
|
+
let snpRes = realSnp.substr(realSnp.indexOf('>') + 1); //realSnp.substr(realSnp.length - 1, 1);
|
|
42671
42738
|
//var rsnum = bSnpOnly ? '' : fieldArray[4];
|
|
42672
|
-
|
|
42739
|
+
|
|
42673
42740
|
let clinAllele = bSnpOnly ? '' : fieldArray[5];
|
|
42674
42741
|
let disease = bSnpOnly ? '' : fieldArray[6]; // When more than 2+ diseases, they are separated by "; "
|
|
42675
42742
|
// Some are "not specified", "not provided"
|
|
42676
42743
|
let clinSig = bSnpOnly ? '' : fieldArray[7]; // Clinical significance, When more than 2+ diseases, they are separated by "; "
|
|
42677
42744
|
// "*" means terminating codon, "-" means deleted codon
|
|
42678
42745
|
//if(currRes !== '-' && currRes !== '*' && snpRes !== '-' && snpRes !== '*') {
|
|
42679
|
-
|
|
42746
|
+
|
|
42680
42747
|
// posHash[resi + ic.baseResi[chnid]] = 1;
|
|
42681
42748
|
// if(disease != '') posClinHash[resi + ic.baseResi[chnid]] = 1;
|
|
42682
42749
|
posHash[realResi] = 1;
|
|
42683
42750
|
if(disease != '') posClinHash[realResi] = 1;
|
|
42684
|
-
resi2index[
|
|
42685
|
-
if(resi2snp[
|
|
42686
|
-
resi2snp[
|
|
42751
|
+
resi2index[realResi] = i + 1;
|
|
42752
|
+
if(resi2snp[realResi] === undefined) {
|
|
42753
|
+
resi2snp[realResi] = [];
|
|
42687
42754
|
}
|
|
42688
|
-
resi2snp[
|
|
42689
|
-
if(resi2rsnum[
|
|
42690
|
-
resi2rsnum[
|
|
42755
|
+
resi2snp[realResi].push(snpRes);
|
|
42756
|
+
if(resi2rsnum[realResi] === undefined) {
|
|
42757
|
+
resi2rsnum[realResi] = [];
|
|
42691
42758
|
}
|
|
42692
|
-
resi2rsnum[
|
|
42693
|
-
if(resi2clinAllele[
|
|
42694
|
-
resi2clinAllele[
|
|
42759
|
+
resi2rsnum[realResi].push(rsnum);
|
|
42760
|
+
if(resi2clinAllele[realResi] === undefined) {
|
|
42761
|
+
resi2clinAllele[realResi] = [];
|
|
42695
42762
|
}
|
|
42696
|
-
resi2clinAllele[
|
|
42697
|
-
if(resi2disease[
|
|
42698
|
-
resi2disease[
|
|
42763
|
+
resi2clinAllele[realResi].push(clinAllele);
|
|
42764
|
+
if(resi2disease[realResi] === undefined) {
|
|
42765
|
+
resi2disease[realResi] = [];
|
|
42699
42766
|
}
|
|
42700
|
-
resi2disease[
|
|
42767
|
+
resi2disease[realResi].push(disease);
|
|
42701
42768
|
if(disease != '') {
|
|
42702
|
-
if(ic.resi2disease_nonempty[chnid][
|
|
42703
|
-
ic.resi2disease_nonempty[chnid][
|
|
42769
|
+
if(ic.resi2disease_nonempty[chnid][realResi] === undefined) {
|
|
42770
|
+
ic.resi2disease_nonempty[chnid][realResi] = [];
|
|
42704
42771
|
}
|
|
42705
|
-
ic.resi2disease_nonempty[chnid][
|
|
42772
|
+
ic.resi2disease_nonempty[chnid][realResi].push(disease);
|
|
42706
42773
|
}
|
|
42707
|
-
if(resi2sig[
|
|
42708
|
-
resi2sig[
|
|
42774
|
+
if(resi2sig[realResi] === undefined) {
|
|
42775
|
+
resi2sig[realResi] = [];
|
|
42709
42776
|
}
|
|
42710
|
-
resi2sig[
|
|
42777
|
+
resi2sig[realResi].push(clinSig);
|
|
42711
42778
|
//}
|
|
42712
42779
|
}
|
|
42713
42780
|
}
|
|
42714
|
-
|
|
42781
|
+
|
|
42715
42782
|
let posarray = Object.keys(posHash);
|
|
42716
42783
|
let posClinArray = Object.keys(posClinHash);
|
|
42717
42784
|
if(bSnpOnly) {
|
|
@@ -42730,7 +42797,7 @@ class AnnoSnpClinVar {
|
|
|
42730
42797
|
$("#" + ic.pre + 'ov_snp_' + chnid).html(html2);
|
|
42731
42798
|
$("#" + ic.pre + 'tt_snp_' + chnid).html(html3);
|
|
42732
42799
|
}
|
|
42733
|
-
else {
|
|
42800
|
+
else {
|
|
42734
42801
|
//if(!bSnpOnly && ic.bClinvarCnt) {
|
|
42735
42802
|
let bClinvar = true;
|
|
42736
42803
|
htmlClinvar += this.getSnpLine(1, 2, resi2snp, resi2rsnum, resi2clinAllele, resi2disease, resi2index, resi2sig, posarray, posClinArray, 1, chnid, false, bClinvar, undefined, bSnpOnly);
|
|
@@ -42763,9 +42830,12 @@ class AnnoSnpClinVar {
|
|
|
42763
42830
|
}
|
|
42764
42831
|
async showClinvarPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
|
|
42765
42832
|
let thisClass = this;
|
|
42833
|
+
|
|
42834
|
+
if(!ic.chainid2uniport) await this.getUniprotForAllStructures();
|
|
42835
|
+
|
|
42766
42836
|
//var url = "https://www.ncbi.nlm.nih.gov/projects/SNP/beVarSearch_mt.cgi?appname=iCn3D&format=bed&report=pdb2bed&acc=" + chnidBase;
|
|
42767
42837
|
//var url = "https://www.ncbi.nlm.nih.gov/Structure/icn3d/clinvar.txt";
|
|
42768
|
-
let url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase;
|
|
42838
|
+
let url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_clinvar=" + chnidBase + "&uniprot=" + ic.chainid2uniport[chnidBase];
|
|
42769
42839
|
if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
|
|
42770
42840
|
url += "&gene=" + ic.chainsGene[chnid].geneSymbol;
|
|
42771
42841
|
}
|
|
@@ -42785,15 +42855,43 @@ class AnnoSnpClinVar {
|
|
|
42785
42855
|
}
|
|
42786
42856
|
catch(err) {
|
|
42787
42857
|
thisClass.processNoClinvar(chnid);
|
|
42788
|
-
///// if(ic.deferredClinvar !== undefined) ic.deferredClinvar.resolve();
|
|
42789
42858
|
return;
|
|
42790
42859
|
}
|
|
42791
42860
|
}
|
|
42792
42861
|
|
|
42862
|
+
async getUniprotForAllStructures() { let ic = this.icn3d, me = ic.icn3dui;
|
|
42863
|
+
ic.chainid2uniport = {};
|
|
42864
|
+
|
|
42865
|
+
// get UniProt ID ffrom chainid
|
|
42866
|
+
for(let structure in ic.structures) {
|
|
42867
|
+
if(structure.length > 5) {
|
|
42868
|
+
let chainidArray = ic.structures[structure];
|
|
42869
|
+
for(let i = 0, il = chainidArray.length; i < il; ++i) {
|
|
42870
|
+
ic.chainid2uniport[chainidArray[i]] = structure;
|
|
42871
|
+
}
|
|
42872
|
+
}
|
|
42873
|
+
else {
|
|
42874
|
+
let structLower = structure.toLowerCase();
|
|
42875
|
+
let url = "https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/" + structLower;
|
|
42876
|
+
let dataJson = await me.getAjaxPromise(url, 'json');
|
|
42877
|
+
let data= dataJson[structLower]['UniProt'];
|
|
42878
|
+
for(let uniprot in data) {
|
|
42879
|
+
let chainDataArray = data[uniprot].mappings;
|
|
42880
|
+
for(let i = 0, il = chainDataArray.length; i < il; ++i) {
|
|
42881
|
+
let chain = chainDataArray[i].chain_id;
|
|
42882
|
+
ic.chainid2uniport[structure + '_' + chain] = uniprot;
|
|
42883
|
+
}
|
|
42884
|
+
}
|
|
42885
|
+
}
|
|
42886
|
+
}
|
|
42887
|
+
}
|
|
42888
|
+
|
|
42793
42889
|
async showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d, me = ic.icn3dui;
|
|
42794
42890
|
let thisClass = this;
|
|
42891
|
+
if(!ic.chainid2uniport) await this.getUniprotForAllStructures();
|
|
42892
|
+
|
|
42795
42893
|
if(gi !== undefined) {
|
|
42796
|
-
let url4 = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase;
|
|
42894
|
+
let url4 = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid_snp=" + chnidBase + "&uniprot=" + ic.chainid2uniport[chnidBase];
|
|
42797
42895
|
if(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneSymbol) {
|
|
42798
42896
|
url4 += "&gene=" + ic.chainsGene[chnid].geneSymbol;
|
|
42799
42897
|
}
|
|
@@ -50616,11 +50714,12 @@ class ShowInter {
|
|
|
50616
50714
|
let firstSetAtoms, complement;
|
|
50617
50715
|
firstSetAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray2);
|
|
50618
50716
|
complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
|
|
50619
|
-
ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
|
|
50717
|
+
// let firstAtom = ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
|
|
50620
50718
|
|
|
50621
50719
|
if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
|
|
50622
50720
|
// let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
|
|
50623
50721
|
let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
|
|
50722
|
+
|
|
50624
50723
|
let commanddesc;
|
|
50625
50724
|
if(bSaltbridge) {
|
|
50626
50725
|
ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
|
|
@@ -51058,6 +51157,7 @@ class ViewInterPairs {
|
|
|
51058
51157
|
if(!threshold || isNaN(threshold)) threshold = ic.tsHbond;
|
|
51059
51158
|
if(!bHbondCalc) {
|
|
51060
51159
|
ic.hAtoms = me.hashUtilsCls.cloneHash(prevHatoms);
|
|
51160
|
+
|
|
51061
51161
|
ic.showInterCls.showHbonds(threshold, nameArray2, nameArray, bHbondCalc, undefined, type);
|
|
51062
51162
|
}
|
|
51063
51163
|
hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.hAtoms);
|
|
@@ -63702,6 +63802,7 @@ class LoadCIF {
|
|
|
63702
63802
|
let id = (bcifid) ? bcifid : ic.defaultPdbId;
|
|
63703
63803
|
|
|
63704
63804
|
let structure = id;
|
|
63805
|
+
let CSerial, prevCSerial, OSerial, prevOSerial;
|
|
63705
63806
|
|
|
63706
63807
|
let bFirstAtom = true;
|
|
63707
63808
|
|
|
@@ -64151,19 +64252,23 @@ class LoadCIF {
|
|
|
64151
64252
|
ssend: false // optional, used to show the end of secondary structures
|
|
64152
64253
|
};
|
|
64153
64254
|
|
|
64154
|
-
if(!atomDetails.het && atomDetails.name === 'C')
|
|
64155
|
-
|
|
64255
|
+
if(!atomDetails.het && atomDetails.name === 'C') {
|
|
64256
|
+
CSerial = serial;
|
|
64257
|
+
}
|
|
64258
|
+
if(!atomDetails.het && atomDetails.name === 'O') {
|
|
64259
|
+
OSerial = serial;
|
|
64260
|
+
}
|
|
64156
64261
|
|
|
64157
64262
|
// from DSSP C++ code
|
|
64158
|
-
|
|
64159
|
-
|
|
64263
|
+
if(!atomDetails.het && atomDetails.name === 'N' && prevCSerial !== undefined && prevOSerial !== undefined) {
|
|
64264
|
+
let dist = ic.atoms[prevCSerial].coord.distanceTo(ic.atoms[prevOSerial].coord);
|
|
64160
64265
|
|
|
64161
|
-
|
|
64162
|
-
|
|
64163
|
-
|
|
64266
|
+
let x2 = atomDetails.coord.x + (ic.atoms[prevCSerial].coord.x - ic.atoms[prevOSerial].coord.x) / dist;
|
|
64267
|
+
let y2 = atomDetails.coord.y + (ic.atoms[prevCSerial].coord.y - ic.atoms[prevOSerial].coord.y) / dist;
|
|
64268
|
+
let z2 = atomDetails.coord.z + (ic.atoms[prevCSerial].coord.z - ic.atoms[prevOSerial].coord.z) / dist;
|
|
64164
64269
|
|
|
64165
|
-
|
|
64166
|
-
|
|
64270
|
+
atomDetails.hcoord = new THREE.Vector3(x2, y2, z2);
|
|
64271
|
+
}
|
|
64167
64272
|
|
|
64168
64273
|
ic.atoms[serial] = atomDetails;
|
|
64169
64274
|
|
|
@@ -64235,6 +64340,8 @@ class LoadCIF {
|
|
|
64235
64340
|
|
|
64236
64341
|
// different chain
|
|
64237
64342
|
if(chainNum !== prevChainNum) {
|
|
64343
|
+
prevCSerial = undefined;
|
|
64344
|
+
prevOSerial = undefined;
|
|
64238
64345
|
|
|
64239
64346
|
// a chain could be separated in two sections
|
|
64240
64347
|
if(serial !== 1 && prevChainNum !== '') {
|
|
@@ -64256,6 +64363,8 @@ class LoadCIF {
|
|
|
64256
64363
|
ic.chainsSeq[chainNum].push(resObject);
|
|
64257
64364
|
}
|
|
64258
64365
|
else {
|
|
64366
|
+
prevCSerial = CSerial;
|
|
64367
|
+
prevOSerial = OSerial;
|
|
64259
64368
|
|
|
64260
64369
|
let resObject = {};
|
|
64261
64370
|
resObject.resi = resi;
|
|
@@ -81992,7 +82101,7 @@ class iCn3DUI {
|
|
|
81992
82101
|
//even when multiple iCn3D viewers are shown together.
|
|
81993
82102
|
this.pre = this.cfg.divid + "_";
|
|
81994
82103
|
|
|
81995
|
-
this.REVISION = '3.
|
|
82104
|
+
this.REVISION = '3.35.0';
|
|
81996
82105
|
|
|
81997
82106
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
81998
82107
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|