icn3d 3.26.8 → 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,17 +6932,17 @@ class ClickMenu {
6932
6932
  thisClass.setLogCmd("export pdb hydrogen", true);
6933
6933
  });
6934
6934
 
6935
- me.myEventCls.onIds("#" + me.pre + "m1_exportIgstrand", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6935
+ me.myEventCls.onIds("#" + me.pre + "mn1_exportIgstrand", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6936
6936
  ic.refnumCls.exportRefnum('igstrand');
6937
6937
  thisClass.setLogCmd("export refnum igstrand", true);
6938
6938
  });
6939
6939
 
6940
- me.myEventCls.onIds("#" + me.pre + "m1_exportKabat", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6940
+ me.myEventCls.onIds("#" + me.pre + "mn1_exportKabat", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6941
6941
  ic.refnumCls.exportRefnum('kabat');
6942
6942
  thisClass.setLogCmd("export refnum kabat", true);
6943
6943
  });
6944
6944
 
6945
- me.myEventCls.onIds("#" + me.pre + "m1_exportImgt", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6945
+ me.myEventCls.onIds("#" + me.pre + "mn1_exportImgt", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
6946
6946
  ic.refnumCls.exportRefnum('imgt');
6947
6947
  thisClass.setLogCmd("export refnum imgt", true);
6948
6948
  });
@@ -45438,8 +45438,8 @@ class LineGraph {
45438
45438
  // let allPromise = Promise.allSettled(ajaxArray);
45439
45439
  // dataArray2 = await allPromise;
45440
45440
 
45441
- //split arrays into chunks of 100 jobs
45442
- let n = (me.bNode) ? 96 : 96;
45441
+ //split arrays into chunks of 96 jobs or me.cfg.maxajax jobs
45442
+ let n = (me.cfg.maxajax) ? me.cfg.maxajax : 96;
45443
45443
 
45444
45444
  for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
45445
45445
  let currAjaxArray = [];
@@ -45539,6 +45539,8 @@ class LineGraph {
45539
45539
  let refpdbname = domainidpairArray[i].substr(domainidpairArray[i].indexOf('|') + 1);
45540
45540
  //let chainid = domainid.split('-')[0];
45541
45541
 
45542
+ if(!me.bNode) console.log("refpdbname " + refpdbname + " TM-score: " + queryData[0].score);
45543
+
45542
45544
  // Ig-like domains: B (2150, 2150a, 2150b), C (3150, 3250), E (7150, 7250), F (8150, 8250) strands
45543
45545
  // Ig domain may require G (7050). But we'll leave that out for now.
45544
45546
  let bBstrand = false, bCstrand = false, bEstrand = false, bFstrand = false;
@@ -49312,7 +49314,7 @@ class ChainalignParser {
49312
49314
  let chainid = chainidArray[i];
49313
49315
  let pos = chainid.indexOf('_');
49314
49316
  let struct = chainid.substr(0, pos);
49315
- if(struct != ic.defaultPdbId) struct = struct.toUpperCase();
49317
+ //if(struct != ic.defaultPdbId) struct = struct.toUpperCase();
49316
49318
 
49317
49319
  if(!struct2cnt.hasOwnProperty(struct)) {
49318
49320
  struct2cnt[struct] = 1;
@@ -52562,7 +52564,7 @@ class RealignParser {
52562
52564
  let pos = chainidArray[i].indexOf('_');
52563
52565
  let mmdbid = chainidArray[i].substr(0, pos); //.toUpperCase();
52564
52566
 
52565
- if(!bRealign) mmdbid = mmdbid.toUpperCase();
52567
+ // if(!bRealign) mmdbid = mmdbid.toUpperCase();
52566
52568
 
52567
52569
  if(i == 0) {
52568
52570
  mmdbid_t = mmdbid;
@@ -52741,14 +52743,12 @@ class RealignParser {
52741
52743
  for(let j = 0, jl = resiArray.length; j < jl; ++j) {
52742
52744
  if(resiArray[j].indexOf('-') != -1) {
52743
52745
  let startEnd = resiArray[j].split('-');
52744
-
52745
52746
  for(let k = parseInt(startEnd[0]); k <= parseInt(startEnd[1]); ++k) {
52746
52747
  // from VAST neighbor page, use NCBI residue number
52747
52748
  //if(me.cfg.usepdbnum === false) k += base - 1;
52748
52749
 
52749
52750
  //let seqIndex = k - base;
52750
52751
  let seqIndex = ic.setSeqAlignCls.getPosFromResi(chainid, k);
52751
-
52752
52752
  // if(ic.bNCBI) {
52753
52753
  // let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[chainid + '_' + k]);
52754
52754
  // if(atom && atom.resiNCBI) seqIndex = atom.resiNCBI - 1;
@@ -52765,9 +52765,9 @@ class RealignParser {
52765
52765
  }
52766
52766
  }
52767
52767
  else { // one residue
52768
+
52768
52769
  //let k = parseInt(resiArray[j]);
52769
52770
  let k = resiArray[j];
52770
-
52771
52771
  // from VAST neighbor page, use NCBI residue number
52772
52772
  //if(me.cfg.usepdbnum === false) k += base - 1;
52773
52773
 
@@ -55691,22 +55691,23 @@ class SetSeqAlign {
55691
55691
  }
55692
55692
 
55693
55693
  getPosFromResi(chainid, resi) { let ic = this.icn3d; ic.icn3dui;
55694
- /*
55695
- let pos = undefined; //parseInt(resi);
55696
-
55697
- for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
55698
- if(ic.chainsSeq[chainid][i].resi == resi) {
55699
- pos = i;
55700
- break;
55701
- }
55702
- }
55703
- */
55704
55694
  let residNCBI = ic.resid2ncbi[chainid + '_' + resi];
55705
55695
  let pos = undefined;
55696
+
55706
55697
  if(residNCBI) {
55707
55698
  let resiNCBI = residNCBI.substr(residNCBI.lastIndexOf('_') + 1);
55708
55699
  pos = resiNCBI - 1;
55709
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
+ // }
55710
55711
 
55711
55712
  return pos;
55712
55713
  }
@@ -57165,6 +57166,7 @@ class LoadPDB {
57165
57166
 
57166
57167
  // different residue
57167
57168
  //if(residueNum !== prevResidueNum) {
57169
+
57168
57170
  if(oriResidueNum !== prevOriResidueNum) {
57169
57171
  let residue = me.utilsCls.residueName2Abbr(resn);
57170
57172
  ic.residueId2Name[residueNum] = residue;
@@ -68362,6 +68364,26 @@ class SaveFile {
68362
68364
  return html;
68363
68365
  }
68364
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
+
68365
68387
  //getAtomPDB: function(atomHash, bPqr, bPdb, bNoChem) { let ic = this.icn3d, me = ic.icn3dui;
68366
68388
  getAtomPDB(atomHash, bPqr, bNoChem, bNoHeader, chainResi2pdb, pdbid) { let ic = this.icn3d, me = ic.icn3dui;
68367
68389
  let pdbStr = '';
@@ -68394,8 +68416,6 @@ class SaveFile {
68394
68416
 
68395
68417
  let calphaHash = me.hashUtilsCls.intHash(atomHash, ic.calphas);
68396
68418
  let helixStr = 'HELIX', sheetStr = 'SHEET';
68397
- let bHelixBegin = false, bHelixEnd = true;
68398
- let bSheetBegin = false, bSheetEnd = true;
68399
68419
 
68400
68420
  let stru2header = {};
68401
68421
  for(let stru in ic.structures) {
@@ -68403,48 +68423,82 @@ class SaveFile {
68403
68423
  }
68404
68424
 
68405
68425
  // if(!bNoSs) {
68406
- let prevResi, stru, chainid;
68426
+ let prevResi, stru;
68427
+ let ssArray = [];
68407
68428
  for(let i in calphaHash) {
68408
68429
  let atom = ic.atoms[i];
68409
68430
  stru = atom.structure;
68410
- chainid = atom.structure + '_' + atom.chain;
68431
+ atom.structure + '_' + atom.chain;
68411
68432
 
68412
- if(atom.ssbegin) {
68413
- if(atom.ss == 'helix') {
68414
- bHelixBegin = true;
68415
- if(bHelixEnd) stru2header[stru] += helixStr.padEnd(15, ' ') + atom.resn.padStart(3, ' ') + atom.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68416
- + atom.resi.toString().padStart(5, ' ');
68417
- bHelixEnd = false;
68418
- prevResi = atom.resi;
68419
- }
68420
- else if(atom.ss == 'sheet') {
68421
- bSheetBegin = true;
68422
- if(bSheetEnd) stru2header[stru] += sheetStr.padEnd(17, ' ') + atom.resn.padStart(3, ' ') + atom.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68423
- + atom.resi.toString().padStart(4, ' ');
68424
- bSheetEnd = false;
68425
- }
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);
68426
68450
  }
68427
68451
 
68428
68452
  if(atom.ssend) {
68429
- if(atom.ss == 'helix') {
68430
- bHelixEnd = true;
68431
- let residEnd = ic.resid2ncbi[chainid + '_' + atom.resi];
68432
- let residStart = ic.resid2ncbi[chainid + '_' + prevResi];
68433
- let helixLen = (residEnd && residStart) ? parseInt(residEnd.substr(residEnd.lastIndexOf('_') + 1)) - parseInt(residStart.substr(residStart.lastIndexOf('_') + 1)) : 0;
68434
- let helixType = 1;
68435
- if(bHelixBegin) stru2header[stru] += atom.resn.padStart(5, ' ') + atom.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68436
- + atom.resi.toString().padStart(5, ' ') + ' ' + helixType + helixLen.toString().padStart(36, ' ') + '\n';
68437
- bHelixBegin = false;
68438
- }
68439
- else if(atom.ss == 'sheet') {
68440
- bSheetEnd = true;
68441
- let sense = 0;
68442
- if(bSheetBegin) stru2header[stru] += atom.resn.padStart(5, ' ') + atom.chain.replace(/_/gi, '').substr(0, 2).padStart(2, ' ')
68443
- + atom.resi.toString().padStart(4, ' ') + ' ' + sense + '\n';
68444
- 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
+ }
68445
68488
  }
68446
68489
  }
68490
+
68491
+ if(ssObj.ss != ' ') {
68492
+ ++ssCnt;
68493
+ prevRealSsObj = ssObj;
68494
+ }
68495
+
68496
+ prevSs = ssObj.ss;
68447
68497
  }
68498
+
68499
+ // print prev
68500
+ stru2header[stru] += this.printPrevSecondary(bHelix, bSheet, prevRealSsObj, ssCnt);
68501
+
68448
68502
  // add a new line in case the structure is a subset
68449
68503
  stru2header[stru] += '\n';
68450
68504
  // }
@@ -68875,7 +68929,7 @@ class SaveFile {
68875
68929
  let structureidArray = Object.keys(idHash);
68876
68930
  inputid = structureidArray.join(',');
68877
68931
 
68878
- text = inputid.toUpperCase();
68932
+ text = (me.cfg.refseqid) ? ic.inputid : inputid.toUpperCase();
68879
68933
 
68880
68934
  //idName = (isNaN(inputid) && inputid.length > 5) ? "AlphaFold ID" : "PDB ID";
68881
68935
  if(bPdb && bAlphaFold) {
@@ -72365,6 +72419,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
72365
72419
  }
72366
72420
  else if(me.cfg.resdef !== undefined && me.cfg.matchedchains !== undefined) {
72367
72421
  let stru_t = Object.keys(ic.structures)[0];
72422
+
72368
72423
  let chain_t = stru_t + '_' + me.cfg.masterchain;
72369
72424
  let domainidArray = me.cfg.matchedchains.split(',');
72370
72425
  let chainidArray = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.26.8",
3
+ "version": "3.26.9",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {