JChem functionality w/o a database?

User f5e6ccf034

05-08-2005 15:52:37

Subject says it all. At least in a non-cartridge scenario it is clear


that the search functionality resides outside the db, which only


holds the data. So, is there a way to use JChem w/o a db?

ChemAxon 9c0afc9aaf

05-08-2005 16:18:00

Hi,





A wide range of JChem features can be used without a database.





1. A lot of our API classes are not dependent on database:





http://www.chemaxon.com/jchem/doc/api/





2. Several programs can be used in file mode.





Please see the description of these tools in the user's guide:





http://www.chemaxon.com/jchem/doc/user/





To perform structure searches without a database use the "jcsearch" utility:





http://www.chemaxon.com/jchem/doc/user/Jcsearch.html





Please be aware that searching in files with "jcsearch" is much slower than searching in the database, so it is recommended only for relatively low number of structures.





("jcsearch" can also search in database tables, but that is still not as fast as other applications, because it's a non-persistent application, so it cannot utilize the structure cache)





Best regards,





Szilard

User f5e6ccf034

05-08-2005 20:21:18

> A lot of our API classes are not dependent on database





Yes but I was specifically asking about the search functionality. I know about jcsearch but I want to do this programmatically, not from the command line. That script calls the main method of chemaxon.jchem.search but that is an undocumented class, presumably not meant to be used externally.

ChemAxon 9c0afc9aaf

07-08-2005 11:32:53

Hi,





You can use the MolSearch class to perform a graph search on a query and target Molecule:





http://www.chemaxon.com/jchem/doc/api/chemaxon/sss/search/MolSearch.html





This class extends Search, so you will find some of the methods here:





http://www.chemaxon.com/jchem/doc/api/chemaxon/sss/search/Search.html





Please note, that before you use MolSearch you have to standardize the molecules to have correct search results.


The most important standardization step is the detection of aromatic rings.


You can simply use Molecule.aromatize() for this purpose:





http://www.chemaxon.com/jchem/doc/api/chemaxon/struc/Molecule.html#aromatize(int)





For more sophisticated standardization (e.g. bringing certain functional groups to the same form) you will need Standardizer:





http://www.chemaxon.com/jchem/doc/api/chemaxon/reaction/Standardizer.html





Please see the following page for more details:


http://www.chemaxon.com/jchem/doc/user/Standardizer.html





For similarity searches you have to generate the fingerprints of the molecule:





http://www.chemaxon.com/jchem/doc/api/chemaxon/util/MolHandler.html#getFingerprintInBytes(int,%20int,%20int)





Then you can calculate the Tanimoto coefficient:





http://www.chemaxon.com/jchem/doc/api/chemaxon/sss/screen/Similarity.html#getTanimoto(byte[],%20byte[])





Precomputed fingerprints can also be useful to speed up substructure and superstructure search.


If a certain bit is set to 1 in the substructure, the same bit has to be set also in the containing structure: it's possible to filter out most of the non-hit structures with a quick binary comparison (screening), thereby reducing the number of MolSearch calls.





You can read more about the fingerprints here:





http://www.chemaxon.com/jchem/doc/user/fingerprint.html





Best regards,





Szilard

User f5e6ccf034

07-08-2005 12:09:07

OK. That sounds very low-level, though, and like one must try one


target at a time, too, which could be inefficient (calling setTarget()


thousands of times). Can you confirm that there is no way to


import all targets at once and perform a single search?

ChemAxon a3d59b832c

08-08-2005 06:43:50

Yes, that's correct, MolSearch can only take one target at a time. However, it is designed in a way that it is not inefficient to call setTarget() thousands of times. JChemSearch and jcsearch both relies on MolSearch, calling setTarget().





You can find an example which uses MolImporter to import molecules in the API documentation of MolSearch:





http://www.chemaxon.com/jchem/doc/api/chemaxon/sss/search/MolSearch.html





If your input is in files, you can also use the main method of jcsearch (chemaxon.jchem.Search) by providing command line parameters for it.


However, you have to be aware that it may call System.exit() if an error occurs, as it was designed to be a standalone program.





All the best,


Szabolcs