how to know molecule configuration?

User 86810cf9fa

25-09-2006 19:00:30

Dear support,





I would like to determine for a molecule if its configuration is like my xml configuration or not. For example:





This my xml:


Code:
<?xml version="1.0" encoding="UTF-8"?>


<!-- Standardizer configuration file -->


<StandardizerConfiguration Version ="0.1">


    <Actions MappingStyle="changing">


   <Sgroups ID="ungroup" Act="ungroup"/>


   <Aromatize ID="aromatize"/>


   <Reaction ID="nitro" Structure="[O-:2][N+:1]=O>>[O:2]=[N:1]=O"/>


   <Reaction ID="azide" Structure="N=[N:1]#[N:2]>>N=[N+:1]=[N-:2]"/>


   <Reaction ID="ammoniumhalide" Structure="C[N+:1][H:2].[F,Cl,Br,I;-:3]>>C[N:1]"/>


   <ImplH ID="dehydrogenize" Optional="true"/>


    </Actions>


</StandardizerConfiguration>






I would like to know if my molecule X have got this configuration "[O-:2][N+:1]=O" or "N=[N:1]#[N:2]" or etc.





Is there a way to do that?





Thanks in advance for your answer.





Best regards,


Severine

ChemAxon a3d59b832c

26-09-2006 07:50:44

severine wrote:
I would like to know if my molecule X have got this configuration "[O-:2][N+:1]=O" or "N=[N:1]#[N:2]" or etc.





Is there a way to do that?
Yes, you can do this before registration. If you would like to use this from the API, use class MolSearch. Alternatively, you may use the command-line tool jcsearch.





Let me know if you need further information.





Kind regards,


Szabolcs

User 86810cf9fa

26-09-2006 09:50:06

Dear Szabolcs,





Thank you for your answer.





This is the code I implemented:





Code:
MolSearch mSearch = new MolSearch();


mSearch.setSearchType(SearchConstants.SUBSTRUCTURE);


mSearch.setTarget(myMolecule);


MolHandler mh1 = new MolHandler("CN(=O)=O"); //(1)


//MolHandler mh1 = new MolHandler("C[N+](O)=O"); //(2)


//MolHandler mh1 = new MolHandler("[O-:2][N+:1]=O"); //(3)


mSearch.setQuery(mh1.getMolecule());


if (mSearch.isMatching()){


   System.out.println("molecule is OK");


}


else{


   System.out.println("molecule to be changed");


}






and this is myMolecule:
Quote:



Marvin 09260611422D





10 10 0 0 0 0 999 V2000


4.6042 -2.6776 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0


4.6030 -3.5044 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0


5.3174 -3.9171 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0


6.0335 -3.5040 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0


6.0306 -2.6739 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0


5.3156 -2.2651 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0


6.7430 -2.2590 0.0000 N 0 3 0 0 0 0 0 0 0 0 0 0


5.3172 -4.7416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0


7.4587 -2.6685 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0


6.7399 -1.4345 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0


2 3 1 0 0 0 0


5 6 2 0 0 0 0


6 1 1 0 0 0 0


1 2 2 0 0 0 0


5 7 1 0 0 0 0


3 4 2 0 0 0 0


3 8 1 0 0 0 0


7 9 2 0 0 0 0


4 5 1 0 0 0 0


7 10 1 0 0 0 0


M CHG 2 7 1 10 -1


M END
The first case (1) work and gives me "molecule to be changed".


The second (2) gives me "molecule is OK"


But the third (3) doesn't work. There is no match. Is there a way to use "[O-:2][N+:1]=O" as in the standardizer or do I have to use cases (1) and (2)?





Thank you again





Best regards


Severine

ChemAxon a3d59b832c

26-09-2006 12:50:03

Hi Severine,





I suggest to use another constructor for MolHandler:





Code:
MolHandler mh1 = new MolHandler("[O-:2][N+:1]=O", true);






The second parameter is called queryMode, and it ensures that the source is interpreted as SMARTS (substructure query - as in the transformation) rather than SMILES (molecule). Smiles import adds the N atom valence 3, thus preventing it to match to your molecule.





One more comment about your code: Although not relevant for these particular queries, aromatization is highly advisable to use before using the MolSearch class. See explanation in the JChem Query Guide under Note on aromatic bonds.





All the best,


Szabolcs

User 86810cf9fa

26-09-2006 16:31:10

Thank you Szabolcs. It works very well now.





Kind regards


Severine