Writing SMARTS: Some Examples

[O,N;!H0]
Hydrogen-bond donor -- Matches one atom either oxygen or nitrogen and not with zero attached hydrogens.

[C,N;R0]=O
Hydrogen-bond acceptor -- Matches a 2-atom pattern consisting of a carbon or nitrogen not in a ring, double bonded to an oxygen.

[$([O,N;!H0])]-*~*-*=[$([C,N;R0]=O)]
Possible intramolecular hbond -- Note that the overall SMARTS consists of five atoms. The first and fifth atom are defined by "recursive SMARTS", where "$()" encloses a valid nested SMARTS and acts syntactically like an atom-primitive in the overall SMARTS. Multiple nesting is allowed.

[!$(*#*)&!D1]-&!@[!$(*#*)&!D1]
Rotatable bond -- Note that logical operators can be applied to bonds ("-&!@"). Here, the overall SMARTS consists of two atoms and one bond. The bond is "single and not ring".

[$(c:cCl),$(c:c:cCl),$(c:c:c:cCl)]-[$(c:cCl),$(c:c:cCl),$(c:c:c:cCl)]
PCB search -- Overall SMARTS is atom-bond-atom. Note that ":" is explicit aromatic bond, and "-" is explicit single bond. On each side of the single bond, we use three nested SMARTS to represent the ortho, meta, and para position.

[N&X3;H2,H1;!$(NC=*)]
Primary or secondary amine, not amide -- Note that "&" (and) is higher precedence that "," (or), which is higher precedence than ";" (and);

[N;D1;H2,H3;!$(NC=[!#6]);!$(NC#[!#6])][#6]
Primary amine, not amide

[N&X3;H2,H1;!$(NC=*)].[N&X3;H2,H1;!$(NC=*)]
Two primary or secondary amines -- Here we use the disconnection symbol (".") to match two separate unbonded identical patterns.

*/,\[R]=;@[R]/,\*
CIS or TRANS double bond in a ring -- An isomeric SMARTS consisting of four atoms and three bonds.

Back to

Support/FAQ Page