5
$\begingroup$

I'm trying to find a SMARTS pattern that matches primary and secondary amines, where the connected carbon atoms only have connections to other carbon atoms or hydrogens (to exclude amides, guanidines, etc.)

It should match diethylamine, octylamine, t-butylamine or aniline, but not if any other heteroatom is connected to the amine's carbon(s), like in an amide, oxazolidine etc.

I could write a very long SMARTS pattern, where I include all the possible carbon/hydrogen connections that are possible for the carbons connected to the amine, something like this:

[$([#7H2][CX4(C)(C)C, CX3H1(C)C, CX2H2C, CX1H3, CX3(C)C, ...]), $([#7H1][...]]

Is there a shorter/better way to do this?

$\endgroup$

1 Answer 1

5
$\begingroup$

Search for a nitrogen with three connections NX3

AND has 1 OR 2 hydrogen ;H1,H2

AND is NOT connected to noncarbon ;!$(N[!#6])

AND is NOT concected to a carbon that is NOT connected to carbon ;!$(N#6]~[!#6])

[NX3;H1,H2;!$(N[!#6]);!$(N[#6]~[!#6])] should work.

$\endgroup$
3
  • 1
    $\begingroup$ Thanks for your answer and the detailed explanation! I tried this in rdkit and it almost works, except for aniline C1=CC=C(C=C1)N. I changed the SMARTS to [NX3;H1,H2;!$(N[!#6]);!$(N[#6][!#6])] to explicitly include any carbon, which works for aniline, but unfortunately this now also matches nicotinamide C1=CC(=CN=C1)C(=O)N, where the amide NH2 is matched. Any idea what's the problem? $\endgroup$
    – snurden
    Commented Nov 15, 2021 at 13:56
  • 2
    $\begingroup$ @snurden The change to #6 was a good idea (I forgot aromatic carbon). The problem with nicotinamide is the double bonded oxygen. I changed the last pattern from single bond to any bond ~. Hope it works now. $\endgroup$
    – rapelpy
    Commented Nov 15, 2021 at 17:12
  • 1
    $\begingroup$ Works perfectly, thanks! Totally forgot about the implicit single bond. $\endgroup$
    – snurden
    Commented Nov 15, 2021 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.