MoleculeSubstructureCount[mol,patt]
gives a count of the number of times patt appears as a substructure in mol.
MoleculeSubstructureCount[patt]
represents an operator form of MoleculeSubstructureCount that can be applied to a molecule.


MoleculeSubstructureCount
MoleculeSubstructureCount[mol,patt]
gives a count of the number of times patt appears as a substructure in mol.
MoleculeSubstructureCount[patt]
represents an operator form of MoleculeSubstructureCount that can be applied to a molecule.
Details and Options

- patt should be one of the following forms:
-
MoleculePattern[…] a molecule pattern Atom[…] a pattern for a single atom Bond[{a1,a2}] a bond between atoms with specified patterns - By default, substructure matches are pruned to remove multiple matches to the same set of atoms. Use the option Overlaps->True to disable this behavior.
Examples
open all close allBasic Examples (3)
Scope (2)
Create a molecule from an ExternalIdentifier and find how many carbon-oxygen bonds it has:
Related Guides
History
Text
Wolfram Research (2021), MoleculeSubstructureCount, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculeSubstructureCount.html.
CMS
Wolfram Language. 2021. "MoleculeSubstructureCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MoleculeSubstructureCount.html.
APA
Wolfram Language. (2021). MoleculeSubstructureCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MoleculeSubstructureCount.html
BibTeX
@misc{reference.wolfram_2025_moleculesubstructurecount, author="Wolfram Research", title="{MoleculeSubstructureCount}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/MoleculeSubstructureCount.html}", note=[Accessed: 10-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_moleculesubstructurecount, organization={Wolfram Research}, title={MoleculeSubstructureCount}, year={2021}, url={https://reference.wolfram.com/language/ref/MoleculeSubstructureCount.html}, note=[Accessed: 10-August-2025]}