heteroAtom count?

User 74d30c678b

14-07-2009 07:13:35

Hi,


I would like to get the number of non-aromatic heteroatoms and the number of aromatic heteroatoms of a given molecule.


Is there an easy (and fast) way to do this with ChemicalTerms/Evaluate ?


Thanks and best regards,


Daniel

ChemAxon e08c317633

14-07-2009 10:58:54

Hi,


Chemical Terms expression for counting the


- number of heteroatoms: "atomCount() - atomCount('6') - atomCount('1')"


$ evaluate -e "atomCount() - atomCount('6') - atomCount('1')" "NC1CC(CNC1O)C(C(Cl)C1=CNC=N1)C(C1=CSC=C1)C1=CC=CC(=C1)C(O)=O"
9


Note: atomCount() function has an optional atomic number parameter


- number of non-aromatic heteroatoms: "aliphaticAtomCount() - matchCount('C')"


$ evaluate -e "aliphaticAtomCount() - matchCount('C')" "NC1CC(CNC1O)C(C(Cl)C1=CNC=N1)C(C1=CSC=C1)C1=CC=CC(=C1)C(O)=O"
6


or


$ evaluate -e "matchCount('A') - matchCount('C')" "NC1CC(CNC1O)C(C(Cl)C1=CNC=N1)C(C1=CSC=C1)C1=CC=CC(=C1)C(O)=O"
6


- number of aromatic heteroatoms: "aromaticAtomCount() - matchCount('c')"


$ evaluate -e "aromaticAtomCount() - matchCount('c')" "NC1CC(CNC1O)C(C(Cl)C1=CNC=N1)C(C1=CSC=C1)C1=CC=CC(=C1)C(O)=O"
3


or


$ evaluate -e "matchCount('a') - matchCount('c')" "NC1CC(CNC1O)C(C(Cl)C1=CNC=N1)C(C1=CSC=C1)C1=CC=CC(=C1)C(O)=O"
3


No atomic number parameter for aliphaticAtomCount() and aromaticAtomCount() functions yet, so I had to use matchCount() (JChem package and MolSearch license is required to use it).


There are some other ways to calculate  these values, these are the first that came to my mind.


Regards,


Zsolt

ChemAxon e08c317633

14-07-2009 11:13:04

These CT expressions also can be used, and they do not require JChem:

 - number of non-aromatic heteroatoms:


$ evaluate -e "count(filter('aliphaticAtom() && atno() != 6 && atno() != 1'))" "NC1CC(CNC1O)C(C(Cl)C1=CNC=N1)C(C1=CSC=C1)C1=CC=CC(=C1)C(O)=O"
6


- number of aromatic heteroatoms:


$ evaluate -e "count(filter('aromaticAtom() && atno() != 6 && atno() != 1'))" "NC1CC(CNC1O)C(C(Cl)C1=CNC=N1)C(C1=CSC=C1)C1=CC=CC(=C1)C(O)=O"
3


Zsolt

User 74d30c678b

14-07-2009 13:01:28

Hi Zsolt,


your code also counts "non-cyclic" heteroatoms for the aliphatic part.


How to modify this to only count heteroatoms withing rings? That's what I want to achieve. Sorry for not having been more clear before.


Thanks again,


Daniel.

ChemAxon e08c317633

14-07-2009 13:12:43










stoffler wrote:

your code also counts "non-cyclic" heteroatoms for the aliphatic part.


How to modify this to only count heteroatoms withing rings?



It counts only non-aromatic heteroatoms within rings (added "ringAtom()" function to the filter):


$ evaluate -e "count(filter('aliphaticAtom() && ringAtom() && atno() != 6 && atno() != 1'))" "NC1CC(CNC1O)C(C(Cl)C1=CNC=N1)C(C1=CSC=C1)C1=CC=CC(=C1)C(O)=O"
1


Zsolt

User 74d30c678b

14-07-2009 13:16:15

Hi Zsolt,


Perfect! That's what I was looking for.


Thanks for your help!


Best regards,


Daniel