# Using RDKit to determine “nonring, nonterminal atoms”

I am a non-chemist using RDKit to determine the number of "nonring, nonterminal atoms" in a molecule.

I can't find anything in the RDKit documentation that helps with "nonterminal". 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?

• Welcome! I'm not 100% sure I know what you mean by "non-terminal" but I guess you mean that an atom has more than one bond. I'd suggest using SMARTS - seems like you want something like [*R0!D1]. It's often helpful to use SMARTSview to test these patterns. – Geoff Hutchison Dec 24 '20 at 3:14

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).