Great, thanks Andrew! I'll look into your code. Appreciate you taking the time to write that.
Vào Th 3, 14 thg 5, 2019 vào lúc 12:56 Andrew Dalke < da...@dalkescientific.com> đã viết: > Hi Spencer, > > Here's a solution which indirectly builds on the Open Babel > functionality to find rings and identify components. > > A direct algorithm would do as Noel suggest: use something like a > depth-first search to find all ring atoms and from that figure out the > number of connected ring systems. > > This round-about solution uses the SMARTS matcher to find the ring atoms > (building on Open Babel's ring finder), delete the ring atoms, generate a > SMILES (builds on Open Babel's component detection code), and counts the > number of components as <number of '.' characters> + 1. > > It's slow, and uses some heavy-weight mechanisms, but I think it gets the > answer you are looking for. There may be more efficient ways to, for > example, count the number of components. > > I haven't really tested it though. > > It also works because your definition says that rings connected by a sprio > atom are part of the same ring system. If they were parts of different > systems then the implementation would be more difficult. > > > Andrew > da...@dalkescientific.com > >
_______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss