Returning indexes of atoms matching SMARTS

User c6e73d066d

18-11-2011 15:59:17

Dear all,


I would like to return the index number of an atom matching a particular SMARTS query, so that I can compute a specific property on this atom. I cannot find the corresponding function for this.


Alternatively, if you know a way to directly compute the a property on an atom that matches a SMARTS query, this would be just as useful for me.


Best regards,


Sandro

ChemAxon e08c317633

18-11-2011 16:37:37

Hi,


Check these Chemical Terms functions:


1. Match functions: http://www.chemaxon.com/marvin/help/chemicalterms/EvaluatorFunctions.html#match_functions


2. Filter function: http://www.chemaxon.com/marvin/help/chemicalterms/EvaluatorFunctions.html#filterdesc


Example:


$ evaluate -e "charge(filter(atoms(), \"match('[#8][C:1]=O', 1)\"))" "OC(=O)C1=CC=CC=C1"
0.08

It calculates the partial charge of the carboxylic carbon.


Evaluator manual: http://www.chemaxon.com/marvin/help/chemicalterms/Evaluator.html


Zsolt


 

User c6e73d066d

14-12-2011 16:06:20

Dera Zsolt,


Sorry for the late reply.


Unfortunately, there seems to be something wrong for me: even while copying the "evaluate " expression you provided me with, I cannot calculate values.


Instead, while using


 ./evaluate -e "charge(filter(atoms(), \"match('[#8][C:1]=O', 1)\"))" "OC(=O)C1=CC=CC=C1"


I get the following error message (this is only the start



Exception in thread "main" chemaxon.nfunk.jep.ParseException: Error while evaluating expression:
charge(filter(atoms(), "match('[#8][C:1]=O', 1)"))
    Error while evaluating expression:
match('[#8][C:1]=O', 1)
    Class not found: chemaxon.jep.function.Match
    chemaxon.jep.function.Match
 at chemaxon.nfunk.jep.JEP.getValueAsObject(JEP.java:502)
 at chemaxon.jep.ChemJEP.evaluate(ChemJEP.java:149)
 at chemaxon.jep.Evaluator.main(Evaluator.java:1203)
Caused by:
chemaxon.nfunk.jep.ParseException: Error while evaluating expression:
match('[#8][C:1]=O', 1)
    Class not found: chemaxon.jep.function.Match
    chemaxon.jep.function.Match


This is only the beginning, but I assume this means that there is a problem with the "match" expression.


I hope you can help!


Sandro

ChemAxon e08c317633

14-12-2011 16:50:00

You have to install JChem if you want to use the "match" functions (installing MarvinBeans is not enough).


Zsolt