MoleculePattern
✖
MoleculePattern
represents a molecule pattern with atoms atomi and bonds bondi for use in substructure searching.
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 patt1patt2… 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.
Examples
Basic Examples (3)Summary of the most common use cases
Define a pattern for sulfur-oxygen bonds:

https://wolfram.com/xid/0cf1mg4w2yvo0pe-ge6nnj

Use MoleculeContainsQ to verify the molecule matches the pattern:

https://wolfram.com/xid/0cf1mg4w2yvo0pe-szu7z6

Use the pattern in MoleculePlot to visualize:

https://wolfram.com/xid/0cf1mg4w2yvo0pe-oxu06h

Find bonds between carbon and heavier atoms:

https://wolfram.com/xid/0cf1mg4w2yvo0pe-gt4dhf

https://wolfram.com/xid/0cf1mg4w2yvo0pe-drg3ky

https://wolfram.com/xid/0cf1mg4w2yvo0pe-3bfamu


https://wolfram.com/xid/0cf1mg4w2yvo0pe-3b8rrt


https://wolfram.com/xid/0cf1mg4w2yvo0pe-3x5myg


https://wolfram.com/xid/0cf1mg4w2yvo0pe-vlq6e5

Make a molecule pattern from part of a molecule:

https://wolfram.com/xid/0cf1mg4w2yvo0pe-6gs49y

https://wolfram.com/xid/0cf1mg4w2yvo0pe-9k66pb
Find this pattern in the parent molecule:

https://wolfram.com/xid/0cf1mg4w2yvo0pe-dch2au

Visualize the pattern with MoleculePlot:

https://wolfram.com/xid/0cf1mg4w2yvo0pe-bcupwc

Wolfram Research (2019), MoleculePattern, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculePattern.html.
Text
Wolfram Research (2019), MoleculePattern, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculePattern.html.
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.
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
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: 09-May-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: 09-May-2025
]}