icn3d 3.50.0 → 3.50.1

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
@@ -107764,6 +107764,7 @@ class MmdbParser {
107764
107764
  //ic.molid2color = molid2color;
107765
107765
  //ic.chain2molid = chain2molid;
107766
107766
  ic.molid2chain = molid2chain;
107767
+
107767
107768
  // small structure with all atoms
107768
107769
  // show surface options
107769
107770
  $("#" + ic.pre + "accordion5").show();
@@ -116200,7 +116201,9 @@ class LoadPDB {
116200
116201
 
116201
116202
  let bHeader = false, bFirstAtom = true;
116202
116203
 
116203
- let segId, prevSegId;
116204
+ let segId, prevSegId, entityid;
116205
+
116206
+ if(!ic.molid2chain) ic.molid2chain = {};
116204
116207
 
116205
116208
  for (let i in lines) {
116206
116209
  let line = lines[i];
@@ -116345,6 +116348,17 @@ class LoadPDB {
116345
116348
  ic.organism = line.substr(28).toLowerCase().trim();
116346
116349
 
116347
116350
  ic.organism = ic.organism.substr(0, ic.organism.length - 1);
116351
+ } else if (record === 'COMPND') {
116352
+ if(line.indexOf('MOL_ID: ') != -1) { // COMPND MOL_ID: 1;
116353
+ let itemArray = line.trim().split(' ');
116354
+ let lastItem = itemArray[itemArray.length - 1];
116355
+ entityid = lastItem.substr(0, lastItem.length - 1);
116356
+ }
116357
+ else if(line.indexOf('CHAIN: ') != -1) { // COMPND 3 CHAIN: H;
116358
+ let itemArray = line.trim().split(' ');
116359
+ let lastItem = itemArray[itemArray.length - 1];
116360
+ ic.molid2chain[parseInt(entityid)] = structure + '_' + lastItem.substr(0, lastItem.length - 1);
116361
+ }
116348
116362
  } else if (record === 'ENDMDL') {
116349
116363
  if(ic.statefileArray) {
116350
116364
  ic.struct_statefile.push({'structure': structure, 'statefile': ic.statefileArray[moleculeNum - 1]});
@@ -117421,6 +117435,7 @@ class LoadCIF {
117421
117435
  let resnArray = atom_site.getColumn("label_comp_id");
117422
117436
  let elemArray = atom_site.getColumn("type_symbol");
117423
117437
  let nameArray = atom_site.getColumn("label_atom_id");
117438
+ let entiyidArray = atom_site.getColumn("label_entity_id");
117424
117439
 
117425
117440
  let chainArray = atom_site.getColumn("auth_asym_id");
117426
117441
 
@@ -117442,6 +117457,8 @@ class LoadCIF {
117442
117457
  let prevResn;
117443
117458
  let sChain = {};
117444
117459
  let prevModelNum = '';
117460
+ if(!ic.molid2chain) ic.molid2chain = {};
117461
+
117445
117462
  for (let i = 0; i < atomSize; ++i) {
117446
117463
  let modelNum = modelNumArray.getString(i);
117447
117464
  if(i > 0 && modelNum != prevModelNum) {
@@ -117460,6 +117477,7 @@ class LoadCIF {
117460
117477
  let resn = resnArray.getString(i);
117461
117478
  let elem = elemArray.getString(i);
117462
117479
  let atom = nameArray.getString(i);
117480
+ let entityid = entiyidArray.getString(i);
117463
117481
  let chain = chainArray.getString(i);
117464
117482
  let resi = resiArray.getString(i);
117465
117483
  let oriResi = resiOriArray.getString(i);
@@ -117566,6 +117584,8 @@ class LoadCIF {
117566
117584
  chainNum = structure + "_" + chain;
117567
117585
  oriResidueNum = chainNum + "_" + oriResi;
117568
117586
 
117587
+ ic.molid2chain[parseInt(entityid)] = chainNum;
117588
+
117569
117589
  residueNum = chainNum + "_" + resi;
117570
117590
 
117571
117591
  //let chain_resi = chain + "_" + resi;
@@ -129534,19 +129554,14 @@ class Diagram2d {
129534
129554
 
129535
129555
  //https://9c5d031c.na-hackathon-2026.pages.dev/api.json
129536
129556
  //https://www.ebi.ac.uk/pdbe/static/entry/1ffk_2_9.json, or 1ffk_1_0.json [pdbid_molid_chain]
129537
- if(!ic.chainid2molid) {
129538
- ic.chainid2molid = {};
129539
-
129540
- await ic.showAnnoCls.showAnnotations();
129541
- let molidTmp = 1;
129542
- for(let id in ic.nucleotide_chainid) {
129543
- ic.chainid2molid[id] = molidTmp;
129544
- ++molidTmp;
129557
+ let molid = 1;
129558
+ for(let i in ic.molid2chain) {
129559
+ if(ic.molid2chain[i] == chainid) {
129560
+ molid = i;
129561
+ break;
129545
129562
  }
129546
129563
  }
129547
129564
 
129548
- let molid = ic.chainid2molid[chainid] ? ic.chainid2molid[chainid] : 1;
129549
-
129550
129565
  let url = "https://www.ebi.ac.uk/pdbe/static/entry/" + pdbid.toLowerCase() + "_" + molid + "_" + chain + ".json";
129551
129566
  let apiData = await me.getAjaxPromise(url, 'json', undefined, 'The chain ' + chainid + ' with molid ' + molid + ' has no R2DT information in PDBe...');
129552
129567
 
@@ -129700,7 +129715,7 @@ class Diagram2d {
129700
129715
  if(from_type_to.length != 3) continue;
129701
129716
 
129702
129717
  let fromArray = from_type_to[0].split('|'), toArray = from_type_to[2].split('|');
129703
- if(fromArray.length != 5 || toArray.length != 5) continue;
129718
+ if(fromArray.length < 5 || toArray.length < 5) continue;
129704
129719
  if(fromArray[2] != chain || toArray[2] != chain) continue;
129705
129720
  let resi1 = fromArray[4], resi2 = toArray[4];
129706
129721
  let ncbiResid1 = ic.resid2ncbi[chainid + '_' + resi1], ncbiResid2 = ic.resid2ncbi[chainid + '_' + resi2];
@@ -129900,12 +129915,12 @@ class Diagram2d {
129900
129915
  html += " rnaCanvas.drawingView.fitToContent();\n";
129901
129916
  html += " $('.UDedZ1UaiPZJsRmm1yxA').hide();\n"; // hide the "Powered by RNAcanvas" label
129902
129917
 
129903
- html += "var pos2node = {}, id2pos = {};\n";
129918
+ html += "var pos2node = {};\n";
129904
129919
  html += "var nodes = rnaCanvas.drawing.bases;\n";
129905
129920
 
129906
129921
  html += "for (var i = 0, il = nodes.length; i < il; i++) {\n";
129907
129922
  html += " pos2node[i + 1] = nodes[i];\n";
129908
- html += " id2pos[nodes[i].id] = i + 1;\n";
129923
+ html += " nodes[i].setAttribute('resi', i + 1);\n";
129909
129924
  html += "}\n";
129910
129925
 
129911
129926
  html += "$(document).on('click', '#rnacanvasSvg svg text', function(e) {\n";
@@ -129916,19 +129931,17 @@ class Diagram2d {
129916
129931
  html += " }\n";
129917
129932
  html += " $(this)[0].setAttribute('fill', '#f8b84e');\n";
129918
129933
 
129919
- html += " var pos = id2pos[id];\n";
129920
129934
  html += " var resn = $(this).text().split(' ')[0];\n"; //C Position 8
129921
- html += " $(document).trigger('from_rnacanvas', pos + '_' + resn);\n";
129935
+ html += " $(document).trigger('from_rnacanvas', $(this).attr('resi') + '_' + resn);\n";
129922
129936
  html += " document.dispatchEvent(event);\n";
129923
129937
  html += "});\n";
129924
129938
 
129925
129939
  html += "$(document).on('mouseover', '#rnacanvasSvg svg text', function(e) {\n";
129926
129940
  html += " var id = $(this).attr('id');\n";
129927
129941
  html += " $(this)[0].setAttribute('fill', '#f8b84e');\n";
129928
-
129929
129942
  html += " if(!$(this)[0].querySelector('title')) {\n";
129930
129943
  html += " var title = document.createElementNS('http://www.w3.org/2000/svg', 'title');\n";
129931
- html += " title.textContent = ' Position ' + id2pos[id];\n";
129944
+ html += " title.textContent = ' Position ' + $(this).attr('resi');\n";
129932
129945
  html += " $(this)[0].appendChild(title);\n";
129933
129946
  html += " }\n";
129934
129947
  html += "});\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.50.0",
3
+ "version": "3.50.1",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {