Discussion:
[BlueObelisk-discuss] Question about JavaScript implementation of InChI generation
Robert Hanson
2016-03-07 19:20:08 UTC
Permalink
Richard, I have a question about the JavaScript implementation of InChI
creation. Are you the person to ask?

I have that working now at http://chemapps.stolaf.edu/jmol/jsmol/inchi.htm,
and I see excellent agreement with NCI/CADD.

But there is a problem. When trying a variety of options, I stumbled upon
this oddity trying this particular sequence:

[load page]
morphine

- no problem

[load page]
taxol
methanol

- no problem

[load page]
taxol
methanol
morphine

- inchi.js seems to have crashed or is looping or something. Morphine call
does not return, and no further processing of other molecules works.


[load page]
taxol
morphine

- same issue.

So it appears that taxol is pathological in that it sets something up such
that a *later* request for morphine fails. The taxol model from NCI/CADD is
worthless because it is a flat 2D model. inchi.js does return something:

InChI=1S/C47H51NO14/c1-25-31(60-43(56)36(52)35(28-16-10-7-11-17-28)48-41(54)29-18-12-8-13-19-29)23-47(57)40(61-42(55)30-20-14-9-15-21-30)38-45(6,32(51)22-33-46(38,24-58-33)62-27(3)50)39(53)37(59-26(2)49)34(25)44(47,4)5/h7-21,31-33,35-38,40,51-52,57H,22-24H2,1-6H3,(H,48,54)
Omitted undefined stereo

but then after that it seems dead in the water *specifically for morphine*.
The call is made, no error is reported, and no further calls can be made.

Any way to debug this?

Bob

​
Robert Hanson
2016-03-09 18:40:43 UTC
Permalink
Hello Bob,
Thanks for the report. Have you tried these tests using the InChI.js page?
http://metamolecular.com/inchi-js/
I don't see it there, but I can't be sure what is happening on your site,
either.
JavaScript will, without reservation or warning, allow any script to
overwrite the global namespace. This can cause all kinds of havoc for
scripts running in the same runtime. I'm not sure that's happening in your
case, but it would be best to eliminate that possibility first.
JSmol and jQuery and your translation are all pretty tight. I'd be
surprised if there is an incompatibility there.

Is there an un-closure-compiled version of this that I could try so that at
least I don't just get "a is undefined"? I'm happy to help you track this
down.
The test page I linked should be free of such side effects, so I'd
encourage you to run all tests there instead.
That said, could you link or attach the sequence of molfiles that will
cause the error?
the file is linked to in the report:
http://cactus.nci.nih.gov/chemical/structure/taxol/file?format=sdf&get3d=True

Oddly enough, if the molecule small enough, or for other reasons, it is
possible that the next file loaded will be fine. Then the file after that
crashes.

Bob
Best regards,
Rich
Post by Robert Hanson
Richard, I have a question about the JavaScript implementation of InChI
creation. Are you the person to ask?
I have that working now at
http://chemapps.stolaf.edu/jmol/jsmol/inchi.htm, and I see excellent
agreement with NCI/CADD.
But there is a problem. When trying a variety of options, I stumbled upon
[load page]
morphine
- no problem
[load page]
taxol
methanol
- no problem
[load page]
taxol
methanol
morphine
- inchi.js seems to have crashed or is looping or something. Morphine
call does not return, and no further processing of other molecules works.
[load page]
taxol
morphine
- same issue.
So it appears that taxol is pathological in that it sets something up
such that a *later* request for morphine fails. The taxol model from
NCI/CADD is worthless because it is a flat 2D model. inchi.js does return
InChI=1S/C47H51NO14/c1-25-31(60-43(56)36(52)35(28-16-10-7-11-17-28)48-41(54)29-18-12-8-13-19-29)23-47(57)40(61-42(55)30-20-14-9-15-21-30)38-45(6,32(51)22-33-46(38,24-58-33)62-27(3)50)39(53)37(59-26(2)49)34(25)44(47,4)5/h7-21,31-33,35-38,40,51-52,57H,22-24H2,1-6H3,(H,48,54)
Omitted undefined stereo
but then after that it seems dead in the water *specifically for
morphine*. The call is made, no error is reported, and no further calls
can be made.
Any way to debug this?
Bob
​
--
Richard L. Apodaca
Founder
Metamolecular, LLC
8070 La Jolla Shores Drive #464
La Jolla, CA 92037
858.754.9396
http://metamolecular.com
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Department of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
Loading...