Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Chem::AtomEnvironmentMatchExpression Class Reference

Chem::MatchExpression implementation that constrains target atoms by a specified structural environment. More...

#include <AtomEnvironmentMatchExpression.hpp>

+ Inheritance diagram for CDPL::Chem::AtomEnvironmentMatchExpression:

Public Types

typedef std::shared_ptr< AtomEnvironmentMatchExpression > SharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated AtomEnvironmentMatchExpression instances. More...
 
- Public Types inherited from CDPL::Chem::MatchExpression< Atom, MolecularGraph >
typedef std::shared_ptr< MatchExpression > SharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated MatchExpression instances. More...
 

Public Member Functions

 AtomEnvironmentMatchExpression (const MolecularGraph::SharedPointer &env_pattern, bool not_match)
 Constructs the AtomEnvironmentMatchExpression instance for the specified atom environment pattern and matching logic. More...
 
bool operator() (const Atom &query_atom, const MolecularGraph &query_molgraph, const Atom &target_atom, const MolecularGraph &target_molgraph, const Base::Any &aux_data) const
 Checks whether the structural environment of target_atom matches (or does not match) the query environment pattern specified in the constructor. More...
 
- Public Member Functions inherited from CDPL::Chem::MatchExpression< Atom, MolecularGraph >
virtual ~MatchExpression ()
 Virtual Destructor. More...
 
virtual bool operator() (const Atom &query_obj1, const MolecularGraph &query_obj2, const Atom &target_obj1, const MolecularGraph &target_obj2, const Base::Any &aux_data) const
 Performs an evaluation of the expression for the given query and target objects. More...
 
virtual bool operator() (const Atom &query_obj1, const MolecularGraph &query_obj2, const Atom &target_obj1, const MolecularGraph &target_obj2, const AtomBondMapping &mapping, const Base::Any &aux_data) const
 Performs an evaluation of the expression for the given query and target objects under consideration of the provided candidate atom/bond mapping. More...
 
virtual bool requiresAtomBondMapping () const
 Tells whether the expression must be reevaluated after a query to target atom/bond mapping candidate has been found. More...
 

Detailed Description

Chem::MatchExpression implementation that constrains target atoms by a specified structural environment.

A target atom matches the expression when the supplied atom environment pattern (anchored on the target atom) is found by an inner Chem::SubstructureSearch instance. The matching logic (match/not-match) is configurable.

Environment constraints can be specified as part of atom expressions in Daylight SMARTS patterns by recursive SMARTS using the syntax $(...) [SMARTS].

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated AtomEnvironmentMatchExpression instances.

Constructor & Destructor Documentation

◆ AtomEnvironmentMatchExpression()

CDPL::Chem::AtomEnvironmentMatchExpression::AtomEnvironmentMatchExpression ( const MolecularGraph::SharedPointer &  env_pattern,
bool  not_match 
)

Constructs the AtomEnvironmentMatchExpression instance for the specified atom environment pattern and matching logic.

Parameters
env_patternA substructure search pattern that describes the required (or not desired) structural environment of matching target atoms.
not_matchSpecifies whether the environment of a target atom actually has to match (true) or not match (false) the given query environment pattern.
Note
The substructure pattern has to be formulated in a way that the first atom of the environment pattern matches the evaluated target atom.

Member Function Documentation

◆ operator()()

bool CDPL::Chem::AtomEnvironmentMatchExpression::operator() ( const Atom &  query_atom,
const MolecularGraph &  query_molgraph,
const Atom &  target_atom,
const MolecularGraph &  target_molgraph,
const Base::Any &  aux_data 
) const

Checks whether the structural environment of target_atom matches (or does not match) the query environment pattern specified in the constructor.

Parameters
query_atomThe query atom (ignored).
query_molgraphThe molecular graph containing the query atom (ignored).
target_atomThe checked target atom.
target_molgraphThe molecular graph containing the target atom.
aux_dataAuxiliary information for expression evaluation (ignored).
Returns
If the matching logic is 'not match' (see constructor), the method returns false if the structural environment of the target atom matches the query environment pattern, and true if the pattern is not matched. Otherwise, true is returned if the atom environments match, and false if they do not.
Note
If an invalid query environment pattern has been specified (nullptr or the atom count is zero), the method will always return true - irrespective of matching logic and target atom environment.

The documentation for this class was generated from the following file: