icn3d 3.22.1 → 3.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/icn3d.js CHANGED
@@ -6151,7 +6151,7 @@ class ClickMenu {
6151
6151
  thisClass.displayShownMenus();
6152
6152
  });
6153
6153
 
6154
- me.myEventCls.onIds("#" + me.pre + "apply_menupref", "click", function(e) { me.icn3d; //e.preventDefault();
6154
+ me.myEventCls.onIds(["#" + me.pre + "apply_menupref", "#" + me.pre + "apply_menupref2"], "click", function(e) { me.icn3d; //e.preventDefault();
6155
6155
  var checkboxes = document.querySelectorAll('form[name="' + me.pre + 'selmenu"] input:checked');
6156
6156
  me.htmlCls.shownMenus = {};
6157
6157
  for (var checkbox of checkboxes) {
@@ -6161,21 +6161,21 @@ class ClickMenu {
6161
6161
  thisClass.applyShownMenus();
6162
6162
  });
6163
6163
 
6164
- me.myEventCls.onIds("#" + me.pre + "reset_menupref", "click", function(e) { me.icn3d; //e.preventDefault();
6164
+ me.myEventCls.onIds(["#" + me.pre + "reset_menupref", "#" + me.pre + "reset_menupref2"], "click", function(e) { me.icn3d; //e.preventDefault();
6165
6165
  me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
6166
6166
 
6167
6167
  thisClass.applyShownMenus();
6168
6168
  thisClass.displayShownMenus();
6169
6169
  });
6170
6170
 
6171
- me.myEventCls.onIds("#" + me.pre + "reset_menupref_all", "click", function(e) { me.icn3d; //e.preventDefault();
6171
+ me.myEventCls.onIds(["#" + me.pre + "reset_menupref_all", "#" + me.pre + "reset_menupref_all2"], "click", function(e) { me.icn3d; //e.preventDefault();
6172
6172
  me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
6173
6173
 
6174
6174
  thisClass.applyShownMenus();
6175
6175
  thisClass.displayShownMenus();
6176
6176
  });
6177
6177
 
6178
- me.myEventCls.onIds("#" + me.pre + "savepref", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
6178
+ me.myEventCls.onIds(["#" + me.pre + "savepref", "#" + me.pre + "savepref2"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
6179
6179
  let menuStr = '[';
6180
6180
 
6181
6181
  //var checkboxes = document.querySelectorAll('form[name="' + me.pre + 'selmenu"] input:checked');
@@ -8690,7 +8690,8 @@ class SetMenu {
8690
8690
  if(me.cfg.opmid !== undefined) {
8691
8691
  html += this.getLinkWrapper('togglemem', 'Toggle Membrane', 'togglememli', undefined, 1);
8692
8692
  }
8693
- else if(me.cfg.mmdbafid !== undefined || me.cfg.afid !== undefined) {
8693
+ //else if(me.cfg.mmdbafid !== undefined || me.cfg.afid !== undefined) {
8694
+ else if(me.cfg.cid === undefined) {
8694
8695
  // hide by default
8695
8696
  html += this.getLinkWrapper('togglemem', 'Toggle Membrane', 'togglememli', undefined, 1, true);
8696
8697
  }
@@ -10161,7 +10162,11 @@ class Dialog {
10161
10162
  if(id === me.pre + 'dl_addtrack') {
10162
10163
  width='50%';
10163
10164
  }
10164
-
10165
+ else if(id === me.pre + 'dl_menupref') {
10166
+ width = 600;
10167
+ height = 500;
10168
+ }
10169
+
10165
10170
  let position;
10166
10171
 
10167
10172
  if(id === me.pre + 'dl_definedsets') {
@@ -10681,10 +10686,10 @@ class SetDialog {
10681
10686
  html += "</div>";
10682
10687
 
10683
10688
  html += me.htmlCls.divStr + "dl_blast_rep_id' style='max-width:600px;' class='" + dialogClass + "'>";
10684
- html += "Enter a Sequence ID (or FASTA sequence) and the aligned Structure ID, which can be found using the <a href='https://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch&DATABASE=pdb' target='_blank'>BLAST</a> search against the pdb database with the Sequence ID or FASTA sequence as input.<br><br> ";
10689
+ html += "Enter a Sequence ID (or FASTA sequence) and the aligned protein accession, which can be found using the <a href='https://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch' target='_blank'>BLAST</a> search with the Sequence ID or FASTA sequence as input. If the protein accession is not a PDB chain, the corresponding AlphaFold UniProt structure is used.<br><br> ";
10685
10690
  html += "<b>Sequence ID</b>(NCBI protein accession of a sequence): " + me.htmlCls.inputTextStr + "id='" + me.pre + "query_id' value='NP_001108451.1' size=8><br> ";
10686
10691
  html += "or FASTA sequence: <br><textarea id='" + me.pre + "query_fasta' rows='5' style='width: 100%; height: " +(me.htmlCls.LOG_HEIGHT) + "px; padding: 0px; border: 0px;'></textarea><br><br>";
10687
- html += "<b>Structure ID</b>(NCBI protein accession of a chain of a 3D structure): " + me.htmlCls.inputTextStr + "id='" + me.pre + "blast_rep_id' value='1TSR_A' size=8><br> ";
10692
+ html += "<b>NCBI protein accession</b> (or a chain of a PDB): " + me.htmlCls.inputTextStr + "id='" + me.pre + "blast_rep_id' value='1TSR_A' size=8><br> ";
10688
10693
  //html += me.htmlCls.buttonStr + "reload_blast_rep_id'>Load</button>";
10689
10694
  html += me.htmlCls.buttonStr + "reload_blast_rep_id'>Align with BLAST</button> " + me.htmlCls.wifiStr
10690
10695
  + me.htmlCls.buttonStr + "reload_alignsw' style='margin-left:30px'>Align with Global Smith-Waterman</button>"
@@ -11305,11 +11310,17 @@ class SetDialog {
11305
11310
 
11306
11311
  html += me.htmlCls.divStr + "dl_menupref' class='" + dialogClass + "'>";
11307
11312
  html += "<b>Note</b>: The following parameters will be saved in cache. You just need to set them once. <br><br>";
11308
- html += "<div id='" + me.pre + "menulist' style='max-width:500px; max-height:300px; overflow:scroll'></div><br><br>";
11313
+
11309
11314
  html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "apply_menupref'>Apply</button></span>";
11310
11315
  html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "reset_menupref' style='margin-left:30px'>Reset to Simple Menus</button></span>";
11311
11316
  html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "reset_menupref_all' style='margin-left:30px'>Reset to All Menus</button></span>";
11312
- html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "savepref' style='margin-left:30px'>Save Preferences</button></span>";
11317
+ html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "savepref' style='margin-left:30px'>Save Preferences</button></span><br><br>";
11318
+
11319
+ html += "<div id='" + me.pre + "menulist'></div><br><br>";
11320
+ html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "apply_menupref2'>Apply</button></span>";
11321
+ html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "reset_menupref2' style='margin-left:30px'>Reset to Simple Menus</button></span>";
11322
+ html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "reset_menupref_all2' style='margin-left:30px'>Reset to All Menus</button></span>";
11323
+ html += me.htmlCls.spanNowrapStr + "" + me.htmlCls.buttonStr + "savepref2' style='margin-left:30px'>Save Preferences</button></span>";
11313
11324
  html += "</div>";
11314
11325
 
11315
11326
  html += me.htmlCls.divStr + "dl_addtrack' class='" + dialogClass + "'>";
@@ -38938,6 +38949,17 @@ class ShowAnno {
38938
38949
  dataObj['targets'] = me.cfg.blast_rep_id + ':' + target_from_to_array.join(':');
38939
38950
  }
38940
38951
 
38952
+ // get seqeunce
38953
+ if(ic.blastAcxn) {
38954
+ let chainid = me.cfg.afid + '_A';
38955
+ let seq = '';
38956
+ for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
38957
+ seq += ic.chainsSeq[chainid][i].name;
38958
+ }
38959
+
38960
+ dataObj['targets'] = seq;
38961
+ }
38962
+
38941
38963
  let data = await me.getAjaxPostPromise(url, dataObj);
38942
38964
 
38943
38965
  ic.seqStructAlignData = data;
@@ -38958,21 +38980,23 @@ class ShowAnno {
38958
38980
  idArray.push(me.cfg.query_id);
38959
38981
  }
38960
38982
 
38961
- // show the sequence and 3D structure
38962
- //var url = "https://eme.utilsCls.ncbi.nlm.nih.gov/entrez/eUtilsCls/efetch.fcgi?db=protein&retmode=json&rettype=fasta&id=" + chnidBaseArray;
38963
- let url = me.htmlCls.baseUrl + "/vastdyn/vastdyn.cgi?chainlist=" + idArray;
38964
- let chainid_seq = await me.getAjaxPromise(url, 'jsonp', false, "Can not retrieve the sequence of the accession(s) " + idArray.join(", "));
38983
+ // get seqeunce
38984
+ if(ic.blastAcxn) {
38985
+ let chainid = me.cfg.afid + '_A';
38986
+ let seq = '';
38987
+ for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
38988
+ seq += ic.chainsSeq[chainid][i].name;
38989
+ }
38965
38990
 
38966
- let index = 0;
38967
- for(let acc in chainid_seq) {
38968
- if(index == 0) {
38991
+ target = seq;
38992
+ }
38993
+ else {
38994
+ let url = me.htmlCls.baseUrl + "/vastdyn/vastdyn.cgi?chainlist=" + idArray;
38995
+ let chainid_seq = await me.getAjaxPromise(url, 'jsonp', false, "Can not retrieve the sequence of the accession(s) " + idArray.join(", "));
38996
+
38997
+ for(let acc in chainid_seq) {
38969
38998
  target = chainid_seq[acc];
38970
38999
  }
38971
- else if(!query) {
38972
- query = chainid_seq[acc];
38973
- }
38974
-
38975
- ++index;
38976
39000
  }
38977
39001
 
38978
39002
  let match_score = 1, mismatch = -1, gap = -1, extension = -1;
@@ -39066,18 +39090,45 @@ class ShowAnno {
39066
39090
 
39067
39091
  if(!me.bNode) ic.annoCddSiteCls.setToolTip();
39068
39092
 
39069
- // show the sequence and 3D structure
39070
- //var url = "https://eme.utilsCls.ncbi.nlm.nih.gov/entrez/eUtilsCls/efetch.fcgi?db=protein&retmode=json&rettype=fasta&id=" + chnidBaseArray;
39071
- let url = me.htmlCls.baseUrl + "/vastdyn/vastdyn.cgi?chainlist=" + chnidBaseArray;
39072
-
39073
39093
  if(ic.chainid_seq !== undefined) {
39074
39094
  await this.processSeqData(ic.chainid_seq);
39075
39095
  }
39076
39096
  else {
39077
39097
  try {
39078
- let data = await me.getAjaxPromise(url, 'jsonp');
39098
+ let pdbChainidArray = [], afChainidArray = [];
39099
+ for(let i = 0, il = chnidBaseArray.length; i < il; ++i) {
39100
+ if(chnidBaseArray[i].length >= 6) {
39101
+ afChainidArray.push(chnidBaseArray[i]);
39102
+ }
39103
+ else {
39104
+ pdbChainidArray.push(chnidBaseArray[i]);
39105
+ }
39106
+ }
39107
+
39108
+ if(pdbChainidArray.length > 0) {
39109
+ let url = me.htmlCls.baseUrl + "/vastdyn/vastdyn.cgi?chainlist=" + pdbChainidArray;
39110
+ ic.chainid_seq = await me.getAjaxPromise(url, 'jsonp');
39111
+ }
39112
+ else {
39113
+ ic.chainid_seq = {};
39114
+ }
39115
+
39116
+ let data;
39117
+
39118
+ for(let i = 0, il = afChainidArray.length; i < il; ++i) {
39119
+ let chainid = afChainidArray[i];
39120
+ let seq = '';
39121
+ for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
39122
+ seq += ic.chainsSeq[chainid][i].name;
39123
+ }
39124
+
39125
+ ic.chainid_seq[chainid] = seq;
39126
+ }
39127
+
39128
+ // let url = me.htmlCls.baseUrl + "/vastdyn/vastdyn.cgi?chainlist=" + chnidBaseArray;
39129
+ // let data = await me.getAjaxPromise(url, 'jsonp');
39130
+ // ic.chainid_seq = data;
39079
39131
 
39080
- ic.chainid_seq = data;
39081
39132
  await thisClass.processSeqData(ic.chainid_seq);
39082
39133
  }
39083
39134
  catch(err) {
@@ -39211,8 +39262,8 @@ class ShowAnno {
39211
39262
  if(!me.bNode) console.log( "No data were found for the chain " + chnid + "..." );
39212
39263
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
39213
39264
  }
39214
-
39215
- if(me.cfg.blast_rep_id != chnid) {
39265
+
39266
+ if(me.cfg.blast_rep_id != chnid) {
39216
39267
  ic.showSeqCls.showSeq(chnid, chnidBase);
39217
39268
  }
39218
39269
  else if(me.cfg.blast_rep_id == chnid && ic.seqStructAlignData === undefined && ic.seqStructAlignDataSmithwm === undefined) {
@@ -39226,13 +39277,13 @@ class ShowAnno {
39226
39277
  let compTitle = undefined;
39227
39278
  let compText = undefined;
39228
39279
  let text = "cannot be aligned";
39280
+
39229
39281
  ic.queryStart = '';
39230
39282
  ic.queryEnd = '';
39231
39283
  if(ic.bRender) var aaa = 1; //alert('The sequence can NOT be aligned to the structure');
39232
39284
  ic.showSeqCls.showSeq(chnid, chnidBase, undefined, title, compTitle, text, compText);
39233
39285
  }
39234
39286
  else if(me.cfg.blast_rep_id == chnid && (ic.seqStructAlignData !== undefined || ic.seqStructAlignDataSmithwm !== undefined) ) { // align sequence to structure
39235
- //var title = 'Query: ' + me.cfg.query_id.substr(0, 6);
39236
39287
  let title;
39237
39288
  if(me.cfg.query_id.length > 14) {
39238
39289
  title = 'Query: ' + me.cfg.query_id.substr(0, 6) + '...';
@@ -39240,8 +39291,7 @@ class ShowAnno {
39240
39291
  else {
39241
39292
  title =(isNaN(me.cfg.query_id)) ? 'Query: ' + me.cfg.query_id : 'Query: gi ' + me.cfg.query_id;
39242
39293
  }
39243
-
39244
-
39294
+
39245
39295
  let evalue, targetSeq, querySeq, segArray;
39246
39296
 
39247
39297
  if(ic.seqStructAlignData !== undefined) {
@@ -39249,8 +39299,11 @@ class ShowAnno {
39249
39299
  let data = ic.seqStructAlignData;
39250
39300
  if(data.data !== undefined) {
39251
39301
  query = data.data[0].query;
39252
- //target = data.data[0].targets[chnid.replace(/_/g, '')];
39253
- target = data.data[0].targets[chnid];
39302
+ // if target is seqeunce, the key is not chnid
39303
+ //target = data.data[0].targets[chnid];
39304
+ let keys = Object.keys(data.data[0].targets);
39305
+ target = data.data[0].targets[keys[0]];
39306
+
39254
39307
  target =(target !== undefined && target.hsps.length > 0) ? target.hsps[0] : undefined;
39255
39308
  }
39256
39309
 
@@ -39258,8 +39311,11 @@ class ShowAnno {
39258
39311
  evalue = target.scores.e_value.toPrecision(2);
39259
39312
  if(evalue > 1e-200) evalue = parseFloat(evalue).toExponential();
39260
39313
  target.scores.bit_score;
39261
- //var targetSeq = data.targets[chnid.replace(/_/g, '')].seqdata;
39262
- targetSeq = data.targets[chnid].seqdata;
39314
+ // if target is seqeunce, the key is not chnid
39315
+ // targetSeq = data.targets[chnid].seqdata;
39316
+ let keys = Object.keys(data.targets);
39317
+ targetSeq = data.targets[keys[0]].seqdata;
39318
+
39263
39319
  querySeq = query.seqdata;
39264
39320
  segArray = target.segs;
39265
39321
  }
@@ -39304,7 +39360,7 @@ class ShowAnno {
39304
39360
  let text = '', compText = '';
39305
39361
  ic.queryStart = '';
39306
39362
  ic.queryEnd = '';
39307
-
39363
+
39308
39364
  if(segArray !== undefined) {
39309
39365
  let target2queryHash = {};
39310
39366
  if(ic.targetGapHash === undefined) ic.targetGapHash = {};
@@ -39378,7 +39434,7 @@ class ShowAnno {
39378
39434
 
39379
39435
  //title += ', E: ' + evalue;
39380
39436
  }
39381
- else {
39437
+ else {
39382
39438
  text += "cannot be aligned";
39383
39439
  if(ic.bRender) var aaa = 1; //alert('The sequence can NOT be aligned to the structure');
39384
39440
  }
@@ -45906,24 +45962,39 @@ class MmdbParser {
45906
45962
  me.cfg.query_id = idArray[0];
45907
45963
  me.cfg.blast_rep_id = idArray[1];
45908
45964
 
45909
- let mmdbid = me.cfg.blast_rep_id.split('_')[0];
45965
+ let mmdbid = me.cfg.blast_rep_id.split('_')[0]; // 1TSR_A, XP_003256700.1, Q9H3D4.1
45910
45966
 
45911
- await this.downloadMmdb(mmdbid);
45967
+ if(mmdbid.length == 4) { // pdb
45968
+ await this.downloadMmdb(mmdbid);
45969
+ }
45970
+ else {
45971
+ ic.blastAcxn = me.cfg.blast_rep_id.split('.')[0];
45972
+ //await ic.pdbParserCls.downloadPdb(ic.blastAcxn, true);
45973
+ await this.downloadRefseq(ic.blastAcxn);
45974
+ }
45912
45975
  }
45913
45976
 
45914
45977
  async downloadRefseq(refseqid) { let ic = this.icn3d, me = ic.icn3dui;
45915
45978
  let url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?refseq2uniprot=" + refseqid;
45979
+
45980
+ me.cfg.refseqid = refseqid;
45916
45981
 
45917
45982
  //ic.bCid = undefined;
45918
45983
 
45919
45984
  let data = await me.getAjaxPromise(url, 'jsonp', false, 'The protein accession ' + refseqid + ' can not be mapped to AlphaFold UniProt ID...');
45920
45985
 
45921
- if(!data || !data.uniprot) {
45922
- var aaa = 1; //alert('The protein accession ' + refseqid + ' can not be mapped to AlphaFold UniProt ID...');
45986
+ if(data && data.uniprot) {
45987
+ me.cfg.afid = data.uniprot;
45988
+ }
45989
+ else {
45990
+ var aaa = 1; //alert('The accession ' + refseqid + ' can not be mapped to AlphaFold UniProt ID. It will be treated as a UniProt ID instead.');
45991
+
45923
45992
  return;
45993
+
45994
+ //me.cfg.afid = refseqid;
45924
45995
  }
45925
45996
 
45926
- me.cfg.afid = data.uniprot;
45997
+ me.cfg.blast_rep_id = me.cfg.afid + '_A';
45927
45998
 
45928
45999
  let bAf = true;
45929
46000
 
@@ -47162,6 +47233,7 @@ class PdbParser {
47162
47233
  $("#" + ic.pre + "alternateWrapper").hide();
47163
47234
  }
47164
47235
 
47236
+ //if(me.cfg.afid && !ic.bAfMem && !me.cfg.blast_rep_id) {
47165
47237
  if(me.cfg.afid && !ic.bAfMem) {
47166
47238
  ic.opts['color'] = 'confidence';
47167
47239
  }
@@ -59360,6 +59432,7 @@ class Dssp {
59360
59432
  let allPromise = Promise.allSettled(ajaxArray);
59361
59433
  try {
59362
59434
  let dataArray = await allPromise;
59435
+
59363
59436
  await thisClass.parseDsspData(dataArray, struArray, bAppend);
59364
59437
 
59365
59438
  await ic.ParserUtilsCls.checkMemProteinAndRotate();
@@ -59368,9 +59441,6 @@ class Dssp {
59368
59441
  console.log("DSSP calculation had a problem with this structure " + struArray[0] + "...");
59369
59442
 
59370
59443
  await ic.pdbParserCls.loadPdbDataRender(bAppend);
59371
-
59372
- /// if(ic.deferredOpm !== undefined) ic.deferredOpm.resolve();
59373
- /// if(ic.deferredSecondary !== undefined) ic.deferredSecondary.resolve();
59374
59444
  }
59375
59445
  }
59376
59446
 
@@ -59541,13 +59611,30 @@ class Dssp {
59541
59611
  pdbAjaxArray.push(pdbAjax);
59542
59612
  }
59543
59613
 
59544
- let allPromise = Promise.allSettled(pdbAjaxArray);
59545
59614
  try {
59546
- ic.pdbDataArray = await allPromise;
59547
- await thisClass.parseRefPdbData(ic.pdbDataArray);
59615
+ // if(!me.bNode) {
59616
+ let allPromise = Promise.allSettled(pdbAjaxArray);
59617
+ ic.pdbDataArray = await allPromise;
59618
+ await thisClass.parseRefPdbData(ic.pdbDataArray);
59619
+ // }
59620
+ // else {
59621
+ // ic.pdbDataArray = [];
59622
+ // for(let i = 0, il = pdbAjaxArray.length; i < il; ++i) {
59623
+ // try {
59624
+ // let dataTmp = await pdbAjaxArray[i];
59625
+ // ic.pdbDataArray.push({'value': dataTmp});
59626
+ // }
59627
+ // catch(err) {
59628
+ // ic.pdbDataArray.push({'value': ''});
59629
+ // }
59630
+ // }
59631
+
59632
+ // await thisClass.parseRefPdbData(ic.pdbDataArray);
59633
+ // }
59548
59634
  }
59549
59635
  catch(err) {
59550
- var aaa = 1; //alert("Error in retrieveing reference PDB data...");
59636
+ if(!me.bNode) var aaa = 1; //alert("Error in retrieveing reference PDB data...");
59637
+ //var aaa = 1; //alert("Error in retrieveing reference PDB data...");
59551
59638
  return;
59552
59639
  }
59553
59640
  }
@@ -59628,9 +59715,23 @@ class Dssp {
59628
59715
  }
59629
59716
  }
59630
59717
 
59631
- let allPromise = Promise.allSettled(ajaxArray);
59632
59718
  try {
59633
- let dataArray2 = await allPromise;
59719
+ let dataArray2 = [];
59720
+ // if(!me.bNode) {
59721
+ let allPromise = Promise.allSettled(ajaxArray);
59722
+ dataArray2 = await allPromise;
59723
+ // }
59724
+ // else {
59725
+ // for(let i = 0, il = ajaxArray.length; i < il; ++i) {
59726
+ // try {
59727
+ // let dataTmp = await ajaxArray[i];
59728
+ // dataArray2.push({'value': dataTmp});
59729
+ // }
59730
+ // catch(err) {
59731
+ // dataArray2.push({'value': []});
59732
+ // }
59733
+ // }
59734
+ // }
59634
59735
 
59635
59736
  await thisClass.parseAlignData(dataArray2, domainidpairArray);
59636
59737
 
@@ -59638,6 +59739,7 @@ class Dssp {
59638
59739
  }
59639
59740
  catch(err) {
59640
59741
  if(!me.bNode) console.log("Error in aligning with TM-align...");
59742
+ //console.log("Error in aligning with TM-align...");
59641
59743
  return;
59642
59744
  }
59643
59745
  }
@@ -60131,11 +60233,16 @@ console.log("free energy: " + energy + " kcal/mol");
60131
60233
  return;
60132
60234
  }
60133
60235
 
60134
- let file_pref =(ic.inputid) ? ic.inputid : "custom";
60135
- let postfix = (bHydrogen) ? "add_hydrogen" : "add_missing_atoms";
60136
- if(snpStr) postfix = snpStr;
60236
+ if(!me.bNode) {
60237
+ let file_pref =(ic.inputid) ? ic.inputid : "custom";
60238
+ let postfix = (bHydrogen) ? "add_hydrogen" : "add_missing_atoms";
60239
+ if(snpStr) postfix = snpStr;
60137
60240
 
60138
- ic.saveFileCls.saveFile(file_pref + '_icn3d_' + postfix + '.pdb', 'text', [data]);
60241
+ ic.saveFileCls.saveFile(file_pref + '_icn3d_' + postfix + '.pdb', 'text', [data]);
60242
+ }
60243
+ else {
60244
+ return data;
60245
+ }
60139
60246
  }
60140
60247
  }
60141
60248
 
@@ -64177,7 +64284,7 @@ class SaveFile {
64177
64284
  line +=(resiInt.toString().length <= 4) ? resiInt.toString().padStart(4, ' ') : resiInt.toString().substr(0, 4);
64178
64285
  //line += ' '.padStart(4, ' ');
64179
64286
  // insert
64180
- let lastChar = resi.toString().substr(resi.toString().length - 1, 1);
64287
+ let lastChar = atom.resi.toString().substr(atom.resi.toString().length - 1, 1);
64181
64288
  if(isNaN(lastChar)) {
64182
64289
  line += lastChar;
64183
64290
  }
@@ -64428,6 +64535,10 @@ class SaveFile {
64428
64535
  if(!ic.inputid || ic.inputid.substr(0, 4) == ic.defaultPdbId) {
64429
64536
  $("#" + ic.pre + "title").html(title);
64430
64537
  }
64538
+ else if(me.cfg.blast_rep_id) {
64539
+ text = 'Query: ' + me.cfg.query_id + '; target: ' + me.cfg.blast_rep_id;
64540
+ $("#" + ic.pre + "title").html(text + ", " + title);
64541
+ }
64431
64542
  else {
64432
64543
  $("#" + ic.pre + "title").html(idName + " <a id='" + ic.pre + "titlelink' href='" + url + "' style='color:" + titlelinkColor + "' target='_blank'>" + text + "</a>: " + title);
64433
64544
  }
@@ -67652,7 +67763,7 @@ class iCn3DUI {
67652
67763
  //even when multiple iCn3D viewers are shown together.
67653
67764
  this.pre = this.cfg.divid + "_";
67654
67765
 
67655
- this.REVISION = '3.22.0';
67766
+ this.REVISION = '3.22.1';
67656
67767
 
67657
67768
  // In nodejs, iCn3D defines "window = {navigator: {}}"
67658
67769
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -67945,6 +68056,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
67945
68056
  }
67946
68057
  else if(me.cfg.blast_rep_id !== undefined) {
67947
68058
  // ic.bNCBI = true;
68059
+ ic.inputid = me.cfg.query_id + ',' + me.cfg.blast_rep_id;
67948
68060
 
67949
68061
  // custom seqeunce has query_id such as "Query_78989" in BLAST
67950
68062
  if(me.cfg.query_id.substr(0,5) !== 'Query' && me.cfg.rid === undefined) {
@@ -67953,8 +68065,6 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
67953
68065
  me.cfg.command = 'view annotations; set annotation cdd; set annotation site; set view detailed view; select chain 1TSR_A; show selection';
67954
68066
  }
67955
68067
 
67956
- ic.inputid = me.cfg.query_id + '_' + me.cfg.blast_rep_id;
67957
-
67958
68068
  if(me.cfg.alg == 'smithwm') {
67959
68069
  ic.loadCmd = 'load seq_struct_ids_smithwm ' + me.cfg.query_id + ',' + me.cfg.blast_rep_id;
67960
68070
  ic.bSmithwm = true;