MoleculePattern

MoleculePattern[{atom1,atom2, }, { bond1,bond2, }]

represents a molecule pattern with atoms atomi and bonds bondi for use in substructure searching.

MoleculePattern["smarts"]

represents a molecule pattern from the input SMARTS pattern.

MoleculePattern[mol,{id1,id2,}]

returns a molecule pattern consisting of the atoms from mol with index idi and their connecting bonds.

Details

  • The atoms and bonds in a MoleculePattern are not checked for proper valence, and no implicit hydrogens are added.
  • Possible forms for the atom patterns include:
  • "sym"an atom with atomic symbol "sym"
    Atom["sym",rules]an atom with properties described by rules
    patt1|patt2|an atom matching any of the patti
  • A bond is entered as Bond[{id1,id2},"order"]. If the bond order is omitted, it will match any bond order.

Examples

Basic Examples  (3)

Define a pattern for sulfur-oxygen bonds:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Use the pattern in MoleculePlot to visualize:

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=

Find bonds between carbon and heavier atoms:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

Make a molecule pattern from part of a molecule:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input

Find this pattern in the parent molecule:

In[3]:=
Click for copyable input
Out[3]=

Visualize the pattern with MoleculePlot:

In[4]:=
Click for copyable input
Out[4]=
Introduced in 2019
(12.0)