Using RDKit to determine "nonring, nonterminal atoms" I am a non-chemist using RDKit to determine the number of &quot;nonring, nonterminal atoms&quot; in a molecule.
I can't find anything in the RDKit documentation that helps with &quot;nonterminal&quot;. Can it be used for that?
I can using RDKit's AtomRings function to identify atoms in rings, but perhaps there is a more direct way?
I think you want to use SMARTS patterns to perform searches. These are something like &quot;regular expression&quot; patterns for molecular graphs.
At a rough guess, your query converts to [*R0!D1]:

* matches any atom (i.e., you don't care if it's a carbon or an oxygen)
R0 matches an atom in a ring with size 0 (i.e., not a ring atom)
D1 matches an atom with explicitly one bond (so !D1 matches atoms with more than one bond).

It's often helpful to use SMARTSview to test patterns.
More on RDKit's SMARTS support can be found in the documentation