countSubstructMatches#

nvmolkit.substructure.countSubstructMatches(
targets: Sequence[Mol],
queries: Sequence[Mol],
config: SubstructSearchConfig | None = None,
) ndarray#

Count substructure matches per target/query pair.

Supports match deduplication (uniquify) and recursive SMARTS queries. Does not currently support chirality-aware matching (useChirality), enhanced stereochemistry (useEnhancedStereo), or other advanced RDKit SubstructMatchParameters options.

Parameters:
  • targets – List of target RDKit molecules.

  • queries – List of query RDKit molecules (typically from SMARTS).

  • configSubstructSearchConfig with execution settings. If None, uses default configuration.

Returns:

2-D numpy array of int with shape (len(targets), len(queries)). results[target_idx, query_idx] is the number of substructure matches.