In Python, for example, call the IsInRing() method of an atom to find this out.
On Sun, 27 Jan 2019 at 18:03, Tang, Dai <dai.t...@chbe.gatech.edu> wrote: > Hi, > > > I have a problem with the ring detection using Open Babel 2.4.1. My goal > is to know which carbon atoms (or other element) of a molecule belong to a > ring structure. So far the method I tried is to grep the label 'TYPE: Car' > in .molreport file. > > > Successful case: > > CC1=CC=CC=C1 > > The SMILE code is converted into .molreport file, which shows 6 carbon > atoms as 'TYPE: Car'. > > > Unsuccessful case: > > C=C1CCCCC1 > > Similarly, from SMILE code to get .molreport file, and no carbon atoms are > labeled as 'TYPE: Car'. However, this molecule dose have one 6-membered > ring structure, which is proved by using 'obprop' function, that > 'num_rings 1'. That is also proved by plotting this molecule. > > > name 7.sk.nt.2.smi 2 > > formula C7H12 > > mol_weight 96.1702 > > exact_mass 96.0939 > > canonical_SMILES C=C1CCCCC1 > > > InChI InChI=1S/C7H12/c1-7-5-3-2-4-6-7/h1-6H2 > > > num_atoms 19 > > num_bonds 19 > > num_residues 0 > > num_rotors 0 > > sequence - > > num_rings 1 > > logP 2.5067 > > PSA 0 > > MR 33.175 > > $$$$ > > I have a group of molecules whose ring structure can not be detected, such > as C=C1C=CCC=C1, CC1=CC=CCC1, CC1CC=CC=C1 etc. > > > > Thank you very much for any help you can offer to this issue. > > > > > > Best, > > Dai > > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss >
_______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss