Trying to understand SMILES(?) patterns In the example calculation from the conformer search package fafoom is a mysterious pattern that I'd like to understand.

The SMILES code of the given example structure is:

CC(=O)N[C@H](C(=O)NC)C


There is a first not so hard pattern for the smart_cistrans pattern identifier

C~[$(C=O)]-[$(NC)]~[C]


which tells the program that peptide bonds behave like cis-trans isomers. That is relatively easy to see but I don't really understand it to adapt it on further problems.

But there is another identifier for torsion angles that for me is even harder to understand:

[*]~[!$(*#*)&amp;!D1]-&amp;!@[!$(*#*)&amp;!D1]~[*]


The [*]'s at the beginning and at the end look like defining any atom ... but the cursing signs in the middle don't tell me anything.

Dear reader, if you understand how those patterns are generated, I would ask you break them down piece for piece that I can use them afterwards on my own.
First off this is SMARTS not SMILES.

Think of SMARTS as like a regular expression language for molecules (e.g., SMILES).

So let's break down some of those characters:


~ is "any bond"
! is "not"
$ indicates a recursive SMARTS expression.
@ indicates "any ring bond"


The $(*#*) means "two atoms with a triple bond between them". The !D1 means and not an atom with one explicit bond.

Taken as a whole, [*]~[!$(*#*)&amp;!D1] means any atom with a bond to an atom that doesn't have just one explicit bond or a triple bond.

Basically, the pattern is trying to find a single bond in the middle with some rotatable side-groups:
[*]~[...]-&amp;[..]~[*]

There's a very nice tool called SMARTS Viewer that can help to debug and construct SMARTS.



Seems like there are also now more polished commercial versions called SMARTStools through BioSolveIT including an editor.