Ring atom count

User 234000dc20

12-03-2014 17:42:04


I am looking for a way to count to how many rings each atom of a SMILES string is part of.

Let me give more details of what I am trying to do: I have a list of rings in SMILES string. I would like to count how many times each one of these rings appears in a given database. If I use "jcsearch -t:c --allHits -q 'c1ccccc1' Database.smi" I will also count every fused ring with benzene (naphtalene for example), and I don't want it. Thus, I was thinking of making a script to convert from SMILES to SMARTS (benzene would be [c1R1][cR1][cR1][cR1][cR1][c1R1]). To do it, I need to know to how many rings each atom belongs. cxcalc ringatom returns false or true to know if an atom of a SMILES string is in a ring or not. The tool I am looking for would return 1/2/3... depending on how many rings each atom belongs.

Is it possible to do it with ChemAxon tools? If not, is there anybody with any idea on how to do it?

Thank you for your help.


ChemAxon 2bdd02d1e5

13-03-2014 09:10:26

Hi Nicolas,

I don't know if there is a way how to find how many rings each atom in SMILES string belongs to. Could not be this done by analysing the string? But this may not be necessary.

There is a tool which converts SMILES to SMARTS directly. Please see https://www.chemaxon.com/marvin/help/applications/molconvert.html

Does it help?



User 234000dc20

13-03-2014 15:14:27

Thank you for your answer. I have looked at molconvert, however I have not been able to do what I am looking for. In a Benzene.smi file I have written "c1ccccc1". When using "molconvert FORMAT Benzene.smi" (FORMAT being smiles, cxsmiles, smarts or cxsmarts), I always get the same answer: "c1ccccc1". If I put "[c1R][cR][cR][cR][cR][c1R]" in Benzene.smi, it doesn't work with smiles or cxsmiles, and gives me "[cR][cR][cR][cR][cR][cR]" as an output with smarts or cxsmarts. If it was capable to add the number of rings for each atom after "R" it would be perfect.

Do you have any other ideas of how I could do that?

Thank you.



Edit: I have written a mistake, instead of "[c1R][cR][cR][cR][cR][c1R]", it should be "[cR]1[cR][cR][cR][cR][cR]1"

ChemAxon 6848e723bb

14-03-2014 09:15:24

Hi Nicolas,
if you don't mind using our Java API, maybe the TopologyAnalyserPlugin could help you. It has methods to find all the rings. You would then count how many times each atom appears in the result.


Just another possibility.

Filip Sedlak

ChemAxon c589ba3265

14-03-2014 10:11:01

Dear Nikolas,

try this: in grid view > add New Chemical Terms Field> insert  molString('Smarts') >rename and Finish

it calculated Smarts field for each molecule  

for i.e. if you set query "c1ncnc2ncnc12" ,it find each target with purine core.

Is it what you expect ?

Best Regards


User 234000dc20

17-03-2014 17:10:10

Thank you for your suggestions, and sorry for the late answer.

@fsedlak: I am not very familiar with Java, so I prefer not spending too much time learning it.

@Bastik: what you have suggested works partially, but if I use it I would need to check the output.

I have finally decided to this by hand. It is a little bit boring, but since I only need it once I think that I can do it in a day or 2 at max.

Thank you all for your help.