Skip to content

Commit

Permalink
Pull request #665: Enabled to convert chemical SMILES to 3D structure…
Browse files Browse the repository at this point in the history
… via the menu "File > Retrieve by ID > Chemical SMILES".

Merge in STRUC/icn3d from release3380 to master

* commit '905d140a0da3242ec5f117dd15e6ab3024296578':
  Enabled to convert chemical SMILES to 3D structure via the menu "File > Retrieve by ID > Chemical SMILES".
  Enabled to convert chemical SMILES to 3D structure via the menu "File > Retrieve by ID > Chemical SMILES".
  • Loading branch information
jiywang3 committed Nov 12, 2024
2 parents 7344305 + 905d140 commit 551c4c2
Show file tree
Hide file tree
Showing 37 changed files with 678 additions and 314 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Change Log
[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 "View > Clashed Residues > Hide" to hide clashed residues.
[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.

[icn3d-3.36.1](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.36.1.zip) was release on October 7, 2024. Fixed an issue related to previous chain IDs such as "A_1" (changed to "A1") in previous sharable links.

Expand Down
159 changes: 110 additions & 49 deletions build/icn3d.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/icn3d.min.js

Large diffs are not rendered by default.

159 changes: 110 additions & 49 deletions build/icn3d.module.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion dist/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Change Log
[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 "View > Clashed Residues > Hide" to hide clashed residues.
[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.

[icn3d-3.36.1](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.36.1.zip) was release on October 7, 2024. Fixed an issue related to previous chain IDs such as "A_1" (changed to "A1") in previous sharable links.

Expand Down
14 changes: 10 additions & 4 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.37.0.css">
<link rel="stylesheet" href="icn3d_3.38.0.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.37.0.min.js"></script>
<script src="icn3d_3.38.0.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.37.0.min.js', function() {
//$.getScript('icn3d_3.38.0.min.js', function() {
var version = 3;
await launchIcn3d(version); //await
//});
Expand Down Expand Up @@ -182,19 +182,22 @@

if(!bNopara) {
var decodeSearch = decodeURIComponent(search).replace(/\+/g, ' ');
search = search.replace(/\+/g, ' ');

// command could contains '&', for example when loading statefile 'load mmdb 1kq2 | parameters &atype=1'
var commandPos = decodeSearch.indexOf('&command=');
if(commandPos != -1) {
cfg.command = decodeSearch.substr(commandPos + 9); // ";" separated commands
decodeSearch = decodeSearch.substr(0, commandPos);
search = search.substr(0, commandPos);

var paraPos = decodeSearch.indexOf(' | parameters ');

if(paraPos != -1) { //When loading statefile (e.g., 'load mmdb 1kq2 | parameters &atype=1'), the commands ends with '}}'.
var tmpPos = cfg.command.indexOf('}}&');
if(tmpPos != -1) { // more parameters after the command
decodeSearch += cfg.command.substr(tmpPos + 2);
search += cfg.command.substr(tmpPos + 2);
cfg.command = cfg.command.substr(0, tmpPos + 2);
}
}
Expand All @@ -205,13 +208,15 @@
var tmpPos = cfg.command.indexOf('}}&');
if(tmpPos != -1) { // more parameters after the command
decodeSearch += cfg.command.substr(tmpPos + 2);
search += cfg.command.substr(tmpPos + 2);
cfg.command = cfg.command.substr(0, tmpPos + 2);
}
}
else {
var tmpPos = cfg.command.indexOf('&');
if(tmpPos != -1) {
decodeSearch += cfg.command.substr(tmpPos);
search += cfg.command.substr(tmpPos);
cfg.command = cfg.command.substr(0, tmpPos);
}
}
Expand All @@ -221,7 +226,8 @@
cfg.command = '';
}

var hashes = decodeSearch.split('&');
// var hashes = decodeSearch.split('&');
var hashes = search.split('&');
for (var i = 0; i < hashes.length; i++) {
var hash = hashes[i].split('=');
cfg[hash[0].trim()] = (hash[1] !== undefined) ? hash[1].trim() : undefined;
Expand Down
16 changes: 11 additions & 5 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.37.0.css">
<link rel="stylesheet" href="icn3d_3.38.0.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.37.0.min.js"></script>
<script src="icn3d_3.38.0.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.37.0.min.js', function() {
//$.getScript('icn3d_3.38.0.min.js', function() {
var version = 3;
await launchIcn3d(version);
//});
Expand Down Expand Up @@ -220,36 +220,41 @@

if(!bNopara) {
var decodeSearch = decodeURIComponent(search).replace(/\+/g, ' ');
search = search.replace(/\+/g, ' ');

// command could contains '&', for example when loading statefile 'load mmdb 1kq2 | parameters &atype=1'
var commandPos = decodeSearch.indexOf('&command=');
if(commandPos != -1) {
cfg.command = decodeSearch.substr(commandPos + 9); // ";" separated commands
decodeSearch = decodeSearch.substr(0, commandPos);
search = search.substr(0, commandPos);

var paraPos = decodeSearch.indexOf(' | parameters ');

if(paraPos != -1) { //When loading statefile (e.g., 'load mmdb 1kq2 | parameters &atype=1'), the commands ends with '}}'.
var tmpPos = cfg.command.indexOf('}}&');
if(tmpPos != -1) { // more parameters after the command
decodeSearch += cfg.command.substr(tmpPos + 2);
search += cfg.command.substr(tmpPos + 2);
cfg.command = cfg.command.substr(0, tmpPos + 2);
}
}
else {
var paraPos = cfg.command.indexOf(' | parameters ');

if(paraPos != -1) { //"&command=load mmdb 7DDD | parameters &mmdbid=7DDD; select..." the commands ends with '}}'.
if(paraPos != -1) { // "&command=load mmdb 7DDD | parameters &mmdbid=7DDD; select..." the commands ends with '}}'.
var tmpPos = cfg.command.indexOf('}}&');
if(tmpPos != -1) { // more parameters after the command
decodeSearch += cfg.command.substr(tmpPos + 2);
search += cfg.command.substr(tmpPos + 2);
cfg.command = cfg.command.substr(0, tmpPos + 2);
}
}
else {
var tmpPos = cfg.command.indexOf('&');
if(tmpPos != -1) {
decodeSearch += cfg.command.substr(tmpPos);
search += cfg.command.substr(tmpPos);
cfg.command = cfg.command.substr(0, tmpPos);
}
}
Expand All @@ -259,7 +264,8 @@
cfg.command = '';
}

var hashes = decodeSearch.split('&');
// var hashes = decodeSearch.split('&');
var hashes = search.split('&');
for (var i = 0; i < hashes.length; i++) {
var hash = hashes[i].split('=');
cfg[hash[0].trim()] = (hash[1] !== undefined) ? hash[1].trim() : undefined;
Expand Down
16 changes: 11 additions & 5 deletions dist/full2_3.37.0.html → dist/full2_3.38.0.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.37.0.css">
<link rel="stylesheet" href="icn3d_3.38.0.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.37.0.min.js"></script>
<script src="icn3d_3.38.0.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.37.0.min.js', function() {
//$.getScript('icn3d_3.38.0.min.js', function() {
var version = 3;
await launchIcn3d(version);
//});
Expand Down Expand Up @@ -220,36 +220,41 @@

if(!bNopara) {
var decodeSearch = decodeURIComponent(search).replace(/\+/g, ' ');
search = search.replace(/\+/g, ' ');

// command could contains '&', for example when loading statefile 'load mmdb 1kq2 | parameters &atype=1'
var commandPos = decodeSearch.indexOf('&command=');
if(commandPos != -1) {
cfg.command = decodeSearch.substr(commandPos + 9); // ";" separated commands
decodeSearch = decodeSearch.substr(0, commandPos);
search = search.substr(0, commandPos);

var paraPos = decodeSearch.indexOf(' | parameters ');

if(paraPos != -1) { //When loading statefile (e.g., 'load mmdb 1kq2 | parameters &atype=1'), the commands ends with '}}'.
var tmpPos = cfg.command.indexOf('}}&');
if(tmpPos != -1) { // more parameters after the command
decodeSearch += cfg.command.substr(tmpPos + 2);
search += cfg.command.substr(tmpPos + 2);
cfg.command = cfg.command.substr(0, tmpPos + 2);
}
}
else {
var paraPos = cfg.command.indexOf(' | parameters ');

if(paraPos != -1) { //"&command=load mmdb 7DDD | parameters &mmdbid=7DDD; select..." the commands ends with '}}'.
if(paraPos != -1) { // "&command=load mmdb 7DDD | parameters &mmdbid=7DDD; select..." the commands ends with '}}'.
var tmpPos = cfg.command.indexOf('}}&');
if(tmpPos != -1) { // more parameters after the command
decodeSearch += cfg.command.substr(tmpPos + 2);
search += cfg.command.substr(tmpPos + 2);
cfg.command = cfg.command.substr(0, tmpPos + 2);
}
}
else {
var tmpPos = cfg.command.indexOf('&');
if(tmpPos != -1) {
decodeSearch += cfg.command.substr(tmpPos);
search += cfg.command.substr(tmpPos);
cfg.command = cfg.command.substr(0, tmpPos);
}
}
Expand All @@ -259,7 +264,8 @@
cfg.command = '';
}

var hashes = decodeSearch.split('&');
// var hashes = decodeSearch.split('&');
var hashes = search.split('&');
for (var i = 0; i < hashes.length; i++) {
var hash = hashes[i].split('=');
cfg[hash[0].trim()] = (hash[1] !== undefined) ? hash[1].trim() : undefined;
Expand Down
14 changes: 10 additions & 4 deletions dist/full_3.37.0.html → dist/full_3.38.0.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.37.0.css">
<link rel="stylesheet" href="icn3d_3.38.0.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.37.0.min.js"></script>
<script src="icn3d_3.38.0.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.37.0.min.js', function() {
//$.getScript('icn3d_3.38.0.min.js', function() {
var version = 3;
await launchIcn3d(version); //await
//});
Expand Down Expand Up @@ -182,19 +182,22 @@

if(!bNopara) {
var decodeSearch = decodeURIComponent(search).replace(/\+/g, ' ');
search = search.replace(/\+/g, ' ');

// command could contains '&', for example when loading statefile 'load mmdb 1kq2 | parameters &atype=1'
var commandPos = decodeSearch.indexOf('&command=');
if(commandPos != -1) {
cfg.command = decodeSearch.substr(commandPos + 9); // ";" separated commands
decodeSearch = decodeSearch.substr(0, commandPos);
search = search.substr(0, commandPos);

var paraPos = decodeSearch.indexOf(' | parameters ');

if(paraPos != -1) { //When loading statefile (e.g., 'load mmdb 1kq2 | parameters &atype=1'), the commands ends with '}}'.
var tmpPos = cfg.command.indexOf('}}&');
if(tmpPos != -1) { // more parameters after the command
decodeSearch += cfg.command.substr(tmpPos + 2);
search += cfg.command.substr(tmpPos + 2);
cfg.command = cfg.command.substr(0, tmpPos + 2);
}
}
Expand All @@ -205,13 +208,15 @@
var tmpPos = cfg.command.indexOf('}}&');
if(tmpPos != -1) { // more parameters after the command
decodeSearch += cfg.command.substr(tmpPos + 2);
search += cfg.command.substr(tmpPos + 2);
cfg.command = cfg.command.substr(0, tmpPos + 2);
}
}
else {
var tmpPos = cfg.command.indexOf('&');
if(tmpPos != -1) {
decodeSearch += cfg.command.substr(tmpPos);
search += cfg.command.substr(tmpPos);
cfg.command = cfg.command.substr(0, tmpPos);
}
}
Expand All @@ -221,7 +226,8 @@
cfg.command = '';
}

var hashes = decodeSearch.split('&');
// var hashes = decodeSearch.split('&');
var hashes = search.split('&');
for (var i = 0; i < hashes.length; i++) {
var hash = hashes[i].split('=');
cfg[hash[0].trim()] = (hash[1] !== undefined) ? hash[1].trim() : undefined;
Expand Down
Binary file renamed dist/icn3d-3.37.0.zip → dist/icn3d-3.38.0.zip
Binary file not shown.
Loading

0 comments on commit 551c4c2

Please sign in to comment.