chemaxon.search
This package contains functions for chemical searches with molecules.
GitHub examples: https://github.com/ChemAxon/python-examples/blob/main/jupyter/06_molecule_search.ipynb
Search object to perform molecule searches
The configuration string of the standardizer to be applied before the search, or the
chemaxon.standardizer.standardizer.Standardizer object. Default is general aromatization, if None or empty
string is provided, no standardization will be applied
Molecule searching. Returns the first hit in the target chemaxon.Molecule.
Parameters
- query:
chemaxon.Molecule- Thechemaxon.Moleculeto match - target:
chemaxon.Molecule- The targetchemaxon.Moleculeto which thequery_molis being matched - return_colored_hit:
bool- IfTrue, colored target is returned showing the matched atoms and bonds. Default isFalse.
Returns
SearchHit, orNoneif there was no match.
Molecule searching in list. Returns the first hit in the chemaxon.Molecule for each target.
Get a list of SearchHits or None.
Parameters
- query:
chemaxon.Molecule- Thechemaxon.Moleculeto search with - target_list:
list[chemaxon.Molecule]- The list ofchemaxon.Molecules to match against - return_colored_hit:
bool-IfTrue, colored targets are returned showing the matched atoms and bonds. Default isFalse.
Raises
- RuntimeError: In case of exception (unrecoverable errors) the function will exit and stop the searching.
Returns
list[SearchHit | None]- List ofSearchHitobjects in the same order as the input list of targets (target_mol_list). If no hit was found on a given target, None is returned on the corresponding index.
Molecule searching. Returns all hits of the query in the target chemaxon.Molecule.
Every distinct mapping of the query onto the target (including symmetry-equivalent ones) is
returned as a separate SearchHit.
Parameters
- query:
chemaxon.Molecule- Thechemaxon.Moleculeto match - target:
chemaxon.Molecule- The targetchemaxon.Moleculeto which thequeryis being matched - return_colored_hit:
bool- IfTrue, each hit carries a colored target showing the matched atoms and bonds. Default isFalse. - limit:
int- The maximum number of hits to collect. The search stops once this many hits are found, or there are no more hits, so the result never exceedslimit(it is truncated in match order for targets with more matches). Must be at least1. Default isDEFAULT_FIND_ALL_LIMIT.
Raises
- ValueError: If
limitis less than1.
Returns
list[SearchHit]- OneSearchHitper match, at mostlimitof them. An empty list if there was no match.
Supported molecule search types
Substructure search that applies both screening and atom-by-atom search. This is the default search type.
Search hit result object
List of atom indices in the target molecule that were matched by the query molecule. The index of the i-th
atom (in the list) is the index of the target atom matched against the ith atom in the query molecule.
None if there was no match