User be1039f1ca
20-04-2006 13:16:19
I have imported some mol files and setup a database (MSSQL) using "jcman". I also have "Marvin" passing mol files into my perl script. I'm having difficulty figuring out how to execute the actual search from my perl script.
What I need is something I can pass the target mol file and search parameters to and it will return a list of "cd_ids" that match the search.
I have played with "jcsearch" but I doesn't seem to be able to give me a list of "cd_ids", it just wants to give me the results as mol files or SMILES.
I'm looking into calling the Java functions directly from within my perl script, but I was hoping from for something less complicated.
Any suggestions?
Thanks.
ChemAxon a3d59b832c
21-04-2006 07:23:57
ChemAxon aa7c50abf8
21-04-2006 14:52:47
Hi,
I guess you are aware that using jcsearch the way you intend to use it is very inefficient. Each time you call jcsearch, the Java runtime will be (re)started and, perhaps more importantly, the structure cache will have to be built up from scratch again and again.
Cheers,
Peter
ChemAxon aa7c50abf8
21-04-2006 16:44:16
Not being a Jython expert (actually this is the first time I hear of it), from the single-phrase description of Jython by Szabolcs I infer that Jython code makes direct references to native Java objects, ie. (1) your python implementation runs in the same process as the JChem objects being referred to and (2) the lifecycle of the JChem objects themselves is completely identical to the lifecycle of their python proxies (the JChem objects' references in the python code).
If my assumptions above about Jython are correct and if Jython can be integrated with an HTTP server so that the underlying Java runtime keeps its state across calls made in the same HTTP session, then efficiency is most probably better than with jcsearch by orders of magnitude.
I am not sure how relevant this is for your perl environment. Is there a perl interpreter written in Java with features similar to Jython's (or with features I assume Jython has)?
Cheers,
Peter
User be1039f1ca
21-04-2006 17:24:59
I think I missunderstood what Jython was.
For Perl with inline Java the lifecycle of the JChem objects is the same as the perl script, which in my case might just be single search. I'll have to look into this as it relates to PerlEx and ISAPIPerl.
ChemAxon a3d59b832c
21-04-2006 21:23:41
As far as I know, jython is a python implementation written in java. Therefore it has a native hook to java functionality, and all java calls from jython scripts run in the same JRE as the script itself.
I agree with Peter. If your perl script only performs a few searches and is restarted many times, an application server or a web service may be the best solution.
Is it not an option moving to Oracle? This would make this whole problem void as JChem Cartridge is available directly from perl.
Best regards,
Szabolcs
ChemAxon a3d59b832c
25-04-2006 05:51:53
Hi Nathan,
Thanks for the update. Let us know if you need help on the Tomcat side.
All the best,
Szabolcs
User be1039f1ca
02-05-2006 01:37:46
Okay I got tomcat installed and the demos working. I also was able to easily import my mol files including a custom field using SD files. However, the demos at /jchem/examples/jsp1_x are far more complicated than I need.
I need to strip out the session handling, hard code the database connection information and modify the search so that it will just return cd_ids. Not being familiar with java, this looks like it may take me a while to modify through trial and error. Do you have anything that will push me in the right direction.
It looks like I could hard code the connection values in init.jsp (this installation will not be publicly accessable). It also looks like the main searching happens in searching.jsp.
Thanks.
ChemAxon 9c0afc9aaf
02-05-2006 09:05:31
User be1039f1ca
05-05-2006 21:24:27
The simplified example is exactly what I needed. I'm almost there.
Thanks.
ChemAxon 43e6884a7a
18-05-2006 17:40:41
Nathan,
Have you solved the problem?
I think many forum readers would be interested in the technical details of the integration with Perl. Could you submit some useful details or even some source code? (Either here or at the
Contributions forum)
User be1039f1ca
18-05-2006 17:55:50
I do have it working. However, the code is still a bit rough. I'm working on cleaning it up, but I know VERY little about Java. I'm also still working on the error handling. Once this is done, I should be able to post some code.