icn3d 3.12.7 → 3.12.8

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
@@ -13410,15 +13410,7 @@ class DefinedSets {
13410
13410
  dAtoms = me.hashUtilsCls.unionHash(dAtoms, ic.alnChains[alignChain]);
13411
13411
  }
13412
13412
 
13413
- let residuesHash = {}, chains = {};
13414
- for(let i in dAtoms) {
13415
- let atom = ic.atoms[i];
13416
-
13417
- let chainid = atom.structure + '_' + atom.chain;
13418
- let resid = chainid + '_' + atom.resi;
13419
- residuesHash[resid] = 1;
13420
- chains[chainid] = 1;
13421
- }
13413
+ let residuesHash = ic.firstAtomObjCls.getResiduesFromAtoms(dAtoms);
13422
13414
 
13423
13415
  let commandname = 'protein_aligned';
13424
13416
  let commanddescr = 'aligned protein and nucleotides';
@@ -22638,8 +22630,11 @@ class Dssp {
22638
22630
  thisClass.parseDsspData(dataArray, struArray, bAppend);
22639
22631
  })
22640
22632
  .fail(function() {
22633
+ console.log("DSSP calculation had a problem with this structure " + struArray[0] + "...");
22634
+
22641
22635
  ic.pdbParserCls.loadPdbDataRender(bAppend);
22642
22636
 
22637
+ if(ic.deferredMmdbaf !== undefined) ic.deferredMmdbaf.resolve();
22643
22638
  if(ic.deferredSecondary !== undefined) ic.deferredSecondary.resolve();
22644
22639
  });
22645
22640
  }
@@ -22873,6 +22868,9 @@ class PdbParser {
22873
22868
  thisClass.loadPdbData(data);
22874
22869
  ic.loadScriptCls.loadScript(command);
22875
22870
  }
22871
+ else if(type === 'mmcif') {
22872
+ ic.mmcifParserCls.parseMmcifData(data, undefined, command);
22873
+ }
22876
22874
  else if(type === 'mol2') {
22877
22875
  ic.mol2ParserCls.loadMol2Data(data);
22878
22876
  }
