implementing cartridge functions in java only?

ChemAxon 60ee1f1328

23-10-2006 09:48:04

Hello,





For the following cartridge calls below, could you please indicate how I might implement the exact same events using only the ChemAxon Java APIs - presume I will always use Smiles to instantiate. Alternatively it would be useful to know if any of the below calls cannot be implemented with the Java APIs (I presume they must all be implementable in this way).





1. jc_equals (target,query) = 1





2. jc_compare (target,query,'t:e exactChargeMatching:y HCountMatching:E exactStereoMatching:y absoluteStereo:a stereoSearch:y')=1





3. Jcf_Standardize (target,'config:keepone');





4. Jcf_Standardize


(target,'config:dearomatize..[O:2]=[N:1]=O>>[O-:2][N+:1]=O..[c:1][O:2][c:3](=[O:4])-[c:5]-[c:6]>>[c:1][O:2][C:3](=[O:4])[CH:5]=[c:6]..


N=[N:1]#[N:2]>>N=[N+:1]=[N-:2]..[H:4][O:3][C:1]=[C:2]>>[H:4][C:2][C:1]=[O:3]..[H:4][O:3][C:1]#[C:2]>>[H:4][C:2]=[C:1]=[O:3]..[C][O-]>>CO..[c][O-]>>CO..C[N+:1][H:2]>>C[N:1]..


c[N+:1][H:2]>>c[N:1]');





As always thanks for any comments/help,





Cheers,





Daniel.

ChemAxon a3d59b832c

24-10-2006 07:44:24

Yes, they are all possible.





Have a look at the Developer's guide: http://www.chemaxon.com/jchem/doc/guide/





I will also post detailed code later for your particular problems.

ChemAxon 60ee1f1328

24-10-2006 08:33:11

Hi





I will use the documentation as provided (I think I may have been looking at older documentation when I asked the question) - Please don't worry about a later post.





Cheers,


Daniel.

ChemAxon a3d59b832c

24-10-2006 08:36:55

inhibox wrote:
1. jc_equals (target,query) = 1
Code:
    StandardizedMolSearch ms = new StandardizedMolSearch();


    ms.setSearchType(SearchConstants.PERFECT);


    ms.setQuery(MolImporter.importMol(query));


    ms.setTarget(MolImporter.importMol(target);


    if(ms.isMatching()) {


        // matching


    } else {


        // not matching


    }








Relevant section of the Developers guide: 2.2 Structure Searching in memory and flat files
inhibox wrote:
2. jc_compare (target,query,'t:e exactChargeMatching:y HCountMatching:E exactStereoMatching:y absoluteStereo:a stereoSearch:y')=1
Same as above, just use different options:





Code:
        StandardizedMolSearch ms = new StandardizedMolSearch();


        ms.setSearchType(SearchConstants.EXACT);


        ms.setOption(SearchConstants.OPTION_CHARGE_MATCHING,


                SearchConstants.CHARGE_MATCHING_EXACT);


        ms.setHCountMatching(SearchConstants.HCOUNT_MATCHING_EQUAL);


        ms.setExactStereoMatching(true);


        ms.setQueryAbsoluteStereo(true);


        ms.setTargetAbsoluteStereo(true);


        ms.setQuery(MolImporter.importMol(query));


        ms.setTarget(MolImporter.importMol(target);


        if (ms.isMatching()) {


            // matching


        } else {


            // not matching


        }





inhibox wrote:
3. Jcf_Standardize (target,'config:keepone');





4. Jcf_Standardize


(target,'config:dearomatize..[O:2]=[N:1]=O>>[O-:2][N+:1]=O..[c:1][O:2][c:3](=[O:4])-[c:5]-[c:6]>>[c:1][O:2][C:3](=[O:4])[CH:5]=[c:6]..


N=[N:1]#[N:2]>>N=[N+:1]=[N-:2]..[H:4][O:3][C:1]=[C:2]>>[H:4][C:2][C:1]=[O:3]..[H:4][O:3][C:1]#[C:2]>>[H:4][C:2]=[C:1]=[O:3]..[C][O-]>>CO..[c][O-]>>CO..C[N+:1][H:2]>>C[N:1]..


c[N+:1][H:2]>>c[N:1]');
Relevant section of the Developers guide: 9. Standardization





Just use the code example there. In your case, it is probably more convenient to use the other constructor:





Code:
    Standardizer standardizer = new Standardizer("keepone");


    Standardizer standardizer = new Standardizer("dearomatize..[O:2]=[N:1]=O>>[O-:2][N+:1]=O..[c:1][O:2][c:3](=[O:4])-[c:5]-[c:6]>>[c:1][O:2][C:3](=[O:4])[CH:5]=[c:6]..


N=[N:1]#[N:2]>>N=[N+:1]=[N-:2]..[H:4][O:3][C:1]=[C:2]>>[H:4][C:2][C:1]=[O:3]..[H:4][O:3][C:1]#[C:2]>>[H:4][C:2]=[C:1]=[O:3]..[C][O-]>>CO..[c][O-]>>CO..C[N+:1][H:2]>>C[N:1]..


c[N+:1][H:2]>>c[N:1]");


ChemAxon 60ee1f1328

24-10-2006 08:40:28

OK that's brilliant - thank you very much indeed for all your great help...Daniel.

ChemAxon 60ee1f1328

25-10-2006 10:11:37

import chemaxon.reaction.Standardizer.*;


import chemaxon.reaction.StandardizerConfiguration.*;


import chemaxon.reaction.StandardizerData.*;





Standardizer standardizer = new Standardizer("keepone");





will not compile?





CSpaceBuild.java [271:1] cannot resolve symbol


symbol : class Standardizer


location: class CSpaceBuild


Standardizer standardizer = new Standardizer("keepone");





Have I missed out an import statement?





Cheers,


Daniel.

ChemAxon a3d59b832c

25-10-2006 20:55:01

You do not need .* after the class name. Just simply:





Code:
import chemaxon.reaction.Standardizer;






See: http://java.sun.com/docs/books/tutorial/java/package/usepkgs.html

ChemAxon 60ee1f1328

13-11-2006 16:44:22

Can you please provide me with the code required to complete the


jc_insert cartridge function with/without duplicate checking set please...


many thanks,


Daniel.

ChemAxon 60ee1f1328

13-11-2006 17:38:32

never mind, it's update handler please ignore...