hasSubstructMatch#
- nvmolkit.substructure.hasSubstructMatch(
- targets: Sequence[Mol],
- queries: Sequence[Mol],
- config: SubstructSearchConfig | None = None,
Check if targets contain query substructures (boolean results).
More efficient than
getSubstructMatches()when only existence is needed.Supports recursive SMARTS queries. Does not currently support chirality-aware matching (
useChirality), enhanced stereochemistry (useEnhancedStereo), or other advanced RDKitSubstructMatchParametersoptions.- Parameters:
targets – List of target RDKit molecules.
queries – List of query RDKit molecules (typically from SMARTS).
config –
SubstructSearchConfigwith execution settings. IfNone, uses default configuration.
- Returns:
2-D numpy array of
uint8with shape(len(targets), len(queries)).results[target_idx, query_idx]is 1 if the query is a substructure of the target, 0 otherwise.