icn3d 3.26.7 → 3.26.9

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.module.js CHANGED
@@ -6932,6 +6932,21 @@ class ClickMenu {
6932
6932
  thisClass.setLogCmd("export pdb hydrogen", true);
6933
6933
  });
6934
6934
 
6935
+ me.myEventCls.onIds("#" + me.pre + "mn1_exportIgstrand", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6936
+ ic.refnumCls.exportRefnum('igstrand');
6937
+ thisClass.setLogCmd("export refnum igstrand", true);
6938
+ });
6939
+
6940
+ me.myEventCls.onIds("#" + me.pre + "mn1_exportKabat", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6941
+ ic.refnumCls.exportRefnum('kabat');
6942
+ thisClass.setLogCmd("export refnum kabat", true);
6943
+ });
6944
+
6945
+ me.myEventCls.onIds("#" + me.pre + "mn1_exportImgt", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6946
+ ic.refnumCls.exportRefnum('imgt');
6947
+ thisClass.setLogCmd("export refnum imgt", true);
6948
+ });
6949
+
6935
6950
  me.myEventCls.onIds("#" + me.pre + "mn1_exportStl", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
6936
6951
  thisClass.setLogCmd("export stl file", false);
6937
6952
  //ic.threeDPrintCls.hideStabilizer();
@@ -9504,6 +9519,16 @@ class SetMenu {
9504
9519
  html += this.getLink('mn1_exportSecondary', 'Secondary Structure', undefined, 2);
9505
9520
  }
9506
9521
 
9522
+ //!!!
9523
+ /*
9524
+ html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
9525
+ html += "<ul>";
9526
+ html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
9527
+ html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
9528
+ html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
9529
+ html += "</ul>";
9530
+ */
9531
+
9507
9532
  html += "<li><br/></li>";
9508
9533
 
9509
9534
  html += "</ul>";
@@ -13760,7 +13785,7 @@ class Events {
13760
13785
  if(esmfold_fasta.indexOf('>') != -1) { //FASTA with header
13761
13786
  let pos = esmfold_fasta.indexOf('\n');
13762
13787
  ic.esmTitle = esmfold_fasta.substr(1, pos - 1).trim();
13763
- pdbid = ic.esmTitle.substr(0, ic.esmTitle.indexOf(' '));
13788
+ pdbid = (ic.esmTitle.indexOf(' ') != -1) ? ic.esmTitle.substr(0, ic.esmTitle.indexOf(' ')) : ic.esmTitle;
13764
13789
  if(pdbid.length < 6) pdbid = pdbid.padEnd(6, '-');
13765
13790
 
13766
13791
  esmfold_fasta = esmfold_fasta.substr(pos + 1);
@@ -42993,6 +43018,7 @@ class ShowSeq {
42993
43018
  break;
42994
43019
  }
42995
43020
  }
43021
+
42996
43022
  if(kabat_or_imgt == 1 && !bKabatFound) {
42997
43023
  return {html: '', html3: ''};
42998
43024
  }
@@ -45336,9 +45362,14 @@ class LineGraph {
45336
45362
  domainAtomsArray.push(currAtoms);
45337
45363
 
45338
45364
  let residueArray = ic.resid2specCls.atoms2residues(Object.keys(currAtoms));
45365
+
45366
+ let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(currAtoms);
45367
+ let atomLast = ic.firstAtomObjCls.getLastAtomObj(currAtoms);
45368
+ let resiSum = parseInt(atomFirst.resi) + parseInt(atomLast.resi);
45369
+
45339
45370
  for(let n = 0, nl = residueArray.length; n < nl; ++n) {
45340
45371
  let resid = residueArray[n];
45341
- ic.resid2domainid[resid] = chainid + '-0' + '_' + Object.keys(currAtoms).length;
45372
+ ic.resid2domainid[resid] = chainid + '-0' + '_' + resiSum;
45342
45373
  }
45343
45374
  }
45344
45375
  else {
@@ -45358,13 +45389,17 @@ class LineGraph {
45358
45389
 
45359
45390
  domainAtomsArray.push(domainAtoms);
45360
45391
 
45392
+ let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(domainAtoms);
45393
+ let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtoms);
45394
+ let resiSum = parseInt(atomFirst.resi) + parseInt(atomLast.resi);
45395
+
45361
45396
  for(let m = 0, ml = segArray.length; m < ml; m += 2) {
45362
45397
  let startResi = segArray[m];
45363
45398
  let endResi = segArray[m+1];
45364
45399
  for(let n = parseInt(startResi); n <= parseInt(endResi); ++n) {
45365
45400
  let resid = chainid + '_' + pos2resi[n];
45366
45401
  //domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
45367
- ic.resid2domainid[resid] = chainid + '-' + k + '_' + Object.keys(domainAtoms).length;
45402
+ ic.resid2domainid[resid] = chainid + '-' + k + '_' + resiSum;
45368
45403
  }
45369
45404
  }
45370
45405
  }
@@ -45403,8 +45438,8 @@ class LineGraph {
45403
45438
  // let allPromise = Promise.allSettled(ajaxArray);
45404
45439
  // dataArray2 = await allPromise;
45405
45440
 
45406
- //split arrays into chunks of 100 jobs
45407
- let n = (me.bNode) ? 16 : 96;
45441
+ //split arrays into chunks of 96 jobs or me.cfg.maxajax jobs
45442
+ let n = (me.cfg.maxajax) ? me.cfg.maxajax : 96;
45408
45443
 
45409
45444
  for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
45410
45445
  let currAjaxArray = [];
@@ -45504,6 +45539,8 @@ class LineGraph {
45504
45539
  let refpdbname = domainidpairArray[i].substr(domainidpairArray[i].indexOf('|') + 1);
45505
45540
  //let chainid = domainid.split('-')[0];
45506
45541
 
45542
+ if(!me.bNode) console.log("refpdbname " + refpdbname + " TM-score: " + queryData[0].score);
45543
+
45507
45544
  // Ig-like domains: B (2150, 2150a, 2150b), C (3150, 3250), E (7150, 7250), F (8150, 8250) strands
45508
45545
  // Ig domain may require G (7050). But we'll leave that out for now.
45509
45546
  let bBstrand = false, bCstrand = false, bEstrand = false, bFstrand = false;
@@ -45627,6 +45664,8 @@ class LineGraph {
45627
45664
  if(!ic.resid2refnum) ic.resid2refnum = {};
45628
45665
  if(!ic.refnum2residArray) ic.refnum2residArray = {};
45629
45666
  if(!ic.chainsMapping) ic.chainsMapping = {};
45667
+
45668
+ if(!ic.refPdbList) ic.refPdbList = [];
45630
45669
  for(let chainid in chainid2segs) {
45631
45670
  let segArray = chainid2segs[chainid];
45632
45671
 
@@ -45635,7 +45674,8 @@ class LineGraph {
45635
45674
  let chainList = this.getTemplateList(chainid);
45636
45675
 
45637
45676
  //if(!me.bNode) console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
45638
- console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
45677
+ if(!me.bNode) console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
45678
+ ic.refPdbList.push("The reference PDB(s) for chain " + chainid + " are " + chainList);
45639
45679
 
45640
45680
  let prevStrand;
45641
45681
  let bCd19 = refpdbnameArray.length == 1 && refpdbnameArray[0] == 'CD19_6al5A_human_C2orV-n1';
@@ -45818,9 +45858,121 @@ class LineGraph {
45818
45858
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
45819
45859
  }
45820
45860
 
45821
- rmStrandFromRefnumlabel(refnumLabel) {
45861
+ rmStrandFromRefnumlabel(refnumLabel) { let ic = this.icn3d; ic.icn3dui;
45822
45862
  return (!refnumLabel) ? refnumLabel : refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
45823
45863
  }
45864
+
45865
+ exportRefnum(type) { let ic = this.icn3d, me = ic.icn3dui;
45866
+ let refData = '';
45867
+
45868
+ // 1. show IgStrand ref numbers
45869
+ if(type == 'igstrand' || type == 'IgStrand') {
45870
+ // iGStrand reference numbers were adjusted when showing in sequences
45871
+ if(me.bNode) {
45872
+ for(let chnid in ic.chains) {
45873
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.chains[chnid]);
45874
+ if(ic.proteins.hasOwnProperty(atom.serial)) {
45875
+ let giSeq = [];
45876
+ for(let i = 0; i < ic.chainsSeq[chnid].length; ++i) {
45877
+ giSeq.push(ic.chainsSeq[chnid][i].name);
45878
+ }
45879
+ ic.showSeqCls.showRefNum(giSeq, chnid);
45880
+ }
45881
+ }
45882
+ }
45883
+
45884
+ let resid2refnum = {};
45885
+ for(let resid in ic.resid2refnum) {
45886
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
45887
+ if(!atom) continue;
45888
+
45889
+ let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
45890
+
45891
+ let domainid = ic.resid2domainid[resid];
45892
+ let refnumLabel = ic.resid2refnum[resid];
45893
+
45894
+ if(refnumLabel) {
45895
+ let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
45896
+ (ic.domainid2ig2kabat[domainid]) ? ic.domainid2ig2kabat[domainid][refnumStr_ori] : undefined;
45897
+ }
45898
+
45899
+ if(ic.resid2refnum[resid]) {
45900
+ if(ic.residIgLoop.hasOwnProperty(resid)) { // loop
45901
+ resid2refnum[resid + '_' + resn] = ic.resid2refnum[resid] + '_loop';
45902
+ }
45903
+ else {
45904
+ resid2refnum[resid + '_' + resn] = ic.resid2refnum[resid];
45905
+ }
45906
+ }
45907
+ }
45908
+
45909
+ refData += '{"ref PDB" : ' + JSON.stringify(ic.refPdbList) + ",\n";
45910
+
45911
+ refData += '"data": {\n';
45912
+ for(let chnid in ic.chains) {
45913
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.chains[chnid]);
45914
+ if(ic.proteins.hasOwnProperty(atom.serial)) {
45915
+ for(let i = 0; i < ic.chainsSeq[chnid].length; ++i) {
45916
+ const resid = chnid + '_' + ic.chainsSeq[chnid][i].resi + '_' + ic.chainsSeq[chnid][i].name;
45917
+
45918
+ refData += "'" + resid + "': '" + resid2refnum[resid] + "',\n";
45919
+ }
45920
+ }
45921
+ }
45922
+ refData += '}\n';
45923
+ refData += '}\n';
45924
+ }
45925
+ // 2. show Kabat ref numbers
45926
+ else if(type == 'kabat' || type == 'Kabat') {
45927
+ let resid2kabat = {};
45928
+ for(let resid in ic.resid2refnum) {
45929
+ let domainid = ic.resid2domainid[resid];
45930
+ let refnumStr, refnumLabel = ic.resid2refnum[resid];
45931
+
45932
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
45933
+ let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
45934
+
45935
+ if(refnumLabel) {
45936
+ let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
45937
+ refnumStr = (ic.domainid2ig2kabat[domainid]) ? ic.domainid2ig2kabat[domainid][refnumStr_ori] : undefined;
45938
+ }
45939
+
45940
+ resid2kabat[resid + '_' + resn] = refnumStr;
45941
+ }
45942
+
45943
+ refData += JSON.stringify(resid2kabat);
45944
+ }
45945
+ // 3. show IMGT ref numbers
45946
+ else if(type == 'imgt'|| type == 'IMGT') {
45947
+ let resid2imgt = {};
45948
+ for(let resid in ic.resid2refnum) {
45949
+ let domainid = ic.resid2domainid[resid];
45950
+ let refnumStr, refnumLabel = ic.resid2refnum[resid];
45951
+
45952
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
45953
+ let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
45954
+
45955
+ if(refnumLabel) {
45956
+ let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
45957
+ refnumStr = (ic.domainid2ig2imgt[domainid]) ? ic.domainid2ig2imgt[domainid][refnumStr_ori] : undefined;
45958
+ }
45959
+
45960
+ resid2imgt[resid + '_' + resn] = refnumStr;
45961
+ }
45962
+
45963
+ refData += JSON.stringify(resid2imgt);
45964
+ }
45965
+
45966
+
45967
+ if(!me.bNode) {
45968
+ let file_pref = Object.keys(me.utilsCls.getHlStructures()).join(',');
45969
+
45970
+ ic.saveFileCls.saveFile(file_pref + '_refnum_' + type + '.txt', 'text', [refData]);
45971
+ }
45972
+ else {
45973
+ return refData;
45974
+ }
45975
+ }
45824
45976
  }
45825
45977
 
45826
45978
  /**
@@ -49162,7 +49314,7 @@ class ChainalignParser {
49162
49314
  let chainid = chainidArray[i];
49163
49315
  let pos = chainid.indexOf('_');
49164
49316
  let struct = chainid.substr(0, pos);
49165
- if(struct != ic.defaultPdbId) struct = struct.toUpperCase();
49317
+ //if(struct != ic.defaultPdbId) struct = struct.toUpperCase();
49166
49318
 
49167
49319
  if(!struct2cnt.hasOwnProperty(struct)) {
49168
49320
  struct2cnt[struct] = 1;
@@ -52412,7 +52564,7 @@ class RealignParser {
52412
52564
  let pos = chainidArray[i].indexOf('_');
52413
52565
  let mmdbid = chainidArray[i].substr(0, pos); //.toUpperCase();
52414
52566
 
52415
- if(!bRealign) mmdbid = mmdbid.toUpperCase();
52567
+ // if(!bRealign) mmdbid = mmdbid.toUpperCase();
52416
52568
 
52417
52569
  if(i == 0) {
52418
52570
  mmdbid_t = mmdbid;
@@ -52591,14 +52743,12 @@ class RealignParser {
52591
52743
  for(let j = 0, jl = resiArray.length; j < jl; ++j) {
52592
52744
  if(resiArray[j].indexOf('-') != -1) {
52593
52745
  let startEnd = resiArray[j].split('-');
52594
-
52595
52746
  for(let k = parseInt(startEnd[0]); k <= parseInt(startEnd[1]); ++k) {
52596
52747
  // from VAST neighbor page, use NCBI residue number
52597
52748
  //if(me.cfg.usepdbnum === false) k += base - 1;
52598
52749
 
52599
52750
  //let seqIndex = k - base;
52600
52751
  let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
52601
-
52602
52752
  // if(ic.bNCBI) {
52603
52753
  // let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
52604
52754
  // if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
@@ -52615,9 +52765,9 @@ class RealignParser {
52615
52765
  }
52616
52766
  }
52617
52767
  else { // one residue
52768
+
52618
52769
  //let k = parseInt(resiArray[j]);
52619
52770
  let k = resiArray[j];
52620
-
52621
52771
  // from VAST neighbor page, use NCBI residue number
52622
52772
  //if(me.cfg.usepdbnum === false) k += base - 1;
52623
52773
 
@@ -55541,22 +55691,23 @@ class SetSeqAlign {
55541
55691
  }
55542
55692
 
55543
55693
  getPosFromResi(chainid, resi) { let ic = this.icn3d; ic.icn3dui;
55544
- /*
55545
- let pos = undefined; //parseInt(resi);
55546
-
55547
- for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
55548
- if(ic.chainsSeq[chainid][i].resi == resi) {
55549
- pos = i;
55550
- break;
55551
- }
55552
- }
55553
- */
55554
55694
  let residNCBI = ic.resid2ncbi[chainid + '_' + resi];
55555
55695
  let pos = undefined;
55696
+
55556
55697
  if(residNCBI) {
55557
55698
  let resiNCBI = residNCBI.substr(residNCBI.lastIndexOf('_') + 1);
55558
55699
  pos = resiNCBI - 1;
55559
55700
  }
55701
+ // else {
55702
+ // //let il = ic.chainsSeq[chainid].length;
55703
+ // let il = (ic.chainsSeq[chainid]) ? ic.chainsSeq[chainid].length : 0;
55704
+ // for(let i = 0; i < il; ++i) {
55705
+ // if(ic.chainsSeq[chainid][i].resi == resi) {
55706
+ // pos = i;
55707
+ // break;
55708
+ // }
55709
+ // }
55710
+ // }
55560
55711
 
55561
55712
  return pos;
55562
55713
  }
@@ -57015,6 +57166,7 @@ class LoadPDB {
57015
57166
 
57016
57167
  // different residue
57017
57168
  //if(residueNum !== prevResidueNum) {
57169
+
57018
57170
  if(oriResidueNum !== prevOriResidueNum) {
57019
57171
  let residue = me.utilsCls.residueName2Abbr(resn);
57020
57172
  ic.residueId2Name[residueNum] = residue;
@@ -58355,6 +58507,11 @@ class ApplyCommand {
58355
58507
  else if(command == 'export pdb hydrogen') {
58356
58508
  await ic.scapCls.exportPdbProfix(true);
58357
58509
  }
58510
+ else if(command.indexOf('export refnum ') != -1) {
58511
+ let type = command.substr(14);
58512
+
58513
+ ic.refnumCls.exportRefnum(type);
58514
+ }
58358
58515
  else if(command == 'export secondary structure') {
58359
58516
  me.htmlCls.setHtmlCls.exportSecondary();
58360
58517
  }
@@ -68207,6 +68364,26 @@ class SaveFile {
68207
68364
  return html;
68208
68365
  }
68209
68366
 
68367
+ printPrevSecondary(bHelix, bSheet, prevRealSsObj, ssCnt) { let ic = this.icn3d; ic.icn3dui;
68368
+ let ssText = '';
68369
+
68370
+ // print prev
68371
+ if(prevRealSsObj) {
68372
+ if(bHelix) {
68373
+ let helixType = 1;
68374
+ ssText += prevRealSsObj.resn.padStart(5, ' ') + prevRealSsObj.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68375
+ + prevRealSsObj.resi.toString().padStart(5, ' ') + ' ' + helixType + ssCnt.toString().padStart(36, ' ') + '\n';
68376
+ }
68377
+ else if(bSheet) {
68378
+ let sense = 0;
68379
+ ssText += prevRealSsObj.resn.padStart(5, ' ') + prevRealSsObj.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68380
+ + prevRealSsObj.resi.toString().padStart(4, ' ') + ' ' + sense + '\n';
68381
+ }
68382
+ }
68383
+
68384
+ return ssText;
68385
+ }
68386
+
68210
68387
  //getAtomPDB: function(atomHash, bPqr, bPdb, bNoChem) { let ic = this.icn3d, me = ic.icn3dui;
68211
68388
  getAtomPDB(atomHash, bPqr, bNoChem, bNoHeader, chainResi2pdb, pdbid) { let ic = this.icn3d, me = ic.icn3dui;
68212
68389
  let pdbStr = '';
@@ -68239,8 +68416,6 @@ class SaveFile {
68239
68416
 
68240
68417
  let calphaHash = me.hashUtilsCls.intHash(atomHash, ic.calphas);
68241
68418
  let helixStr = 'HELIX', sheetStr = 'SHEET';
68242
- let bHelixBegin = false, bHelixEnd = true;
68243
- let bSheetBegin = false, bSheetEnd = true;
68244
68419
 
68245
68420
  let stru2header = {};
68246
68421
  for(let stru in ic.structures) {
@@ -68248,48 +68423,82 @@ class SaveFile {
68248
68423
  }
68249
68424
 
68250
68425
  // if(!bNoSs) {
68251
- let prevResi, stru, chainid;
68426
+ let prevResi, stru;
68427
+ let ssArray = [];
68252
68428
  for(let i in calphaHash) {
68253
68429
  let atom = ic.atoms[i];
68254
68430
  stru = atom.structure;
68255
- chainid = atom.structure + '_' + atom.chain;
68431
+ atom.structure + '_' + atom.chain;
68256
68432
 
68257
- if(atom.ssbegin) {
68258
- if(atom.ss == 'helix') {
68259
- bHelixBegin = true;
68260
- if(bHelixEnd) stru2header[stru] += helixStr.padEnd(15, ' ') + atom.resn.padStart(3, ' ') + atom.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68261
- + atom.resi.toString().padStart(5, ' ');
68262
- bHelixEnd = false;
68263
- prevResi = atom.resi;
68264
- }
68265
- else if(atom.ss == 'sheet') {
68266
- bSheetBegin = true;
68267
- if(bSheetEnd) stru2header[stru] += sheetStr.padEnd(17, ' ') + atom.resn.padStart(3, ' ') + atom.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68268
- + atom.resi.toString().padStart(4, ' ');
68269
- bSheetEnd = false;
68270
- }
68433
+ let ssObj = {};
68434
+ ssObj.chain = atom.chain;
68435
+ ssObj.resn = atom.resn;
68436
+ ssObj.resi = atom.resi;
68437
+
68438
+ if(parseInt(atom.resi) > parseInt(prevResi) + 1) {
68439
+ ssObj.ss = ' ';
68440
+ ssArray.push(ssObj);
68441
+ }
68442
+
68443
+ if(atom.ss == 'helix') {
68444
+ ssObj.ss = 'H';
68445
+ ssArray.push(ssObj);
68446
+ }
68447
+ else if(atom.ss == 'sheet') {
68448
+ ssObj.ss = 'S';
68449
+ ssArray.push(ssObj);
68271
68450
  }
68272
68451
 
68273
68452
  if(atom.ssend) {
68274
- if(atom.ss == 'helix') {
68275
- bHelixEnd = true;
68276
- let residEnd = ic.resid2ncbi[chainid + '_' + atom.resi];
68277
- let residStart = ic.resid2ncbi[chainid + '_' + prevResi];
68278
- let helixLen = (residEnd && residStart) ? parseInt(residEnd.substr(residEnd.lastIndexOf('_') + 1)) - parseInt(residStart.substr(residStart.lastIndexOf('_') + 1)) : 0;
68279
- let helixType = 1;
68280
- if(bHelixBegin) stru2header[stru] += atom.resn.padStart(5, ' ') + atom.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68281
- + atom.resi.toString().padStart(5, ' ') + ' ' + helixType + helixLen.toString().padStart(36, ' ') + '\n';
68282
- bHelixBegin = false;
68283
- }
68284
- else if(atom.ss == 'sheet') {
68285
- bSheetEnd = true;
68286
- let sense = 0;
68287
- if(bSheetBegin) stru2header[stru] += atom.resn.padStart(5, ' ') + atom.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68288
- + atom.resi.toString().padStart(4, ' ') + ' ' + sense + '\n';
68289
- bSheetBegin = false;
68453
+ let ssObj2 = me.hashUtilsCls.cloneHash(ssObj);
68454
+ ssObj2.ss = ' ';
68455
+ ssArray.push(ssObj2);
68456
+ }
68457
+
68458
+ prevResi = atom.resi;
68459
+ }
68460
+
68461
+ let prevSs, prevRealSsObj, ssCnt = 0, bHelix = false, bSheet = false;
68462
+ for(let i = 0, il = ssArray.length; i < il; ++i) {
68463
+ let ssObj = ssArray[i];
68464
+
68465
+ if(ssObj.ss != prevSs) {
68466
+ // print prev
68467
+ stru2header[stru] += this.printPrevSecondary(bHelix, bSheet, prevRealSsObj, ssCnt);
68468
+
68469
+ // print current
68470
+ ssCnt = 0;
68471
+ bHelix = false;
68472
+ bSheet = false;
68473
+ prevRealSsObj = undefined;
68474
+
68475
+ if(ssObj.ss != ' ') {
68476
+ if(ssObj.ss == 'H') {
68477
+ bHelix = true;
68478
+ prevRealSsObj = ssObj;
68479
+ stru2header[stru] += helixStr.padEnd(15, ' ') + ssObj.resn.padStart(3, ' ') + ssObj.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68480
+ + ssObj.resi.toString().padStart(5, ' ');
68481
+ }
68482
+ else if(ssObj.ss == 'S') {
68483
+ bSheet = true;
68484
+ prevRealSsObj = ssObj;
68485
+ stru2header[stru] += sheetStr.padEnd(17, ' ') + ssObj.resn.padStart(3, ' ') + ssObj.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68486
+ + ssObj.resi.toString().padStart(4, ' ');
68487
+ }
68290
68488
  }
68291
68489
  }
68490
+
68491
+ if(ssObj.ss != ' ') {
68492
+ ++ssCnt;
68493
+ prevRealSsObj = ssObj;
68494
+ }
68495
+
68496
+ prevSs = ssObj.ss;
68292
68497
  }
68498
+
68499
+ // print prev
68500
+ stru2header[stru] += this.printPrevSecondary(bHelix, bSheet, prevRealSsObj, ssCnt);
68501
+
68293
68502
  // add a new line in case the structure is a subset
68294
68503
  stru2header[stru] += '\n';
68295
68504
  // }
@@ -68720,7 +68929,7 @@ class SaveFile {
68720
68929
  let structureidArray = Object.keys(idHash);
68721
68930
  inputid = structureidArray.join(',');
68722
68931
 
68723
- text = inputid.toUpperCase();
68932
+ text = (me.cfg.refseqid) ? ic.inputid : inputid.toUpperCase();
68724
68933
 
68725
68934
  //idName = (isNaN(inputid) && inputid.length > 5) ? "AlphaFold ID" : "PDB ID";
68726
68935
  if(bPdb && bAlphaFold) {
@@ -72210,6 +72419,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
72210
72419
  }
72211
72420
  else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
72212
72421
  let stru_t = Object.keys(ic.structures)[0];
72422
+
72213
72423
  let chain_t = stru_t + '_' + me.cfg.masterchain;
72214
72424
  let domainidArray = me.cfg.matchedchains.split(',');
72215
72425
  let chainidArray = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.26.7",
3
+ "version": "3.26.9",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {