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
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.
Details and Options

- 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",prop->val] an atom with properties described by rules patt1|patt2|… an atom matching any of the patti - A bond is entered as Bond[{id1,id2},"type"]. If the bond type is omitted, it will match any type.
- Possible options include:
-
AtomDiagramCoordinates Automatic two-dimensional coordinates StereochemistryElements None a list specifying a stereochemical arrangement
Examples
open all close allBasic Examples (3)
Define a pattern for sulfur-oxygen bonds:
Use MoleculeContainsQ to verify the molecule matches the pattern:
Use the pattern in MoleculePlot to visualize:
Find bonds between carbon and heavier atoms:
Make a molecule pattern from part of a molecule:
Find this pattern in the parent molecule:
Visualize the pattern with MoleculePlot:
Options (2)
Properties & Relations (1)
An invalid molecule pattern can be detected with MoleculePatternQ:
See Also
FindMoleculeSubstructure MoleculeContainsQ PatternReaction MoleculePlot AtomCount BondCount AtomList BondList
Function Repository: MoleculeRingPattern
Related Guides
History
Text
Wolfram Research (2019), MoleculePattern, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculePattern.html.
CMS
Wolfram Language. 2019. "MoleculePattern." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MoleculePattern.html.
APA
Wolfram Language. (2019). MoleculePattern. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MoleculePattern.html
BibTeX
@misc{reference.wolfram_2025_moleculepattern, author="Wolfram Research", title="{MoleculePattern}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/MoleculePattern.html}", note=[Accessed: 18-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_moleculepattern, organization={Wolfram Research}, title={MoleculePattern}, year={2019}, url={https://reference.wolfram.com/language/ref/MoleculePattern.html}, note=[Accessed: 18-August-2025]}