@@ -24478,6 +24476,8 @@ class RealignParser {
24478
24476
 
24479
24477
  ic.selectionCls.saveSelection(name, name);
24480
24478
 
24479
+ me.htmlCls.clickMenuCls.setLogCmd("realign", true);
24480
+
24481
24481
  let structHash = {}, struct2chain = {};
24482
24482
  ic.realignResid = {};
24483
24483
  let lastStruResi = '';
@@ -24588,7 +24588,7 @@ class RealignParser {
24588
24588
 
24589
24589
  // align seq
24590
24590
  ic.hAtoms = ic.chainalignParserCls.setMsa(chainidArray);
24591
-
24591
+
24592
24592
  ic.transformCls.zoominSelection();
24593
24593
 
24594
24594
  ic.chainalignParserCls.downloadChainalignmentPart3(undefined, chainidArray, ic.hAtoms);
@@ -24892,6 +24892,8 @@ class RealignParser {
24892
24892
  base_t = base;
24893
24893
  }
24894
24894
  else {
24895
+ let hAtoms = {};
24896
+
24895
24897
  predefinedResPair = predefinedResArray[i - 1].split(' | ');
24896
24898
 
24897
24899
  let chainidpair = chainid_t + ',' + chainid;
@@ -24903,6 +24905,8 @@ class RealignParser {
24903
24905
  resiArray = predefinedResPair[0].split(",");
24904
24906
  result = thisClass.getSeqCoorResid(resiArray, chainid_t, base_t);
24905
24907
 
24908
+ hAtoms = me.hashUtilsCls.unionHash(hAtoms, result.hAtoms);
24909
+
24906
24910
  if(!struct2SeqHash[chainidpair][mmdbid_t]) struct2SeqHash[chainidpair][mmdbid_t] = '';
24907
24911
  if(!struct2CoorHash[chainidpair][mmdbid_t]) struct2CoorHash[chainidpair][mmdbid_t] = [];
24908
24912
  if(!struct2resid[chainidpair][mmdbid_t]) struct2resid[chainidpair][mmdbid_t] = [];
@@ -24914,6 +24918,7 @@ class RealignParser {
24914
24918
  // slave
24915
24919
  resiArray = predefinedResPair[1].split(",");
24916
24920
  result = thisClass.getSeqCoorResid(resiArray, chainid, base);
24921
+ hAtoms = me.hashUtilsCls.unionHash(hAtoms, result.hAtoms);
24917
24922
 
24918
24923
  if(!struct2SeqHash[chainidpair][mmdbid]) struct2SeqHash[chainidpair][mmdbid] = '';
24919
24924
  if(!struct2CoorHash[chainidpair][mmdbid]) struct2CoorHash[chainidpair][mmdbid] = [];
@@ -24922,6 +24927,18 @@ class RealignParser {
24922
24927
  struct2SeqHash[chainidpair][mmdbid] += result.seq;
24923
24928
  struct2CoorHash[chainidpair][mmdbid] = struct2CoorHash[chainidpair][mmdbid].concat(result.coor);
24924
24929
  struct2resid[chainidpair][mmdbid] = struct2resid[chainidpair][mmdbid].concat(result.resid);
24930
+
24931
+ // let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(hAtoms);
24932
+ // let residueArray = Object.keys(residueHash);
24933
+
24934
+ // let commandname = chainidpair;
24935
+ // let commanddescr = 'aligned ' + chainidpair;
24936
+ // let select = "select " + ic.resid2specCls.residueids2spec(residueArray);
24937
+
24938
+ // ic.selectionCls.addCustomSelection(residueArray, commandname, commanddescr, select, true);
24939
+
24940
+ // me.htmlCls.clickMenuCls.setLogCmd(select + " | name " + commandname, true);
24941
+ // me.htmlCls.clickMenuCls.setLogCmd("realign", true);
24925
24942
  }
24926
24943
  }
24927
24944
  else {
@@ -25021,6 +25038,7 @@ class RealignParser {
25021
25038
 
25022
25039
  getSeqCoorResid(resiArray, chainid, base) { let ic = this.icn3d, me = ic.icn3dui;
25023
25040
  let seq = '', coorArray = [], residArray = [];
25041
+ let hAtoms = {};
25024
25042
 
25025
25043
  for(let j = 0, jl = resiArray.length; j < jl; ++j) {
25026
25044
  if(resiArray[j].indexOf('-') != -1) {
@@ -25070,7 +25088,11 @@ class RealignParser {
25070
25088
  }
25071
25089
  }
25072
25090
 
25073
- return {seq: seq, coor: coorArray, resid: residArray};
25091
+ for(let i = 0, il = residArray.length; i < il; ++i) {
25092
+ hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.residues[residArray[i]]);
25093
+ }
25094
+
25095
+ return {seq: seq, coor: coorArray, resid: residArray, hAtoms: hAtoms};
25074
25096
  }
25075
25097
 
25076
25098
  getResCoorArray(resid) { let ic = this.icn3d; ic.icn3dui;
@@ -25510,17 +25532,12 @@ class ChainalignParser {
25510
25532
  //ic.hAtoms = hAtoms;
25511
25533
  ic.hAtoms = me.hashUtilsCls.cloneHash(hAtoms);
25512
25534
  ic.dAtoms = me.hashUtilsCls.cloneHash(hAtoms);
25513
-
25535
+
25514
25536
  ic.ParserUtilsCls.renderStructure();
25515
25537
 
25516
25538
  //if(ic.chainidArray.length > 2) {
25517
25539
  if(chainidArray.length > 2) {
25518
- let residuesHash = {};
25519
- for(let i in hAtoms) {
25520
- let atom = ic.atoms[i];
25521
- let resid = atom.structure + '_' + atom.chain + '_' + atom.resi;
25522
- residuesHash[resid] = 1;
25523
- }
25540
+ let residuesHash = ic.firstAtomObjCls.getResiduesFromAtoms(hAtoms);
25524
25541
 
25525
25542
  let commandname = 'protein_aligned';
25526
25543
  let commanddescr = 'protein aligned';
@@ -25556,18 +25573,10 @@ class ChainalignParser {
25556
25573
  //if(me.deferred !== undefined) me.deferred.resolve(); if(ic.deferred2 !== undefined) ic.deferred2.resolve();
25557
25574
  }
25558
25575
 
25559
- downloadChainalignment(chainalign, resnum, resdef) { let ic = this.icn3d, me = ic.icn3dui;
25560
- let thisClass = this;
25561
-
25562
- ic.opts['proteins'] = 'c alpha trace';
25563
-
25564
- let alignArray = chainalign.split(',');
25565
- let domainArray = (me.cfg.domainids) ? me.cfg.domainids.split(',') : [];
25566
- if(domainArray.length < alignArray.length) domainArray = [];
25567
-
25576
+ addPostfixForChainids(chainidArray) { let ic = this.icn3d; ic.icn3dui;
25568
25577
  let struct2cnt = {};
25569
- for(let i = 0, il = alignArray.length; i < il; ++i) {
25570
- let chainid = alignArray[i];
25578
+ for(let i = 0, il = chainidArray.length; i < il; ++i) {
25579
+ let chainid = chainidArray[i];
25571
25580
  let pos = chainid.indexOf('_');
25572
25581
  let struct = chainid.substr(0, pos).toUpperCase();
25573
25582
  if(!struct2cnt.hasOwnProperty(struct)) {
@@ -25579,10 +25588,22 @@ class ChainalignParser {
25579
25588
 
25580
25589
  struct = (struct2cnt[struct] == 1) ? struct : struct + struct2cnt[struct];
25581
25590
 
25582
- alignArray[i] = struct + chainid.substr(pos);
25591
+ chainidArray[i] = struct + chainid.substr(pos);
25583
25592
  }
25584
25593
 
25585
- ic.chainidArray = alignArray;
25594
+ return chainidArray;
25595
+ }
25596
+
25597
+ downloadChainalignment(chainalign, resnum, resdef) { let ic = this.icn3d, me = ic.icn3dui;
25598
+ let thisClass = this;
25599
+
25600
+ ic.opts['proteins'] = 'c alpha trace';
25601
+
25602
+ let alignArray = chainalign.split(',');
25603
+ let domainArray = (me.cfg.domainids) ? me.cfg.domainids.split(',') : [];
25604
+ if(domainArray.length < alignArray.length) domainArray = [];
25605
+
25606
+ ic.chainidArray = this.addPostfixForChainids(alignArray);
25586
25607
 
25587
25608
  let pos1 = alignArray[0].indexOf('_');
25588
25609
  ic.mmdbid_t = alignArray[0].substr(0, pos1).toUpperCase();
@@ -26010,11 +26031,10 @@ class ChainalignParser {
26010
26031
  }
26011
26032
 
26012
26033
  // calculate secondary structures with applyCommandDssp
26013
- if(bQuery && me.cfg.masterchain) {
26034
+ if(bQuery && me.cfg.matchedchains) {
26014
26035
  $.when(ic.pdbParserCls.applyCommandDssp(true)).then(function() {
26015
26036
  let bRealign = true, bPredefined = true;
26016
26037
  ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
26017
-
26018
26038
  // reset annotations
26019
26039
  $("#" + ic.pre + "dl_annotations").html("");
26020
26040
  ic.bAnnoShown = false;
@@ -27992,6 +28012,21 @@ class LoadScript {
27992
28012
 
27993
28013
  ic.chainalignParserCls.downloadMmdbAf(id);
27994
28014
  }
28015
+ /*
28016
+ else if(command.indexOf('load vastsearch') !== -1) {
28017
+ let idArray = loadStr.split(' || ');
28018
+ let mmdbafid = idArray[1].substr(idArray[1].indexOf(' ') + 1);
28019
+ ic.chainidArray = idArray[2].substr(idArray[2].indexOf(' ') + 1);
28020
+ me.cfg.matchedchains = ic.chainidArray;
28021
+
28022
+ // load multiple PDBs
28023
+ ic.bNCBI = true;
28024
+ ic.bMmdbafid = true;
28025
+
28026
+ let bQuery = true;
28027
+ ic.chainalignParserCls.downloadMmdbAf(mmdbafid, bQuery);
28028
+ }
28029
+ */
27995
28030
  else if(command.indexOf('load gi') !== -1) {
27996
28031
  me.cfg.gi = id;
27997
28032
  ic.mmdbParserCls.downloadGi(id);
@@ -29820,6 +29855,7 @@ class ShowSeq {
29820
29855
  html3 += '<div class="icn3d-dl_sequence">';
29821
29856
  // html to display protein positions(10, 20, etc)
29822
29857
  //if(Object.keys(ic.chains[chnid]).length > 10) {
29858
+
29823
29859
  if(ic.giSeq[chnid].length > 10) {
29824
29860
  htmlTmp = '<div class="icn3d-residueLine" style="white-space:nowrap;">';
29825
29861
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.chains[chnid]);
@@ -30195,6 +30231,56 @@ class ShowSeq {
30195
30231
  html += '</div>';
30196
30232
  html3 += '</div></div>';
30197
30233
  }
30234
+ /*
30235
+ else if(chnid == '4YHY_B') {
30236
+ // test reference num
30237
+ let resid2refnum = {};
30238
+
30239
+ let refData = {6: 'A1050', 22: 'B2050', 36: 'C3050', 48: 'C`3250', 61: 'C``3750', 70: 'D4050', 81: 'E5050', 96: 'F6050', 112: 'G7050'};
30240
+
30241
+ //ic.chainsMapping[chnid][chnid + '_' + resObject2.resi] = resObject1.resn + resObject1.resi;
30242
+ for(let resi in refData) {
30243
+ let resid = chnid + '_' + resi;
30244
+ resid2refnum[resid] = refData[resi];
30245
+ }
30246
+
30247
+
30248
+ htmlTmp = '<div class="icn3d-dl_sequence">';
30249
+ htmlTmp += '<div class="icn3d-residueLine" style="white-space:nowrap;">';
30250
+ htmlTmp += '<div class="icn3d-annoTitle" anno="0" title="Ig Reference Numbers">Ig Reference Numbers</div>';
30251
+ htmlTmp += '<span class="icn3d-residueNum"></span>';
30252
+ html3 += htmlTmp + '<br>';
30253
+ html += htmlTmp + '<span class="icn3d-seqLine">';
30254
+ for(let i = 0, il = giSeq.length; i < il; ++i) {
30255
+ html += this.insertGap(chnid, i, '-');
30256
+ if(i >= ic.matchedPos[chnid] && i - ic.matchedPos[chnid] < ic.chainsSeq[chnid].length) {
30257
+ let currResi = ic.chainsSeq[chnid][i - ic.matchedPos[chnid]].resi;
30258
+ let residueid = chnid + '_' + currResi;
30259
+ if(!ic.residues.hasOwnProperty(residueid)) {
30260
+ html += '<span></span>';
30261
+ }
30262
+ else {
30263
+ let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residueid]);
30264
+ let resi_ori = atom.resi_ori;
30265
+ html += '<span>';
30266
+ if( resid2refnum.hasOwnProperty(residueid)) {
30267
+ html += resid2refnum[residueid] + ' ';
30268
+ }
30269
+ html += '</span>';
30270
+ }
30271
+ }
30272
+ else {
30273
+ html += '<span></span>';
30274
+ }
30275
+ }
30276
+ html += '<span class="icn3d-residueNum"></span>';
30277
+ html += '</span>';
30278
+ html += '<br>';
30279
+ html += '</div>';
30280
+ html += '</div>';
30281
+ html3 += '</div></div>';
30282
+ }
30283
+ */
30198
30284
  }
30199
30285
  $("#" + ic.pre + 'dt_giseq_' + chnid).html(html);
30200
30286
  $("#" + ic.pre + 'ov_giseq_' + chnid).html(html2);
@@ -30320,12 +30406,24 @@ class AddTrack {
30320
30406
  //var title = 'fasta ' + fasta.substr(0, 5);
30321
30407
  let title = $("#" + ic.pre + "fasta_title").val();
30322
30408
 
30409
+ let structure = chainid.substr(0, chainid.indexOf('_'));
30410
+ let targets = chainid;
30411
+ if(structure.length == 5) { // e.g., 1TUP2
30412
+ targets = targets.substr(0,4);
30413
+ }
30414
+ else if(structure.length > 5) { // AlphaFold UniProt
30415
+ targets = '';
30416
+ for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
30417
+ targets += ic.chainsSeq[chainid][i].name;
30418
+ }
30419
+ }
30420
+
30323
30421
  //var text = $("#" + ic.pre + "track_text").val();
30324
30422
  let url = 'https://www.ncbi.nlm.nih.gov/Structure/pwaln/pwaln.fcgi?from=track';
30325
30423
  $.ajax({
30326
30424
  url: url,
30327
30425
  type: 'POST',
30328
- data : {'targets': chainid, 'queries': fasta},
30426
+ data : {'targets': targets, 'queries': fasta},
30329
30427
  dataType: 'jsonp',
30330
30428
  //dataType: 'json',
30331
30429
  tryCount : 0,
@@ -30911,12 +31009,14 @@ class AddTrack {
30911
31009
  }
30912
31010
 
30913
31011
  alignSequenceToStructure(chainid, data, title) { let ic = this.icn3d, me = ic.icn3dui;
30914
- let query, target;
31012
+ let query, target, firstKey;
30915
31013
 
30916
31014
  if(data.data !== undefined) {
30917
31015
  query = data.data[0].query;
30918
31016
  //target = data.data[0].targets[chainid.replace(/_/g, '')];
30919
- target = data.data[0].targets[chainid];
31017
+ //target = data.data[0].targets[chainid];
31018
+ firstKey = Object.keys(data.data[0].targets)[0];
31019
+ target = data.data[0].targets[firstKey];
30920
31020
 
30921
31021
  target = target.hsps[0];
30922
31022
  }
@@ -30932,7 +31032,8 @@ class AddTrack {
30932
31032
  target.scores.bit_score;
30933
31033
 
30934
31034
  //var targetSeq = data.targets[chainid.replace(/_/g, '')].seqdata;
30935
- let targetSeq = data.targets[chainid].seqdata;
31035
+ //let targetSeq = data.targets[chainid].seqdata;
31036
+ let targetSeq = data.targets[firstKey].seqdata;
30936
31037
  let querySeq = query.seqdata;
30937
31038
 
30938
31039
  let segArray = target.segs;
@@ -31663,6 +31764,10 @@ class AnnoCddSite {
31663
31764
 
31664
31765
  let chainWithData = {};
31665
31766
 
31767
+ if(me.bNode) {
31768
+ if(!ic.resid2cdd) ic.resid2cdd = {};
31769
+ if(!ic.resid2site) ic.resid2site = {};
31770
+ }
31666
31771
  for(let i = 0, il = dataArray.length; i < il; ++i) {
31667
31772
  let data = (bSeq) ? dataArray[i][0] : dataArray[i];
31668
31773
 
@@ -31678,6 +31783,7 @@ class AnnoCddSite {
31678
31783
  let html2 = html;
31679
31784
  let html3 = html;
31680
31785
  let domainArray = cddData.doms;
31786
+ if(me.bNode && !ic.resid2cdd[chnid]) ic.resid2cdd[chnid] = [];
31681
31787
  let result = thisClass.setDomainFeature(domainArray, chnid, true, html, html2, html3);
31682
31788
 
31683
31789
  ic.chainid2pssmid[chnid] = {pssmid2name: result.pssmid2name, pssmid2fromArray: result.pssmid2fromArray, pssmid2toArray: result.pssmid2toArray};
@@ -31696,6 +31802,7 @@ class AnnoCddSite {
31696
31802
 
31697
31803
  // features
31698
31804
  let featuteArray = cddData.motifs;
31805
+ if(me.bNode && !ic.resid2site[chnid]) ic.resid2site[chnid] = [];
31699
31806
  result = thisClass.setDomainFeature(featuteArray, chnid, false, html, html2, html3, acc2domain);
31700
31807
 
31701
31808
  html = result.html; // + '</div>';
@@ -31760,6 +31867,12 @@ class AnnoCddSite {
31760
31867
  let pos = thisClass.getAdjustedResi(i, chnid, ic.matchedPos, ic.chainsSeq, ic.baseResi);
31761
31868
 
31762
31869
  html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" title="' + c + pos + '" class="icn3d-residue">' + cFull + '</span>';
31870
+ if(me.bNode) {
31871
+ let obj = {};
31872
+ obj[chnid + '_' + pos] = 'site: ' + siteArray[index].title;
31873
+ ic.resid2site[chnid].push(obj);
31874
+ }
31875
+
31763
31876
  html2 += ic.showSeqCls.insertGapOverview(chnid, i);
31764
31877
  let emptyWidth =(me.cfg.blast_rep_id == chnid) ? Math.round(ic.seqAnnWidth * i /(ic.maxAnnoLength + ic.nTotalGap) - prevEmptyWidth - prevLineWidth) : Math.round(ic.seqAnnWidth * i / ic.maxAnnoLength - prevEmptyWidth - prevLineWidth);
31765
31878
  //if(emptyWidth < 0) emptyWidth = 0;
@@ -31933,6 +32046,16 @@ class AnnoCddSite {
31933
32046
  //var pos =(i >= ic.matchedPos[chnid] && i - ic.matchedPos[chnid] < ic.chainsSeq[chnid].length) ? ic.chainsSeq[chnid][i - ic.matchedPos[chnid]].resi : ic.baseResi[chnid] + 1 + i;
31934
32047
  let pos = thisClass.getAdjustedResi(i, chnid, ic.matchedPos, ic.chainsSeq, ic.baseResi);
31935
32048
  html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" title="' + c + pos + '" class="icn3d-residue">' + cFull + '</span>';
32049
+ if(me.bNode) {
32050
+ let obj = {};
32051
+ obj[chnid + '_' + pos] = fulltitle;
32052
+ if(bDomain) {
32053
+ ic.resid2cdd[chnid].push(obj);
32054
+ }
32055
+ else {
32056
+ ic.resid2site[chnid].push(obj);
32057
+ }
32058
+ }
31936
32059
  }
31937
32060
  else {
31938
32061
  html += '<span>-</span>'; //'<span>-</span>';
@@ -32029,29 +32152,56 @@ class AnnoCddSite {
32029
32152
  let title = cFull +(i+1 + ic.baseResi[chnid]).toString();
32030
32153
  if(type == 'ssbond') {
32031
32154
  title = 'Residue ' + resid + ' has disulfide bond with';
32155
+ let sstitle = '';
32032
32156
  if(resid2resids[resid] !== undefined) {
32033
32157
  for(let j = 0, jl = resid2resids[resid].length; j < jl; ++j) {
32034
- title += ' residue ' + resid2resids[resid][j];
32158
+ sstitle += ' residue ' + resid2resids[resid][j];
32035
32159
  }
32036
32160
  }
32161
+ title += sstitle;
32162
+
32163
+ if(me.bNode) {
32164
+ let obj = {};
32165
+ obj[resid] = 'disulfide bond with' + sstitle;
32166
+ ic.resid2ssbond[chnid].push(obj);
32167
+ }
32037
32168
  }
32038
32169
  else if(type == 'crosslink') {
32039
32170
  title = 'Residue ' + resid + ' has cross-linkage with';
32171
+ let cltitle = '';
32040
32172
  if(resid2resids[resid] !== undefined) {
32041
32173
  for(let j = 0, jl = resid2resids[resid].length; j < jl; ++j) {
32042
- title += ' residue ' + resid2resids[resid][j];
32174
+ cltitle += ' residue ' + resid2resids[resid][j];
32043
32175
  }
32044
32176
  }
32177
+ title += cltitle;
32178
+
32179
+ if(me.bNode) {
32180
+ let obj = {};
32181
+ obj[resid] = 'cross-linkage with' + cltitle;
32182
+ ic.resid2crosslink[chnid].push(obj);
32183
+ }
32184
+ }
32185
+ else {
32186
+ title = 'Residue ' + resid + ' has connection with';
32187
+ let cltitle = '';
32188
+ if(resid2resids[resid] !== undefined) {
32189
+ for(let j = 0, jl = resid2resids[resid].length; j < jl; ++j) {
32190
+ cltitle += ' residue ' + resid2resids[resid][j];
32191
+ }
32192
+ }
32193
+ title += cltitle;
32045
32194
  }
32195
+
32046
32196
  html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" title="' + title + '" class="icn3d-residue">' + c + '</span>';
32047
32197
  html2 += ic.showSeqCls.insertGapOverview(chnid, i);
32048
32198
  let emptyWidth =(me.cfg.blast_rep_id == chnid) ? Math.round(ic.seqAnnWidth * i /(ic.maxAnnoLength + ic.nTotalGap) - prevEmptyWidth - prevLineWidth) : Math.round(ic.seqAnnWidth * i / ic.maxAnnoLength - prevEmptyWidth - prevLineWidth);
32049
32199
  //if(emptyWidth < 0) emptyWidth = 0;
32050
32200
  if(emptyWidth >= 0) {
32051
- html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
32052
- html2 += '<div style="display:inline-block; background-color:#000; width:' + widthPerRes + 'px;" title="' + title + '">&nbsp;</div>';
32053
- prevEmptyWidth += emptyWidth;
32054
- prevLineWidth += widthPerRes;
32201
+ html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
32202
+ html2 += '<div style="display:inline-block; background-color:#000; width:' + widthPerRes + 'px;" title="' + title + '">&nbsp;</div>';
32203
+ prevEmptyWidth += emptyWidth;
32204
+ prevLineWidth += widthPerRes;
32055
32205
  }
32056
32206
  }
32057
32207
  else {
@@ -32117,7 +32267,12 @@ class AnnoSsbond {
32117
32267
  this.showSsbond_base(chnid, chnidBase);
32118
32268
  }
32119
32269
  }
32120
- showSsbond_base(chnid, chnidBase) { let ic = this.icn3d; ic.icn3dui;
32270
+ showSsbond_base(chnid, chnidBase) { let ic = this.icn3d, me = ic.icn3dui;
32271
+ if(me.bNode) {
32272
+ if(!ic.resid2ssbond) ic.resid2ssbond = {};
32273
+ if(!ic.resid2ssbond[chnid]) ic.resid2ssbond[chnid] = [];
32274
+ }
32275
+
32121
32276
  let chainid = chnidBase;
32122
32277
  let resid2resids = {};
32123
32278
  let structure = chainid.substr(0, chainid.indexOf('_'));
@@ -33138,12 +33293,11 @@ class ApplyCommand {
33138
33293
  let bPosition = false;
33139
33294
  for(let i = 1, il = paraArray.length; i < il; ++i) {
33140
33295
  let wordArray = paraArray[i].split(' ');
33141
-
33142
33296
  if(wordArray[0] == 'x') {
33143
33297
  bPosition = true;
33144
- x = wordArray[1];
33145
- y = wordArray[3];
33146
- z = wordArray[5];
33298
+ x = parseFloat(wordArray[1]);
33299
+ y = parseFloat(wordArray[3]);
33300
+ z = parseFloat(wordArray[5]);
33147
33301
  }
33148
33302
  else if(wordArray[0] == 'size') {
33149
33303
  size = paraArray[i].substr(paraArray[i].lastIndexOf(' ') + 1);
@@ -33161,9 +33315,9 @@ class ApplyCommand {
33161
33315
 
33162
33316
  if(!bPosition) {
33163
33317
  let position = ic.applyCenterCls.centerAtoms(me.hashUtilsCls.hash2Atoms(ic.hAtoms, ic.atoms));
33164
- x = position.center.x;
33165
- y = position.center.y;
33166
- z = position.center.z;
33318
+ x = parseFloat(position.center.x);
33319
+ y = parseFloat(position.center.y);
33320
+ z = parseFloat(position.center.z);
33167
33321
  }
33168
33322
 
33169
33323
  ic.analysisCls.addLabel(text, x,y,z, size, color, background, type);
@@ -33634,7 +33788,23 @@ class ApplyCommand {
33634
33788
  let id = command.substr(command.lastIndexOf(' ') + 1);
33635
33789
  me.htmlCls.eventsCls.saveHtml(id);
33636
33790
  }
33637
-
33791
+ else if(command.indexOf('resdef') == 0) {
33792
+ me.cfg.resdef = command.substr(command.indexOf(' ') + 1);
33793
+ }
33794
+ else if(command.indexOf('vast_search_chainid') == 0) {
33795
+ ic.chainidArray = commandOri.substr(commandOri.indexOf(' ') + 1).split(',');
33796
+
33797
+ let bRealign = true, bPredefined = true;
33798
+ ic.realignParserCls.realignChainOnSeqAlign(undefined, ic.chainidArray, bRealign, bPredefined);
33799
+
33800
+ // reset annotations
33801
+ // $("#" + ic.pre + "dl_annotations").html("");
33802
+ // ic.bAnnoShown = false;
33803
+ // if($('#' + ic.pre + 'dl_selectannotations').dialog( 'isOpen' )) {
33804
+ // $('#' + ic.pre + 'dl_selectannotations').dialog( 'close' );
33805
+ // }
33806
+ }
33807
+
33638
33808
  // special, select ==========
33639
33809
 
33640
33810
  else if(command.indexOf('select displayed set') !== -1) {
@@ -34049,9 +34219,8 @@ class SelectByCommand {
34049
34219
  }
34050
34220
  }
34051
34221
 
34052
- selectBySpec(select, commandname, commanddesc, bDisplay) { let ic = this.icn3d, me = ic.icn3dui;
34222
+ selectBySpec(select, commandname, commanddesc, bDisplay, bNoUpdateAll) { let ic = this.icn3d, me = ic.icn3dui;
34053
34223
  select =(select.trim().substr(0, 6) === 'select') ? select.trim().substr(7) : select.trim();
34054
-
34055
34224
  ic.hAtoms = {};
34056
34225
 
34057
34226
  // selection definition is similar to Chimera: https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/frameatom_spec.html
@@ -34365,8 +34534,8 @@ class SelectByCommand {
34365
34534
  if(commandname != "") {
34366
34535
  ic.selectionCls.addCustomSelection(residueAtomArray, commandname, commanddesc, select, bSelectResidues);
34367
34536
 
34368
- let nameArray = [commandname];
34369
- ic.definedSetsCls.changeCustomAtoms(nameArray);
34537
+ let nameArray = [commandname];
34538
+ if(!bNoUpdateAll) ic.definedSetsCls.changeCustomAtoms(nameArray);
34370
34539
  }
34371
34540
  }
34372
34541
  }
@@ -36099,7 +36268,7 @@ class ParserUtils {
36099
36268
  resi2pos_q[resi] = i + 1;
36100
36269
  }
36101
36270
 
36102
- for(let i = 0, il = ic.realignResid[struct_t].length; i < il; ++i) {
36271
+ for(let i = 0, il = ic.realignResid[struct_t].length; i < il && i < ic.realignResid[struct_q].length; ++i) {
36103
36272
  let resid_t = ic.realignResid[struct_t][i].resid;
36104
36273
  let pos_t = resid_t.lastIndexOf('_');
36105
36274
  let resi_t = parseInt(resid_t.substr(pos_t + 1));
@@ -36700,7 +36869,7 @@ class MmcifParser {
36700
36869
 
36701
36870
  //Ajax call was used to get the atom data from the "mmcifid". This function was deferred
36702
36871
  //so that it can be chained together with other deferred functions for sequential execution.
36703
- downloadMmcif(mmcifid) { let ic = this.icn3d, me = ic.icn3dui;
36872
+ downloadMmcif(mmcifid) { let ic = this.icn3d; ic.icn3dui;
36704
36873
  let thisClass = this;
36705
36874
 
36706
36875
  let url, dataType;
@@ -36726,34 +36895,7 @@ class MmcifParser {
36726
36895
  //ic.ParserUtilsCls.hideLoading();
36727
36896
  },
36728
36897
  success: function(data) {
36729
- url = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi";
36730
- $.ajax({
36731
- url: url,
36732
- type: 'POST',
36733
- data : {'mmciffile': data},
36734
- dataType: 'jsonp',
36735
- cache: true,
36736
- tryCount : 0,
36737
- retryLimit : 0, //1
36738
- beforeSend: function() {
36739
- ic.ParserUtilsCls.showLoading();
36740
- },
36741
- complete: function() {
36742
- //ic.ParserUtilsCls.hideLoading();
36743
- },
36744
- success: function(data) {
36745
- thisClass.loadMmcifData(data, mmcifid);
36746
- },
36747
- error : function(xhr, textStatus, errorThrown ) {
36748
- this.tryCount++;
36749
- if(this.tryCount <= this.retryLimit) {
36750
- //try again
36751
- $.ajax(this);
36752
- return;
36753
- }
36754
- return;
36755
- }
36756
- });
36898
+ thisClass.parseMmcifData(data, mmcifid);
36757
36899
  },
36758
36900
  error : function(xhr, textStatus, errorThrown ) {
36759
36901
  this.tryCount++;
@@ -36767,6 +36909,40 @@ class MmcifParser {
36767
36909
  });
36768
36910
  }
36769
36911
 
36912
+ parseMmcifData(data, mmcifid, command) { let ic = this.icn3d, me = ic.icn3dui;
36913
+ let thisClass = this;
36914
+
36915
+ let url = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi";
36916
+ $.ajax({
36917
+ url: url,
36918
+ type: 'POST',
36919
+ data : {'mmciffile': data},
36920
+ dataType: 'jsonp',
36921
+ cache: true,
36922
+ tryCount : 0,
36923
+ retryLimit : 0, //1
36924
+ beforeSend: function() {
36925
+ ic.ParserUtilsCls.showLoading();
36926
+ },
36927
+ complete: function() {
36928
+ //ic.ParserUtilsCls.hideLoading();
36929
+ },
36930
+ success: function(data) {
36931
+ thisClass.loadMmcifData(data, mmcifid);
36932
+ if(command) ic.loadScriptCls.loadScript(command);
36933
+ },
36934
+ error : function(xhr, textStatus, errorThrown ) {
36935
+ this.tryCount++;
36936
+ if(this.tryCount <= this.retryLimit) {
36937
+ //try again
36938
+ $.ajax(this);
36939
+ return;
36940
+ }
36941
+ return;
36942
+ }
36943
+ });
36944
+ }
36945
+
36770
36946
  downloadMmcifSymmetry(mmcifid, type) { let ic = this.icn3d; ic.icn3dui;
36771
36947
  let thisClass = this;
36772
36948
 
@@ -37309,6 +37485,7 @@ class HlSeq {
37309
37485
 
37310
37486
  if($(that).hasClass('icn3d-seqTitle')) {
37311
37487
  let chainid = $(that).attr('chain');
37488
+ let resn = $(that).attr('resn');
37312
37489
 
37313
37490
  if(ic.bAlignSeq) {
37314
37491
  ic.bSelectAlignResidue = false;
@@ -37333,20 +37510,24 @@ class HlSeq {
37333
37510
  }
37334
37511
 
37335
37512
  $(that).toggleClass('icn3d-highlightSeq');
37336
-
37337
37513
  let commandname, commanddescr, position;
37338
- if(!ic.bAnnotations) {
37339
- if(ic.bAlignSeq) {
37340
- commandname = "align_" + chainid;
37514
+ if(resn) {
37515
+ commandname = resn;
37516
+ }
37517
+ else {
37518
+ if(!ic.bAnnotations) {
37519
+ if(ic.bAlignSeq) {
37520
+ commandname = "align_" + chainid;
37521
+ }
37522
+ else {
37523
+ commandname = chainid;
37524
+ }
37341
37525
  }
37342
37526
  else {
37343
- commandname = chainid;
37527
+ commandname = $(that).attr('setname');
37528
+ commanddescr = $(that).attr('title');
37344
37529
  }
37345
37530
  }
37346
- else {
37347
- commandname = $(that).attr('setname');
37348
- commanddescr = $(that).attr('title');
37349
- }
37350
37531
 
37351
37532
  if($(that).hasClass('icn3d-highlightSeq')) {
37352
37533
  if(!ic.bAnnotations) {
@@ -37356,14 +37537,13 @@ class HlSeq {
37356
37537
  }
37357
37538
  else {
37358
37539
  ic.currSelectedSets = [commandname];
37359
- //ic.selectionCls.selectAChain(chainid, commandname, true);
37360
37540
  ic.selectionCls.selectAChain(chainid, commandname, ic.bAlignSeq);
37361
37541
  }
37362
37542
 
37363
37543
  if(ic.bAlignSeq) {
37364
37544
  me.htmlCls.clickMenuCls.setLogCmd('select alignChain ' + chainid, true);
37365
37545
  }
37366
- else {
37546
+ else {
37367
37547
  me.htmlCls.clickMenuCls.setLogCmd('select chain ' + chainid, true);
37368
37548
  }
37369
37549
 
@@ -37378,14 +37558,35 @@ class HlSeq {
37378
37558
  if($(that).attr('gi') !== undefined) {
37379
37559
  if(ic.bCtrl || ic.bShift) {
37380
37560
  ic.currSelectedSets.push(chainid);
37381
- ic.selectionCls.selectAChain(chainid, chainid, false, true);
37561
+ if(resn) {
37562
+ let prevHAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
37563
+ let bNoUpdateAll = true;
37564
+ ic.selByCommCls.selectBySpec('select :3' + resn, commandname, commandname, false, bNoUpdateAll);
37565
+ ic.hAtoms = me.hashUtilsCls.unionHash(ic.hAtoms, prevHAtoms);
37566
+ ic.hlUpdateCls.updateHlAll(resn, undefined, true, true);
37567
+ }
37568
+ else {
37569
+ ic.selectionCls.selectAChain(chainid, chainid, false, true);
37570
+ }
37382
37571
  }
37383
37572
  else {
37384
37573
  ic.currSelectedSets = [chainid];
37385
- ic.selectionCls.selectAChain(chainid, chainid, false);
37574
+ if(resn) {
37575
+ let bNoUpdateAll = true;
37576
+ ic.selByCommCls.selectBySpec('select :3' + resn, commandname, commandname, false, bNoUpdateAll);
37577
+ ic.hlUpdateCls.updateHlAll(resn, undefined, true, true);
37578
+ }
37579
+ else {
37580
+ ic.selectionCls.selectAChain(chainid, chainid, false);
37581
+ }
37386
37582
  }
37387
37583
 
37388
- me.htmlCls.clickMenuCls.setLogCmd('select chain ' + chainid, true);
37584
+ if(resn) {
37585
+ me.htmlCls.clickMenuCls.setLogCmd('select :3' + resn, true);
37586
+ }
37587
+ else {
37588
+ me.htmlCls.clickMenuCls.setLogCmd('select chain ' + chainid, true);
37589
+ }
37389
37590
 
37390
37591
  let setNames = ic.currSelectedSets.join(' or ');
37391
37592
  //if(ic.currSelectedSets.length > 1) me.htmlCls.clickMenuCls.setLogCmd('select saved atoms ' + setNames, true);
@@ -37600,8 +37801,7 @@ class ShowAnno {
37600
37801
  }
37601
37802
 
37602
37803
  //show annotations such as SNPs, ClinVar, domains, binding sites, etc.
37603
- showAnnotations() { let ic = this.icn3d, me = ic.icn3dui;
37604
- let thisClass = this;
37804
+ showAnnotations_part1() { let ic = this.icn3d, me = ic.icn3dui;
37605
37805
  me.htmlCls.dialogCls.openDlg('dl_selectannotations', 'Sequences and Annotations');
37606
37806
  // add note about assembly
37607
37807
  if((ic.bAssemblyNote === undefined || !ic.bAssemblyNote) && ic.asuCnt !== undefined ) {
@@ -37623,6 +37823,9 @@ class ShowAnno {
37623
37823
  ic.annotationCls.setAnnoView('overview');
37624
37824
  }
37625
37825
 
37826
+ let nucleotide_chainid = {}, chemical_chainid = {}, chemical_set = {};
37827
+ ic.protein_chainid = {};
37828
+
37626
37829
  if(ic.bAnnoShown === undefined || !ic.bAnnoShown || ic.bResetAnno) { // ic.bResetAnno when loading another structure
37627
37830
  let chainArray = Object.keys(ic.chains);
37628
37831
 
@@ -37631,7 +37834,13 @@ class ShowAnno {
37631
37834
  if(ic.resi2disease_nonempty === undefined) ic.resi2disease_nonempty = {};
37632
37835
  if(ic.baseResi === undefined) ic.baseResi = {};
37633
37836
  if(ic.matchedPos === undefined) ic.matchedPos = {};
37634
- let dialogWidth =(me.cfg.notebook) ? me.htmlCls.WIDTH / 2 : $("#" + ic.pre + "dl_selectannotations").dialog( "option", "width" );
37837
+ let dialogWidth;
37838
+ if(me.bNode) { // no $().dialog
37839
+ dialogWidth = 500;
37840
+ }
37841
+ else {
37842
+ dialogWidth =(me.cfg.notebook) ? me.htmlCls.WIDTH / 2 : $("#" + ic.pre + "dl_selectannotations").dialog( "option", "width" );
37843
+ }
37635
37844
  ic.seqAnnWidth = dialogWidth - 120 - 30*2 - 50; // title: 120px, start and end resi: 30px, extra space on the left and right: 50px
37636
37845
  ic.maxAnnoLength = 1;
37637
37846
  for(let chainid in ic.chainsSeq) {
@@ -37639,8 +37848,7 @@ class ShowAnno {
37639
37848
  ic.maxAnnoLength = ic.chainsSeq[chainid].length;
37640
37849
  }
37641
37850
  }
37642
- let nucleotide_chainid = {}, chemical_chainid = {}, chemical_set = {};
37643
- ic.protein_chainid = {};
37851
+
37644
37852
  for(let i = 0, il = chainArray.length; i < il; ++i) {
37645
37853
  Math.round(chainArray[i].indexOf('_'));
37646
37854
  //if(pos > 4) continue; // NMR structures with structure id such as 2K042,2K043, ...
@@ -37698,7 +37906,21 @@ class ShowAnno {
37698
37906
  } // for(let r = 0
37699
37907
  } // if(me.cfg.mmdbid
37700
37908
  } // for(let i = 0
37909
+ }
37910
+
37911
+ return {'nucleotide_chainid': nucleotide_chainid, 'chemical_chainid': chemical_chainid, 'chemical_set': chemical_set};
37912
+ }
37913
+
37914
+ showAnnotations() { let ic = this.icn3d, me = ic.icn3dui;
37915
+ let thisClass = this;
37701
37916
 
37917
+ let result = this.showAnnotations_part1();
37918
+
37919
+ let nucleotide_chainid = result.nucleotide_chainid;
37920
+ let chemical_chainid = result.chemical_chainid;
37921
+ let chemical_set = result.chemical_set;
37922
+
37923
+ if(ic.bAnnoShown === undefined || !ic.bAnnoShown || ic.bResetAnno) { // ic.bResetAnno when loading another structure
37702
37924
  if(me.cfg.blast_rep_id === undefined) {
37703
37925
  if(ic.bFullUi) {
37704
37926
  if(me.cfg.mmtfid !== undefined) { // mmtf data do NOT have the missing residues
@@ -37814,8 +38036,10 @@ class ShowAnno {
37814
38036
  }
37815
38037
  ic.bAnnoShown = true;
37816
38038
  }
38039
+
37817
38040
  showAnnoSeqData(nucleotide_chainid, chemical_chainid, chemical_set) { let ic = this.icn3d, me = ic.icn3dui;
37818
- this.getAnnotationData();
38041
+ if(!me.bNode) this.getAnnotationData();
38042
+
37819
38043
  let i = 0;
37820
38044
  for(let chain in nucleotide_chainid) {
37821
38045
  this.getSequenceData(chain, nucleotide_chainid[chain], 'nucleotide', i);
@@ -37838,12 +38062,15 @@ class ShowAnno {
37838
38062
  this.getCombinedSequenceData(name, chemical_set[name], i);
37839
38063
  ++i;
37840
38064
  }
37841
- this.enableHlSeq();
37842
38065
 
37843
- setTimeout(function(){
37844
- ic.annotationCls.hideAllAnno();
37845
- ic.annotationCls.clickCdd();
37846
- }, 0);
38066
+ if(!me.bNode) {
38067
+ this.enableHlSeq();
38068
+
38069
+ setTimeout(function(){
38070
+ ic.annotationCls.hideAllAnno();
38071
+ ic.annotationCls.clickCdd();
38072
+ }, 0);
38073
+ }
37847
38074
  }
37848
38075
 
37849
38076
  getAnnotationData() { let ic = this.icn3d, me = ic.icn3dui;
@@ -37880,15 +38107,17 @@ class ShowAnno {
37880
38107
  $("#" + ic.pre + "anno_" + chnid).append("<br><hr><br>");
37881
38108
  ++index;
37882
38109
  }
37883
- ic.annoCddSiteCls.setToolTip();
38110
+
38111
+ if(!me.bNode) ic.annoCddSiteCls.setToolTip();
38112
+
37884
38113
  // show the sequence and 3D structure
37885
38114
  //var url = "https://eme.utilsCls.ncbi.nlm.nih.gov/entrez/eUtilsCls/efetch.fcgi?db=protein&retmode=json&rettype=fasta&id=" + chnidBaseArray;
37886
38115
  let url = me.htmlCls.baseUrl + "/vastdyn/vastdyn.cgi?chainlist=" + chnidBaseArray;
37887
38116
 
37888
- if(ic.chainid_seq !== undefined) {
38117
+ if(ic.chainid_seq !== undefined) {
37889
38118
  this.processSeqData(ic.chainid_seq);
37890
38119
  }
37891
- else {
38120
+ else {
37892
38121
  $.ajax({
37893
38122
  url: url,
37894
38123
  dataType: 'jsonp', //'text',
@@ -37963,7 +38192,7 @@ class ShowAnno {
37963
38192
  let firstChainid = residArray[0].substr(0, pos);
37964
38193
  let sid =(me.cfg.mmdbid !== undefined && ic.chainid2sid !== undefined) ? ic.chainid2sid[firstChainid] : undefined;
37965
38194
  if(sid !== undefined) {
37966
- chemName = "<b><a class='icn3d-blue' href='https://pubchem.ncbi.nlm.nih.gov/substance/" + sid + "#section=2D-Structure' target='_blank'>" + name + " <img src='https://pubchem.ncbi.nlm.nih.gov/image/imgsrv.fcgi?sid=" + sid + "'></a></b>";
38195
+ chemName = "<b>" + name + " <a class='icn3d-blue' href='https://pubchem.ncbi.nlm.nih.gov/substance/" + sid + "#section=2D-Structure' target='_blank'><img src='https://pubchem.ncbi.nlm.nih.gov/image/imgsrv.fcgi?sid=" + sid + "'></a></b>";
37967
38196
  }
37968
38197
  else {
37969
38198
  chemName = "<b>" + name + "</b>";
@@ -37975,7 +38204,8 @@ class ShowAnno {
37975
38204
  // sequence, detailed view
37976
38205
  let htmlTmp = '<div id="' + ic.pre + 'giseq_sequence" class="icn3d-dl_sequence">';
37977
38206
  let chainType = 'Chem.', chainTypeFull = 'Chemical';
37978
- htmlTmp += '<div class="icn3d-seqTitle2" anno="sequence"><span style="white-space:nowrap;" title="' + chainTypeFull + ' ' + name + '">' + chainType + ' ' + name + '</span></div>';
38207
+ //htmlTmp += '<div class="icn3d-seqTitle2" anno="sequence"><span style="white-space:nowrap;" title="' + chainTypeFull + ' ' + name + '">' + chainType + ' ' + name + '</span></div>';
38208
+ htmlTmp += '<div class="icn3d-seqTitle icn3d-link icn3d-blue" anno="sequence" gi="' + name + '" resn="' + name + '"><span style="white-space:nowrap;" title="' + chainTypeFull + ' ' + name + '">' + chainType + ' ' + name + '</span></div>';
37979
38209
  htmlTmp += '<span class="icn3d-residueNum" style="width:60px!important;" title="starting protein sequence number">Count: ' + residArray.length + '</span>';
37980
38210
  htmlTmp += '<span class="icn3d-seqLine">';
37981
38211
  // sequence, overview
@@ -38221,9 +38451,12 @@ class ShowAnno {
38221
38451
  ic.hAtoms = me.hashUtilsCls.cloneHash(prevHAtoms);
38222
38452
  } // align seq to structure
38223
38453
  } // for loop
38224
- this.enableHlSeq();
38225
- // get CDD/Binding sites
38226
- ic.annoCddSiteCls.showCddSiteAll();
38454
+
38455
+ if(!me.bNode) {
38456
+ this.enableHlSeq();
38457
+ // get CDD/Binding sites
38458
+ ic.annoCddSiteCls.showCddSiteAll();
38459
+ }
38227
38460
  }
38228
38461
 
38229
38462
  enableHlSeq() { let ic = this.icn3d, me = ic.icn3dui;
@@ -38316,6 +38549,10 @@ class AnnoContact {
38316
38549
  }
38317
38550
  }
38318
38551
  showInteraction_base(chnid, chnidBase) { let ic = this.icn3d, me = ic.icn3dui;
38552
+ if(me.bNode) {
38553
+ if(!ic.resid2contact) ic.resid2contact = {};
38554
+ if(!ic.resid2contact[chnid]) ic.resid2contact[chnid] = [];
38555
+ }
38319
38556
  // set interaction
38320
38557
  if(ic.chainname2residues === undefined) ic.chainname2residues = {};
38321
38558
  let radius = 4;
@@ -38425,6 +38662,12 @@ class AnnoContact {
38425
38662
  // let pos = ic.chainsSeq[chnid][i - ic.matchedPos[chnid] ].resi;
38426
38663
  let pos =(i >= ic.matchedPos[chnid] && i - ic.matchedPos[chnid] < ic.chainsSeq[chnid].length) ? ic.chainsSeq[chnid][i - ic.matchedPos[chnid]].resi : ic.baseResi[chnid] + 1 + i;
38427
38664
  html += '<span id="' + pre + '_' + ic.pre + chnid + '_' + pos + '" title="' + cFull + pos + '" class="icn3d-residue">' + c + '</span>';
38665
+ if(me.bNode) {
38666
+ let obj = {};
38667
+ obj[chnid + '_' + pos] = fulltitle;
38668
+ ic.resid2contact[chnid].push(obj);
38669
+ }
38670
+
38428
38671
  html2 += ic.showSeqCls.insertGapOverview(chnid, i);
38429
38672
  let emptyWidth =(me.cfg.blast_rep_id == chnid) ? Math.round(ic.seqAnnWidth * i /(ic.maxAnnoLength + ic.nTotalGap) - prevEmptyWidth - prevLineWidth) : Math.round(ic.seqAnnWidth * i / ic.maxAnnoLength - prevEmptyWidth - prevLineWidth);
38430
38673
  //if(emptyWidth < 0) emptyWidth = 0;
@@ -38485,11 +38728,17 @@ class AnnoCrossLink {
38485
38728
  this.showCrosslink_base(chnid, chnidBase);
38486
38729
  }
38487
38730
  }
38488
- showCrosslink_base(chnid, chnidBase) { let ic = this.icn3d; ic.icn3dui;
38731
+ showCrosslink_base(chnid, chnidBase) { let ic = this.icn3d, me = ic.icn3dui;
38732
+ if(me.bNode) {
38733
+ if(!ic.resid2crosslink) ic.resid2crosslink = {};
38734
+ if(!ic.resid2crosslink[chnid]) ic.resid2crosslink[chnid] = [];
38735
+ }
38736
+
38489
38737
  let chainid = chnidBase;
38490
38738
  let resid2resids = {};
38491
38739
  let structure = chainid.substr(0, chainid.indexOf('_'));
38492
38740
  let clbondArray = ic.clbondpnts[structure];
38741
+
38493
38742
  if(clbondArray === undefined) {
38494
38743
  $("#" + ic.pre + "dt_crosslink_" + chnid).html('');
38495
38744
  $("#" + ic.pre + "ov_crosslink_" + chnid).html('');
@@ -38526,16 +38775,16 @@ class AnnoDomain {
38526
38775
  this.icn3d = icn3d;
38527
38776
  }
38528
38777
 
38529
- showDomainPerStructure(index) { let ic = this.icn3d, me = ic.icn3dui;
38778
+ showDomainPerStructure(index) { let ic = this.icn3d; ic.icn3dui;
38530
38779
  let thisClass = this;
38531
38780
  //var chnid = Object.keys(ic.protein_chainid)[0];
38532
38781
  //var pdbid = chnid.substr(0, chnid.indexOf('_'));
38533
38782
  let pdbArray = Object.keys(ic.structures);
38534
38783
  // show 3D domains
38535
38784
  let pdbid = pdbArray[index];
38536
- me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&domain&molinfor&uid=" + pdbid;
38785
+ //let url = me.htmlCls.baseUrl + "mmdb/mmdb_strview.cgi?v=2&program=icn3d&domain&molinfor&uid=" + pdbid;
38537
38786
 
38538
- if(index == 0 && ic.mmdb_data !== undefined) {
38787
+ if(index == 0 && ic.mmdb_data !== undefined) {
38539
38788
  for(let chnid in ic.protein_chainid) {
38540
38789
  if(chnid.indexOf(pdbid) !== -1) {
38541
38790
  this.showDomainWithData(chnid, ic.mmdb_data);
@@ -38549,7 +38798,7 @@ class AnnoDomain {
38549
38798
  }
38550
38799
  }
38551
38800
  }
38552
- else {
38801
+ else {
38553
38802
  // calculate 3D domains on-the-fly
38554
38803
  //ic.protein_chainid[chainArray[i]]
38555
38804
  let data = {};
@@ -38606,6 +38855,7 @@ class AnnoDomain {
38606
38855
  for(let i = 0, il = pdbArray.length; i < il; ++i) {
38607
38856
  ic.bAjaxDoneArray[i] = false;
38608
38857
  }
38858
+
38609
38859
  for(let i = 0, il = pdbArray.length; i < il; ++i) {
38610
38860
  this.showDomainPerStructure(i);
38611
38861
  }
@@ -38650,6 +38900,7 @@ class AnnoDomain {
38650
38900
  let fromArray = [], toArray = [];
38651
38901
  let resiHash = {};
38652
38902
  let resCnt = 0;
38903
+
38653
38904
  for(let i = 0, il = subdomainArray.length; i < il; ++i) {
38654
38905
  let domainFrom = Math.round(subdomainArray[i][0]) - 1; // convert 1-based to 0-based
38655
38906
  let domainTo = Math.round(subdomainArray[i][1]) - 1;
@@ -38676,6 +38927,25 @@ class AnnoDomain {
38676
38927
  resiHash[j+1] = 1;
38677
38928
  }
38678
38929
  }
38930
+
38931
+ // save 3D domain info for node.js script
38932
+ if(me.bNode) {
38933
+ let domainName = '3D domain ' +(index+1).toString();
38934
+
38935
+ if(!ic.resid2domain) ic.resid2domain = {};
38936
+ if(!ic.resid2domain[chnid]) ic.resid2domain[chnid] = [];
38937
+ for(let i = 0, il = fromArray.length; i < il; ++i) {
38938
+ let from = fromArray[i];
38939
+ let to = toArray[i];
38940
+ for(let j = from; j <= to; ++j) {
38941
+ // 0-based
38942
+ let obj = {};
38943
+ obj[chnid + '_' + (j+1).toString()] = domainName;
38944
+ ic.resid2domain[chnid].push(obj);
38945
+ }
38946
+ }
38947
+ }
38948
+
38679
38949
  let htmlTmp2 = '<div class="icn3d-seqTitle icn3d-link icn3d-blue" 3ddomain="' +(index+1).toString() + '" from="' + fromArray + '" to="' + toArray + '" shorttitle="' + title + '" index="' + index + '" setname="' + chnid + '_3d_domain_' +(index+1).toString() + '" anno="sequence" chain="' + chnid + '" title="' + fulltitle + '">' + title + ' </div>';
38680
38950
  let htmlTmp3 = '<span class="icn3d-residueNum" title="residue count">' + resCnt.toString() + ' Res</span>';
38681
38951
  html3 += htmlTmp2 + htmlTmp3 + '<br>';
@@ -38755,6 +39025,59 @@ class AnnoSnpClinVar {
38755
39025
  this.icn3d = icn3d;
38756
39026
  }
38757
39027
 
39028
+ showSnp(chnid, chnidBase) { let ic = this.icn3d; ic.icn3dui;
39029
+ this.showSnpClinvar(chnid, chnidBase, true);
39030
+ }
39031
+ showClinvar(chnid, chnidBase) { let ic = this.icn3d; ic.icn3dui;
39032
+ this.showSnpClinvar(chnid, chnidBase, false);
39033
+ }
39034
+
39035
+ //Show the annotations of SNPs and ClinVar.
39036
+ showSnpClinvar(chnid, chnidBase, bSnpOnly) { let ic = this.icn3d, me = ic.icn3dui;
39037
+ let thisClass = this;
39038
+
39039
+ // get gi from acc
39040
+ //var url2 = "https://www.ncbi.nlm.nih.gov/Structure/icn3d/chainid2repgi.txt";
39041
+ let url2 = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid=" + chnidBase;
39042
+ $.ajax({
39043
+ url: url2,
39044
+ dataType: 'jsonp', //'text',
39045
+ cache: true,
39046
+ tryCount : 0,
39047
+ retryLimit : 0, //1
39048
+ success: function(data2) {
39049
+ //ic.chainid2repgi = JSON.parse(data2);
39050
+ //var gi = ic.chainid2repgi[chnidBase];
39051
+ let snpgi = data2.snpgi;
39052
+ let gi = data2.gi;
39053
+ if(bSnpOnly) {
39054
+ thisClass.showSnpPart2(chnid, chnidBase, snpgi);
39055
+ }
39056
+ else {
39057
+ let specialGiArray = [6137708,1942289,224510717,2624886,253723219,2554905,75765331,3660278,312207882,319443632,342350956,1827805,109157826,1065265,40889086,6730307,163931185,494469,163931091,60594093,55669745,18655489,17942684,6980537,166235465,6435586,4139398,4389047,364506122,78101667,262118402,20664221,2624640,158430173,494395,28948777,34810587,13399647,3660342,261278854,342350965,384482350,378792570,15988303,213424334,4558333,2098365,10835631,3318817,374074330,332639529,122919696,4389286,319443573,2781341,67464020,194709238,210061039,364506106,28949044,40889076,161172338,17943181,4557976,62738484,365813173,6137343,350610552,17942703,576308,223674070,15826518,1310997,93279697,4139395,255311799,157837067,361132363,357380836,146387678,383280379,1127268,299856826,13786789,1311054,46015217,3402130,381353319,30750059,218766885,340707375,27065817,355333104,2624634,62738384,241913553,304446010];
39058
+ let giUsed = snpgi;
39059
+ if(specialGiArray.includes(gi)) giUsed = gi;
39060
+ thisClass.showClinvarPart2(chnid, chnidBase, giUsed);
39061
+ }
39062
+ },
39063
+ error : function(xhr, textStatus, errorThrown ) {
39064
+ this.tryCount++;
39065
+ if(this.tryCount <= this.retryLimit) {
39066
+ //try again
39067
+ $.ajax(this);
39068
+ return;
39069
+ }
39070
+ if(bSnpOnly) {
39071
+ thisClass.processNoSnp(chnid);
39072
+ }
39073
+ else {
39074
+ thisClass.processNoClinvar(chnid);
39075
+ }
39076
+ return;
39077
+ }
39078
+ });
39079
+ }
39080
+
38758
39081
  navClinVar(chnid) { let ic = this.icn3d; ic.icn3dui;
38759
39082
  let thisClass = this;
38760
39083
  ic.currClin[chnid] = - 1;
@@ -39190,7 +39513,7 @@ class AnnoSnpClinVar {
39190
39513
 
39191
39514
  return html;
39192
39515
  }
39193
- processSnpClinvar(data, chnid, chnidBase, bSnpOnly, bVirus) { let ic = this.icn3d; ic.icn3dui;
39516
+ processSnpClinvar(data, chnid, chnidBase, bSnpOnly, bVirus) { let ic = this.icn3d, me = ic.icn3dui;
39194
39517
  let html = '<div id="' + ic.pre + chnid + '_snpseq_sequence" class="icn3d-dl_sequence">';
39195
39518
  let html2 = html;
39196
39519
  let html3 = html;
@@ -39207,6 +39530,16 @@ class AnnoSnpClinVar {
39207
39530
  let resi2clinAllele = {};
39208
39531
  let posHash = {}, posClinHash = {};
39209
39532
  let prevSnpStr = '';
39533
+ if(me.bNode) {
39534
+ if(bSnpOnly) {
39535
+ if(!ic.resid2snp) ic.resid2snp = {};
39536
+ if(!ic.resid2snp[chnid]) ic.resid2snp[chnid] = [];
39537
+ }
39538
+ else {
39539
+ if(!ic.resid2clinvar) ic.resid2clinvar = {};
39540
+ if(!ic.resid2clinvar[chnid]) ic.resid2clinvar[chnid] = [];
39541
+ }
39542
+ }
39210
39543
  for(let i = 0, il = lineArray.length; i < il; ++i) {
39211
39544
  //bSnpOnly: false
39212
39545
  //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
@@ -39220,6 +39553,19 @@ class AnnoSnpClinVar {
39220
39553
  prevSnpStr = snpStr;
39221
39554
  let resiStr = snpStr.substr(0, snpStr.length - 3);
39222
39555
  let resi = Math.round(resiStr);
39556
+
39557
+ if(me.bNode) {
39558
+ let obj = {};
39559
+ obj[chnid + '_' + resi] = snpStr;
39560
+
39561
+ if(bSnpOnly) {
39562
+ ic.resid2snp[chnid].push(obj);
39563
+ }
39564
+ else {
39565
+ ic.resid2clinvar[chnid].push(obj);
39566
+ }
39567
+ }
39568
+
39223
39569
  snpStr.substr(snpStr.length - 3, 1);
39224
39570
  let snpRes = snpStr.substr(snpStr.indexOf('>') + 1); //snpStr.substr(snpStr.length - 1, 1);
39225
39571
  //var rsnum = bSnpOnly ? '' : fieldArray[4];
@@ -39347,58 +39693,7 @@ class AnnoSnpClinVar {
39347
39693
  }
39348
39694
  });
39349
39695
  }
39350
- showSnp(chnid, chnidBase) { let ic = this.icn3d; ic.icn3dui;
39351
- this.showSnpClinvar(chnid, chnidBase, true);
39352
- }
39353
- showClinvar(chnid, chnidBase) { let ic = this.icn3d; ic.icn3dui;
39354
- this.showSnpClinvar(chnid, chnidBase, false);
39355
- }
39356
39696
 
39357
- //Show the annotations of SNPs and ClinVar.
39358
- showSnpClinvar(chnid, chnidBase, bSnpOnly) { let ic = this.icn3d, me = ic.icn3dui;
39359
- let thisClass = this;
39360
-
39361
- // get gi from acc
39362
- //var url2 = "https://www.ncbi.nlm.nih.gov/Structure/icn3d/chainid2repgi.txt";
39363
- let url2 = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid=" + chnidBase;
39364
- $.ajax({
39365
- url: url2,
39366
- dataType: 'jsonp', //'text',
39367
- cache: true,
39368
- tryCount : 0,
39369
- retryLimit : 0, //1
39370
- success: function(data2) {
39371
- //ic.chainid2repgi = JSON.parse(data2);
39372
- //var gi = ic.chainid2repgi[chnidBase];
39373
- let snpgi = data2.snpgi;
39374
- let gi = data2.gi;
39375
- if(bSnpOnly) {
39376
- thisClass.showSnpPart2(chnid, chnidBase, snpgi);
39377
- }
39378
- else {
39379
- let specialGiArray = [6137708,1942289,224510717,2624886,253723219,2554905,75765331,3660278,312207882,319443632,342350956,1827805,109157826,1065265,40889086,6730307,163931185,494469,163931091,60594093,55669745,18655489,17942684,6980537,166235465,6435586,4139398,4389047,364506122,78101667,262118402,20664221,2624640,158430173,494395,28948777,34810587,13399647,3660342,261278854,342350965,384482350,378792570,15988303,213424334,4558333,2098365,10835631,3318817,374074330,332639529,122919696,4389286,319443573,2781341,67464020,194709238,210061039,364506106,28949044,40889076,161172338,17943181,4557976,62738484,365813173,6137343,350610552,17942703,576308,223674070,15826518,1310997,93279697,4139395,255311799,157837067,361132363,357380836,146387678,383280379,1127268,299856826,13786789,1311054,46015217,3402130,381353319,30750059,218766885,340707375,27065817,355333104,2624634,62738384,241913553,304446010];
39380
- let giUsed = snpgi;
39381
- if(specialGiArray.includes(gi)) giUsed = gi;
39382
- thisClass.showClinvarPart2(chnid, chnidBase, giUsed);
39383
- }
39384
- },
39385
- error : function(xhr, textStatus, errorThrown ) {
39386
- this.tryCount++;
39387
- if(this.tryCount <= this.retryLimit) {
39388
- //try again
39389
- $.ajax(this);
39390
- return;
39391
- }
39392
- if(bSnpOnly) {
39393
- thisClass.processNoSnp(chnid);
39394
- }
39395
- else {
39396
- thisClass.processNoClinvar(chnid);
39397
- }
39398
- return;
39399
- }
39400
- });
39401
- }
39402
39697
  showSnpPart2(chnid, chnidBase, gi) { let ic = this.icn3d; ic.icn3dui;
39403
39698
  let thisClass = this;
39404
39699
  if(gi !== undefined) {
@@ -43044,14 +43339,13 @@ class Label {
43044
43339
  }
43045
43340
  else {
43046
43341
  let factor = (label.factor) ? oriFactor * label.factor : oriFactor;
43047
-
43048
43342
  bb = this.textSpriteCls.makeTextSprite(label.text, {fontsize: parseInt(labelsize), textColor: labelcolor, borderColor: labelbackground, backgroundColor: labelbackground, alpha: labelalpha, bSchematic: 0, factor: factor});
43049
43343
  }
43050
43344
  }
43051
43345
 
43052
43346
  let labelOffset = (name == 'schematic' || name == 'residue') ? 0 : ic.coilWidth; // 0.3
43053
- bb.position.set(label.position.x + labelOffset, label.position.y + labelOffset, label.position.z + labelOffset);
43054
- ic.mdl.add(bb);
43347
+ bb.position.set(parseFloat(label.position.x) + labelOffset, parseFloat(label.position.y) + labelOffset, parseFloat(label.position.z) + labelOffset);
43348
+ ic.mdl.add(bb);
43055
43349
  // do not add labels to objects for pk
43056
43350
  }
43057
43351
  }
@@ -57764,6 +58058,7 @@ class SetDialog {
57764
58058
  html += "File type: ";
57765
58059
  html += "<select id='" + me.pre + "filetype'>";
57766
58060
  html += me.htmlCls.optionStr + "'pdb' selected>PDB</option>";
58061
+ html += me.htmlCls.optionStr + "'mmcif'>mmCIF</option>";
57767
58062
  html += me.htmlCls.optionStr + "'mol2'>Mol2</option>";
57768
58063
  html += me.htmlCls.optionStr + "'sdf'>SDF</option>";
57769
58064
  html += me.htmlCls.optionStr + "'xyz'>XYZ</option>";
@@ -58441,31 +58736,7 @@ class SetDialog {
58441
58736
  html += "</div>";
58442
58737
  html += "</div>";
58443
58738
 
58444
- html += "<div class='icn3d-box' style='width:520px;'><b>Annotations:&nbsp;</b><br><table border=0><tr>";
58445
- let tmpStr1 = "<td style='min-width:110px;'><span style='white-space:nowrap'>";
58446
- let tmpStr2 = "<td style='min-width:130px;'><span style='white-space:nowrap'>";
58447
-
58448
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_all'>All" + me.htmlCls.space2 + "</span></td>";
58449
- html += tmpStr2 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_cdd' checked>Conserved Domains" + me.htmlCls.space2 + "</span></td>";
58450
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_clinvar'>ClinVar" + me.htmlCls.space2 + "</span></td>";
58451
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_binding'>Functional Sites" + me.htmlCls.space2 + "</span></td>";
58452
- html += "</tr><tr>";
58453
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_custom'>Custom" + me.htmlCls.space2 + "</span></td>";
58454
- html += tmpStr2 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_3dd'>3D Domains" + me.htmlCls.space2 + "</span></td>";
58455
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_snp'>SNPs" + me.htmlCls.space2 + "</span></td>";
58456
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_interact'>Interactions" + me.htmlCls.space2 + "</span></td>";
58457
- html += "<td></td>";
58458
- html += "</tr><tr>";
58459
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ssbond'>Disulfide Bonds" + me.htmlCls.space2 + "</span></td>";
58460
- html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_crosslink'>Cross-Linkages" + me.htmlCls.space2 + "</span></td>";
58461
- if(me.cfg.opmid !== undefined) {
58462
- html += "<td style='min-width:110px;'><span id='" + me.pre + "anno_transmemli' style='white-space:nowrap'>" + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_transmem'>Transmembrane" + me.htmlCls.space2 + "</span></td>";
58463
- }
58464
- else {
58465
- html += "<td style='min-width:110px;'><span id='" + me.pre + "anno_transmemli' style='display:none; white-space:nowrap'>" + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_transmem'>Transmembrane" + me.htmlCls.space2 + "</span></td>";
58466
- }
58467
- html += "<td></td>";
58468
- html += "</tr></table></div>";
58739
+ html += this.getAnnoHeader();
58469
58740
 
58470
58741
  html += "<button style='white-space:nowrap; margin-left:5px;' id='" + me.pre + "showallchains'>Show All Chains</button><br>";
58471
58742
 
@@ -58580,6 +58851,39 @@ class SetDialog {
58580
58851
 
58581
58852
  return html;
58582
58853
  }
58854
+
58855
+ getAnnoHeader() { let me = this.icn3dui; me.icn3d;
58856
+ let html = '';
58857
+
58858
+ html += "<div id='" + me.pre + "annoHeaderSection' class='icn3d-box' style='width:520px;'><b>Annotations:&nbsp;</b><br>";
58859
+ html += "<div id='" + me.pre + "annoHeader'><table border=0><tr>";
58860
+ let tmpStr1 = "<td style='min-width:110px;'><span style='white-space:nowrap'>";
58861
+ let tmpStr2 = "<td style='min-width:130px;'><span style='white-space:nowrap'>";
58862
+
58863
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_all'>All" + me.htmlCls.space2 + "</span></td>";
58864
+ html += tmpStr2 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_cdd' checked>Conserved Domains" + me.htmlCls.space2 + "</span></td>";
58865
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_clinvar'>ClinVar" + me.htmlCls.space2 + "</span></td>";
58866
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_binding'>Functional Sites" + me.htmlCls.space2 + "</span></td>";
58867
+ html += "</tr><tr>";
58868
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_custom'>Custom" + me.htmlCls.space2 + "</span></td>";
58869
+ html += tmpStr2 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_3dd'>3D Domains" + me.htmlCls.space2 + "</span></td>";
58870
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_snp'>SNPs" + me.htmlCls.space2 + "</span></td>";
58871
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_interact'>Interactions" + me.htmlCls.space2 + "</span></td>";
58872
+ html += "<td></td>";
58873
+ html += "</tr><tr>";
58874
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ssbond'>Disulfide Bonds" + me.htmlCls.space2 + "</span></td>";
58875
+ html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_crosslink'>Cross-Linkages" + me.htmlCls.space2 + "</span></td>";
58876
+ if(me.cfg.opmid !== undefined) {
58877
+ html += "<td style='min-width:110px;'><span id='" + me.pre + "anno_transmemli' style='white-space:nowrap'>" + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_transmem'>Transmembrane" + me.htmlCls.space2 + "</span></td>";
58878
+ }
58879
+ else {
58880
+ html += "<td style='min-width:110px;'><span id='" + me.pre + "anno_transmemli' style='display:none; white-space:nowrap'>" + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_transmem'>Transmembrane" + me.htmlCls.space2 + "</span></td>";
58881
+ }
58882
+ html += "<td></td>";
58883
+ html += "</tr></table></div></div>";
58884
+
58885
+ return html;
58886
+ }
58583
58887
  }
58584
58888
 
58585
58889
  /**
@@ -65544,7 +65848,7 @@ class iCn3DUI {
65544
65848
  //even when multiple iCn3D viewers are shown together.
65545
65849
  this.pre = this.cfg.divid + "_";
65546
65850
 
65547
- this.REVISION = '3.12.5';
65851
+ this.REVISION = '3.12.8';
65548
65852
 
65549
65853
  // In nodejs, iCn3D defines "window = {navigator: {}}"
65550
65854
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -65728,6 +66032,8 @@ iCn3DUI.prototype.show3DStructure = function(pdbStr) { let me = this;
65728
66032
  chainidArray.push(structureArray[i] + '_' + chainArray[i]);
65729
66033
  }
65730
66034
 
66035
+ chainidArray = ic.chainalignParserCls.addPostfixForChainids(chainidArray);
66036
+
65731
66037
  let bRealign = true, bPredefined = true;
65732
66038
  ic.realignParserCls.realignChainOnSeqAlign(undefined, chainidArray, bRealign, bPredefined);
65733
66039
  }
@@ -65735,25 +66041,40 @@ iCn3DUI.prototype.show3DStructure = function(pdbStr) { let me = this;
65735
66041
  else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
65736
66042
  let stru_t = Object.keys(ic.structures)[0];
65737
66043
  let chain_t = stru_t + '_' + me.cfg.masterchain;
65738
- let chainidArray = me.cfg.matchedchains.split(',');
66044
+ let domainidArray = me.cfg.matchedchains.split(',');
66045
+ let chainidArray = [];
66046
+ for(let i = 0, il = domainidArray.length; i < il; ++i) {
66047
+ let pos = domainidArray[i].lastIndexOf('_');
66048
+ let lastId = domainidArray[i].substr(pos + 1);
66049
+ if(!isNaN(lastId)) { // lastId is domain id
66050
+ chainidArray.push(domainidArray[i].substr(0, pos));
66051
+ }
66052
+ else {
66053
+ chainidArray.push(domainidArray[i]);
66054
+ }
66055
+ }
66056
+
65739
66057
  let mmdbafid = '';
65740
66058
  for(let i = 0, il = chainidArray.length; i < il; ++i) {
65741
66059
  if(i > 0) mmdbafid += ',';
65742
66060
  mmdbafid += chainidArray[i].substr(0, chainidArray[i].indexOf('_'));
65743
66061
  }
66062
+
66063
+ // realign
66064
+ ic.chainidArray = [chain_t].concat(chainidArray);
66065
+ ic.chainidArray = ic.chainalignParserCls.addPostfixForChainids(ic.chainidArray);
66066
+
66067
+ me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
66068
+
66069
+ ic.loadCmd = 'vast_search_chainid ' + ic.chainidArray;
66070
+ me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
65744
66071
 
65745
66072
  // load multiple PDBs
65746
66073
  ic.bNCBI = true;
65747
66074
  ic.bMmdbafid = true;
65748
66075
 
65749
- ic.loadCmd = 'load mmdbaf0 ' + mmdbafid;
65750
- me.htmlCls.clickMenuCls.setLogCmd(ic.loadCmd, true);
65751
-
65752
66076
  let bQuery = true;
65753
66077
  ic.chainalignParserCls.downloadMmdbAf(mmdbafid, bQuery);
65754
-
65755
- // realign
65756
- ic.chainidArray = [chain_t].concat(chainidArray);
65757
66078
  }
65758
66079
  }
65759
66080
  else if(me.cfg.url !== undefined) {