icn3d 3.34.6 → 3.35.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 CHANGED
@@ -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
- if(!bVirus && ic.organism !== undefined && ic.organism !== 'human' && ic.organism !== 'homo sapiens') {
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
- for(let i = 1, il = ic.giSeq[chnid].length; i <= il; ++i) {
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] + '(' + sigArray[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 i = 1, il = ic.giSeq[chnid].length; i <= il; ++i) {
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][i-1];
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
- let pos = ic.ParserUtilsCls.getResi(chnid, i - 1);
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] + '(' + sigArray[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, i-1);
42368
- let emptyWidth = Math.round(ic.seqAnnWidth *(i-1) /(ic.maxAnnoLength + ic.nTotalGap) - prevEmptyWidth - prevLineWidth);
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;">&nbsp;</div>';
42375
42392
  html += '<div style="display:inline-block; background-color:#000; width:' + widthPerRes + 'px;" title="' + snpTitle + '">&nbsp;</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, i-1, '-');
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>&dArr;</span>'; // or down triangle &#9660;
42397
42414
  }
42398
42415
  else {
42399
- let cFull = ic.giSeq[chnid][i-1];
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, i - 1);
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] + '(' + sigArray[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 index = 0;
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(index > 0) {
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] + '(' + sigArray[k] + ')';
42532
- ++index;
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>, <a href='https://www.ncbi.nlm.nih.gov/snp/?term=" + resi2rsnum[i][j] + "' style='color:blue' target='_blank'>dbSNP(rs" + resi2rsnum[i][j] + ")</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>&dArr;</span>'; // or down triangle &#9660;
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
- html += '<span>-</span>';
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 1TSR_A 120407068 NP_000537.3
42646
- //Pdb_gi, Pos from, Pos to, Pos & Amino acid change, rs#, ClinVar Allele ID, Disease name, Clinical significance, master accession, master_gi, master_accession.version
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
- let resiStr = snpStr.substr(0, snpStr.length - 3);
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
- obj[chnid + '_' + resi] = snpStr;
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
- snpStr.substr(snpStr.length - 3, 1);
42670
- let snpRes = snpStr.substr(snpStr.indexOf('>') + 1); //snpStr.substr(snpStr.length - 1, 1);
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
- let rsnum = fieldArray[4];
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
- let realResi = ic.ParserUtilsCls.getResi(chnid, resi - 1);
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[resi] = i + 1;
42685
- if(resi2snp[resi] === undefined) {
42686
- resi2snp[resi] = [];
42751
+ resi2index[realResi] = i + 1;
42752
+ if(resi2snp[realResi] === undefined) {
42753
+ resi2snp[realResi] = [];
42687
42754
  }
42688
- resi2snp[resi].push(snpRes);
42689
- if(resi2rsnum[resi] === undefined) {
42690
- resi2rsnum[resi] = [];
42755
+ resi2snp[realResi].push(snpRes);
42756
+ if(resi2rsnum[realResi] === undefined) {
42757
+ resi2rsnum[realResi] = [];
42691
42758
  }
42692
- resi2rsnum[resi].push(rsnum);
42693
- if(resi2clinAllele[resi] === undefined) {
42694
- resi2clinAllele[resi] = [];
42759
+ resi2rsnum[realResi].push(rsnum);
42760
+ if(resi2clinAllele[realResi] === undefined) {
42761
+ resi2clinAllele[realResi] = [];
42695
42762
  }
42696
- resi2clinAllele[resi].push(clinAllele);
42697
- if(resi2disease[resi] === undefined) {
42698
- resi2disease[resi] = [];
42763
+ resi2clinAllele[realResi].push(clinAllele);
42764
+ if(resi2disease[realResi] === undefined) {
42765
+ resi2disease[realResi] = [];
42699
42766
  }
42700
- resi2disease[resi].push(disease);
42767
+ resi2disease[realResi].push(disease);
42701
42768
  if(disease != '') {
42702
- if(ic.resi2disease_nonempty[chnid][resi] === undefined) {
42703
- ic.resi2disease_nonempty[chnid][resi] = [];
42769
+ if(ic.resi2disease_nonempty[chnid][realResi] === undefined) {
42770
+ ic.resi2disease_nonempty[chnid][realResi] = [];
42704
42771
  }
42705
- ic.resi2disease_nonempty[chnid][resi].push(disease);
42772
+ ic.resi2disease_nonempty[chnid][realResi].push(disease);
42706
42773
  }
42707
- if(resi2sig[resi] === undefined) {
42708
- resi2sig[resi] = [];
42774
+ if(resi2sig[realResi] === undefined) {
42775
+ resi2sig[realResi] = [];
42709
42776
  }
42710
- resi2sig[resi].push(clinSig);
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
  }
@@ -81992,7 +82090,7 @@ class iCn3DUI {
81992
82090
  //even when multiple iCn3D viewers are shown together.
81993
82091
  this.pre = this.cfg.divid + "_";
81994
82092
 
81995
- this.REVISION = '3.34.1';
82093
+ this.REVISION = '3.35.0';
81996
82094
 
81997
82095
  // In nodejs, iCn3D defines "window = {navigator: {}}"
81998
82096
  this.bNode = (Object.keys(window).length < 2) ? true : false;