Skip to content

Commit

Permalink
Pull request #668: Improved the conversion of chemical SMILES to 3D s…
Browse files Browse the repository at this point in the history
…tructure by showing double bonds.

Merge in STRUC/icn3d from release3381 to master

* commit '912ff667b318b40c69b37334d5eb2087718a2573':
  Improved the conversion of chemical SMILES to 3D structure by showing double bonds.
  • Loading branch information
jiywang3 committed Nov 15, 2024
2 parents 5b1d47d + 912ff66 commit e3e884f
Show file tree
Hide file tree
Showing 21 changed files with 101 additions and 67 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Change Log
[icn3d-3.38.1](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.38.1.zip) was release on November 14, 2024. Improved the conversion of chemical SMILES to 3D structure by showing double bonds.

[icn3d-3.38.0](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.38.0.zip) was release on November 12, 2024. Enabled to convert chemical SMILES to 3D structure via the menu "File > Retrieve by ID > Chemical SMILES".

[icn3d-3.37.0](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.37.0.zip) was release on October 16, 2024. Added a menu "Style > Clashed Residues > Hide" to hide clashed residues.
Expand Down
22 changes: 14 additions & 8 deletions build/icn3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -37851,6 +37851,10 @@ var icn3d = (function (exports) {
for(let i in atomlistTarget) {
//var oriAtom = atomlistTarget[i];
let oriAtom = ic.atoms[i];

// skip hydrogen atoms
if(bInteraction && oriAtom.elem == 'H') continue;

let r1 = me.parasCls.vdwRadii[oriAtom.elem.toUpperCase()];
let chainid1 = oriAtom.structure + '_' + oriAtom.chain;

Expand All @@ -37877,6 +37881,10 @@ var icn3d = (function (exports) {

for (let j in neighbors) {
let atom = neighbors[j];

// skip hydrogen atoms
if(bInteraction && atom.elem == 'H') continue;

let r2 = me.parasCls.vdwRadii[atom.elem.toUpperCase()];
let chainid2 = atom.structure + '_' + atom.chain;

Expand Down Expand Up @@ -58739,16 +58747,14 @@ var icn3d = (function (exports) {
}

async downloadSmiles(smiles) { let ic = this.icn3d, me = ic.icn3dui;
let urlSmiles = me.htmlCls.baseUrl + "openbabel/openbabel.cgi?smiles2pdb=" + smiles;
let pdbStr = await me.getAjaxPromise(urlSmiles, 'text');
let urlSmiles = me.htmlCls.baseUrl + "openbabel/openbabel.cgi?smiles2sdf=" + smiles;
let sdfStr = await me.getAjaxPromise(urlSmiles, 'text');

ic.init();

ic.bInputfile = true;
ic.InputfileType = 'pdb';
ic.InputfileData = (ic.InputfileData) ? ic.InputfileData + '\nENDMDL\n' + pdbStr : pdbStr;

await ic.pdbParserCls.loadPdbData(pdbStr);
ic.InputfileData = (ic.InputfileData) ? ic.InputfileData + '\nENDMDL\n' + sdfStr : sdfStr;
ic.InputfileType = 'sdf';
await ic.sdfParserCls.loadSdfData(sdfStr);
}

async loadSdfData(data) { let ic = this.icn3d, me = ic.icn3dui;
Expand Down Expand Up @@ -83375,7 +83381,7 @@ var icn3d = (function (exports) {
//even when multiple iCn3D viewers are shown together.
this.pre = this.cfg.divid + "_";

this.REVISION = '3.38.0';
this.REVISION = '3.38.1';

// In nodejs, iCn3D defines "window = {navigator: {}}"
this.bNode = (Object.keys(window).length < 2) ? true : false;
Expand Down
6 changes: 3 additions & 3 deletions build/icn3d.min.js

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions build/icn3d.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -37848,6 +37848,10 @@ class Contact {
for(let i in atomlistTarget) {
//var oriAtom = atomlistTarget[i];
let oriAtom = ic.atoms[i];

// skip hydrogen atoms
if(bInteraction && oriAtom.elem == 'H') continue;

let r1 = me.parasCls.vdwRadii[oriAtom.elem.toUpperCase()];
let chainid1 = oriAtom.structure + '_' + oriAtom.chain;

Expand All @@ -37874,6 +37878,10 @@ class Contact {

for (let j in neighbors) {
let atom = neighbors[j];

// skip hydrogen atoms
if(bInteraction && atom.elem == 'H') continue;

let r2 = me.parasCls.vdwRadii[atom.elem.toUpperCase()];
let chainid2 = atom.structure + '_' + atom.chain;

Expand Down Expand Up @@ -58736,16 +58744,14 @@ class SdfParser {
}

async downloadSmiles(smiles) { let ic = this.icn3d, me = ic.icn3dui;
let urlSmiles = me.htmlCls.baseUrl + "openbabel/openbabel.cgi?smiles2pdb=" + smiles;
let pdbStr = await me.getAjaxPromise(urlSmiles, 'text');
let urlSmiles = me.htmlCls.baseUrl + "openbabel/openbabel.cgi?smiles2sdf=" + smiles;
let sdfStr = await me.getAjaxPromise(urlSmiles, 'text');

ic.init();

ic.bInputfile = true;
ic.InputfileType = 'pdb';
ic.InputfileData = (ic.InputfileData) ? ic.InputfileData + '\nENDMDL\n' + pdbStr : pdbStr;

await ic.pdbParserCls.loadPdbData(pdbStr);
ic.InputfileData = (ic.InputfileData) ? ic.InputfileData + '\nENDMDL\n' + sdfStr : sdfStr;
ic.InputfileType = 'sdf';
await ic.sdfParserCls.loadSdfData(sdfStr);
}

async loadSdfData(data) { let ic = this.icn3d, me = ic.icn3dui;
Expand Down Expand Up @@ -83372,7 +83378,7 @@ class iCn3DUI {
//even when multiple iCn3D viewers are shown together.
this.pre = this.cfg.divid + "_";

this.REVISION = '3.38.0';
this.REVISION = '3.38.1';

// In nodejs, iCn3D defines "window = {navigator: {}}"
this.bNode = (Object.keys(window).length < 2) ? true : false;
Expand Down
2 changes: 2 additions & 0 deletions dist/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Change Log
[icn3d-3.38.1](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.38.1.zip) was release on November 14, 2024. Improved the conversion of chemical SMILES to 3D structure by showing double bonds.

[icn3d-3.38.0](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.38.0.zip) was release on November 12, 2024. Enabled to convert chemical SMILES to 3D structure via the menu "File > Retrieve by ID > Chemical SMILES".

[icn3d-3.37.0](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.37.0.zip) was release on October 16, 2024. Added a menu "Style > Clashed Residues > Hide" to hide clashed residues.
Expand Down
6 changes: 3 additions & 3 deletions dist/full.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<div id="div0"></div>

<link rel="stylesheet" href="lib/jquery-ui-1.13.2.min.css">
<link rel="stylesheet" href="icn3d_3.38.0.css">
<link rel="stylesheet" href="icn3d_3.38.1.css">
<script src="lib/jquery-3.5.0.min.js"></script>
<script src="lib/jquery-ui-1.13.2.min.js"></script>
<script src="lib/three_0.151.0.min.js"></script>
<script src="icn3d_3.38.0.min.js"></script>
<script src="icn3d_3.38.1.min.js"></script>

<script type="text/javascript">

Expand All @@ -41,7 +41,7 @@
alert("IE does NOT work with the current iCn3D version 3. The old iCn3D version 2 is used instead.");
}
else {
//$.getScript('icn3d_3.38.0.min.js', function() {
//$.getScript('icn3d_3.38.1.min.js', function() {
var version = 3;
await launchIcn3d(version); //await
//});
Expand Down
6 changes: 3 additions & 3 deletions dist/full2.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<div id="div1" style="float:left;"></div>

<link rel="stylesheet" href="lib/jquery-ui-1.13.2.min.css">
<link rel="stylesheet" href="icn3d_3.38.0.css">
<link rel="stylesheet" href="icn3d_3.38.1.css">
<script src="lib/jquery-3.5.0.min.js"></script>
<script src="lib/jquery-ui-1.13.2.min.js"></script>
<script src="lib/three_0.151.0.min.js"></script>
<script src="icn3d_3.38.0.min.js"></script>
<script src="icn3d_3.38.1.min.js"></script>

<script type="text/javascript">
$( document ).ready(async function() {
Expand All @@ -41,7 +41,7 @@
alert("IE does NOT work with the current iCn3D version 3. The old iCn3D version 2 is used instead.");
}
else {
//$.getScript('icn3d_3.38.0.min.js', function() {
//$.getScript('icn3d_3.38.1.min.js', function() {
var version = 3;
await launchIcn3d(version);
//});
Expand Down
6 changes: 3 additions & 3 deletions dist/full2_3.38.0.html → dist/full2_3.38.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<div id="div1" style="float:left;"></div>

<link rel="stylesheet" href="lib/jquery-ui-1.13.2.min.css">
<link rel="stylesheet" href="icn3d_3.38.0.css">
<link rel="stylesheet" href="icn3d_3.38.1.css">
<script src="lib/jquery-3.5.0.min.js"></script>
<script src="lib/jquery-ui-1.13.2.min.js"></script>
<script src="lib/three_0.151.0.min.js"></script>
<script src="icn3d_3.38.0.min.js"></script>
<script src="icn3d_3.38.1.min.js"></script>

<script type="text/javascript">
$( document ).ready(async function() {
Expand All @@ -41,7 +41,7 @@
alert("IE does NOT work with the current iCn3D version 3. The old iCn3D version 2 is used instead.");
}
else {
//$.getScript('icn3d_3.38.0.min.js', function() {
//$.getScript('icn3d_3.38.1.min.js', function() {
var version = 3;
await launchIcn3d(version);
//});
Expand Down
6 changes: 3 additions & 3 deletions dist/full_3.38.0.html → dist/full_3.38.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<div id="div0"></div>

<link rel="stylesheet" href="lib/jquery-ui-1.13.2.min.css">
<link rel="stylesheet" href="icn3d_3.38.0.css">
<link rel="stylesheet" href="icn3d_3.38.1.css">
<script src="lib/jquery-3.5.0.min.js"></script>
<script src="lib/jquery-ui-1.13.2.min.js"></script>
<script src="lib/three_0.151.0.min.js"></script>
<script src="icn3d_3.38.0.min.js"></script>
<script src="icn3d_3.38.1.min.js"></script>

<script type="text/javascript">

Expand All @@ -41,7 +41,7 @@
alert("IE does NOT work with the current iCn3D version 3. The old iCn3D version 2 is used instead.");
}
else {
//$.getScript('icn3d_3.38.0.min.js', function() {
//$.getScript('icn3d_3.38.1.min.js', function() {
var version = 3;
await launchIcn3d(version); //await
//});
Expand Down
Binary file renamed dist/icn3d-3.38.0.zip → dist/icn3d-3.38.1.zip
Binary file not shown.
22 changes: 14 additions & 8 deletions dist/icn3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -37851,6 +37851,10 @@ var icn3d = (function (exports) {
for(let i in atomlistTarget) {
//var oriAtom = atomlistTarget[i];
let oriAtom = ic.atoms[i];

// skip hydrogen atoms
if(bInteraction && oriAtom.elem == 'H') continue;

let r1 = me.parasCls.vdwRadii[oriAtom.elem.toUpperCase()];
let chainid1 = oriAtom.structure + '_' + oriAtom.chain;

Expand All @@ -37877,6 +37881,10 @@ var icn3d = (function (exports) {

for (let j in neighbors) {
let atom = neighbors[j];

// skip hydrogen atoms
if(bInteraction && atom.elem == 'H') continue;

let r2 = me.parasCls.vdwRadii[atom.elem.toUpperCase()];
let chainid2 = atom.structure + '_' + atom.chain;

Expand Down Expand Up @@ -58739,16 +58747,14 @@ var icn3d = (function (exports) {
}

async downloadSmiles(smiles) { let ic = this.icn3d, me = ic.icn3dui;
let urlSmiles = me.htmlCls.baseUrl + "openbabel/openbabel.cgi?smiles2pdb=" + smiles;
let pdbStr = await me.getAjaxPromise(urlSmiles, 'text');
let urlSmiles = me.htmlCls.baseUrl + "openbabel/openbabel.cgi?smiles2sdf=" + smiles;
let sdfStr = await me.getAjaxPromise(urlSmiles, 'text');

ic.init();

ic.bInputfile = true;
ic.InputfileType = 'pdb';
ic.InputfileData = (ic.InputfileData) ? ic.InputfileData + '\nENDMDL\n' + pdbStr : pdbStr;

await ic.pdbParserCls.loadPdbData(pdbStr);
ic.InputfileData = (ic.InputfileData) ? ic.InputfileData + '\nENDMDL\n' + sdfStr : sdfStr;
ic.InputfileType = 'sdf';
await ic.sdfParserCls.loadSdfData(sdfStr);
}

async loadSdfData(data) { let ic = this.icn3d, me = ic.icn3dui;
Expand Down Expand Up @@ -83375,7 +83381,7 @@ var icn3d = (function (exports) {
//even when multiple iCn3D viewers are shown together.
this.pre = this.cfg.divid + "_";

this.REVISION = '3.38.0';
this.REVISION = '3.38.1';

// In nodejs, iCn3D defines "window = {navigator: {}}"
this.bNode = (Object.keys(window).length < 2) ? true : false;
Expand Down
6 changes: 3 additions & 3 deletions dist/icn3d.min.js

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions dist/icn3d.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -37848,6 +37848,10 @@ class Contact {
for(let i in atomlistTarget) {
//var oriAtom = atomlistTarget[i];
let oriAtom = ic.atoms[i];

// skip hydrogen atoms
if(bInteraction && oriAtom.elem == 'H') continue;

let r1 = me.parasCls.vdwRadii[oriAtom.elem.toUpperCase()];
let chainid1 = oriAtom.structure + '_' + oriAtom.chain;

Expand All @@ -37874,6 +37878,10 @@ class Contact {

for (let j in neighbors) {
let atom = neighbors[j];

// skip hydrogen atoms
if(bInteraction && atom.elem == 'H') continue;

let r2 = me.parasCls.vdwRadii[atom.elem.toUpperCase()];
let chainid2 = atom.structure + '_' + atom.chain;

Expand Down Expand Up @@ -58736,16 +58744,14 @@ class SdfParser {
}

async downloadSmiles(smiles) { let ic = this.icn3d, me = ic.icn3dui;
let urlSmiles = me.htmlCls.baseUrl + "openbabel/openbabel.cgi?smiles2pdb=" + smiles;
let pdbStr = await me.getAjaxPromise(urlSmiles, 'text');
let urlSmiles = me.htmlCls.baseUrl + "openbabel/openbabel.cgi?smiles2sdf=" + smiles;
let sdfStr = await me.getAjaxPromise(urlSmiles, 'text');

ic.init();

ic.bInputfile = true;
ic.InputfileType = 'pdb';
ic.InputfileData = (ic.InputfileData) ? ic.InputfileData + '\nENDMDL\n' + pdbStr : pdbStr;

await ic.pdbParserCls.loadPdbData(pdbStr);
ic.InputfileData = (ic.InputfileData) ? ic.InputfileData + '\nENDMDL\n' + sdfStr : sdfStr;
ic.InputfileType = 'sdf';
await ic.sdfParserCls.loadSdfData(sdfStr);
}

async loadSdfData(data) { let ic = this.icn3d, me = ic.icn3dui;
Expand Down Expand Up @@ -83372,7 +83378,7 @@ class iCn3DUI {
//even when multiple iCn3D viewers are shown together.
this.pre = this.cfg.divid + "_";

this.REVISION = '3.38.0';
this.REVISION = '3.38.1';

// In nodejs, iCn3D defines "window = {navigator: {}}"
this.bNode = (Object.keys(window).length < 2) ? true : false;
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions dist/icn3d_3.38.0.min.js → dist/icn3d_3.38.1.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<div id="div0"></div>

<link rel="stylesheet" href="lib/jquery-ui-1.13.2.min.css">
<link rel="stylesheet" href="icn3d_3.38.0.css">
<link rel="stylesheet" href="icn3d_3.38.1.css">
<script src="lib/jquery-3.5.0.min.js"></script>
<script src="lib/jquery-ui-1.13.2.min.js"></script>
<script src="lib/three_0.151.0.min.js"></script>
<script src="icn3d_3.38.0.min.js"></script>
<script src="icn3d_3.38.1.min.js"></script>

<script type="text/javascript">

Expand All @@ -41,7 +41,7 @@
alert("IE does NOT work with the current iCn3D version 3. The old iCn3D version 2 is used instead.");
}
else {
//$.getScript('icn3d_3.38.0.min.js', function() {
//$.getScript('icn3d_3.38.1.min.js', function() {
var version = 3;
await launchIcn3d(version); //await
//});
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "icn3d",
"version": "3.38.0",
"version": "3.38.1",
"description": "iCn3D Structure Viewer",
"main": "index.html",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/icn3d/interaction/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class Contact {
for(let i in atomlistTarget) {
//var oriAtom = atomlistTarget[i];
let oriAtom = ic.atoms[i];

// skip hydrogen atoms
if(bInteraction && oriAtom.elem == 'H') continue;

let r1 = me.parasCls.vdwRadii[oriAtom.elem.toUpperCase()];
let chainid1 = oriAtom.structure + '_' + oriAtom.chain;
//var radius = me.parasCls.vdwRadii[oriAtom.elem.toUpperCase()] || ic.defaultRadius;
Expand Down Expand Up @@ -51,6 +55,10 @@ class Contact {

for (let j in neighbors) {
let atom = neighbors[j];

// skip hydrogen atoms
if(bInteraction && atom.elem == 'H') continue;

let r2 = me.parasCls.vdwRadii[atom.elem.toUpperCase()];
let chainid2 = atom.structure + '_' + atom.chain;

Expand Down
Loading

0 comments on commit e3e884f

Please sign in to comment.