Chemical Data Processing Library Python API - Version 1.0.0
Public Member Functions | Properties | List of all members
CDPL.Chem.AutomorphismGroupSearch Class Reference

AutomorphismGroupSearch. More...

+ Inheritance diagram for CDPL.Chem.AutomorphismGroupSearch:

Public Member Functions

None __init__ (int atom_flags=12702, int bond_flags=30)
 Constructs and initializes a AutomorphismGroupSearch instance.
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None setAtomPropertyFlags (int flags)
 
int getAtomPropertyFlags ()
 
None setBondPropertyFlags (int flags)
 
int getBondPropertyFlags ()
 
None includeIdentityMapping (bool include)
 
bool identityMappingIncluded ()
 
bool findMappings (MolecularGraph molgraph)
 Searches for the possible atom/bond mappings in the automorphism group of the given molecular graph. More...
 
None stopSearch ()
 
int getNumMappings ()
 Returns the number of atom/bond mappings that were recorded in the last call to findMappings(). More...
 
AtomBondMapping getMapping (int idx)
 Returns a reference to the stored atom/bond mapping object at index idx. More...
 
int getMaxNumMappings ()
 Returns the specified limit on the number of stored atom/bond mappings. More...
 
None setMaxNumMappings (int max_num_mappings)
 Allows to specify a limit on the number of stored atom/bond mappings. More...
 
None setFoundMappingCallback (BoolMolecularGraphAtomBondMappingFunctor func)
 
BoolMolecularGraphAtomBondMappingFunctor getFoundMappingCallback ()
 
AtomBondMapping __getitem__ (int idx)
 
int __len__ ()
 

Properties

 objectID = property(getObjectID)
 
 atomPropertyFlags = property(getAtomPropertyFlags, setAtomPropertyFlags)
 
 bondPropertyFlags = property(getBondPropertyFlags, setBondPropertyFlags)
 
 incIdentityMapping = property(identityMappingIncluded, includeIdentityMapping)
 
 numMappings = property(getNumMappings)
 
 maxNumMappings = property(getMaxNumMappings, setMaxNumMappings)
 
 foundMappingCallback = property(getFoundMappingCallback, setFoundMappingCallback)
 

Detailed Description

AutomorphismGroupSearch.

Member Function Documentation

◆ getObjectID()

int CDPL.Chem.AutomorphismGroupSearch.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python AutomorphismGroupSearch instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two AutomorphismGroupSearch instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ setAtomPropertyFlags()

None CDPL.Chem.AutomorphismGroupSearch.setAtomPropertyFlags ( int  flags)
Parameters
flags

◆ getAtomPropertyFlags()

int CDPL.Chem.AutomorphismGroupSearch.getAtomPropertyFlags ( )
Returns

◆ setBondPropertyFlags()

None CDPL.Chem.AutomorphismGroupSearch.setBondPropertyFlags ( int  flags)
Parameters
flags

◆ getBondPropertyFlags()

int CDPL.Chem.AutomorphismGroupSearch.getBondPropertyFlags ( )
Returns

◆ includeIdentityMapping()

None CDPL.Chem.AutomorphismGroupSearch.includeIdentityMapping ( bool  include)
Parameters
include

◆ identityMappingIncluded()

bool CDPL.Chem.AutomorphismGroupSearch.identityMappingIncluded ( )
Returns

◆ findMappings()

bool CDPL.Chem.AutomorphismGroupSearch.findMappings ( MolecularGraph  molgraph)

Searches for the possible atom/bond mappings in the automorphism group of the given molecular graph.

The method will store all found mappings up to the maximum number of recorded mappings specified by setMaxNumMappings().

Parameters
molgraphThe molecular graph that has to be searched for automorphisms.
Returns
True if any mappings of the specified molecular graph have been found, and False otherwise.
Note
Any atom/bond mappings that were recorded in a previous call to findMappings() will be discarded.

◆ getNumMappings()

int CDPL.Chem.AutomorphismGroupSearch.getNumMappings ( )

Returns the number of atom/bond mappings that were recorded in the last call to findMappings().

Returns
The number of atom/bond mappings that were recorded in the last call to findMappings().

◆ getMapping()

AtomBondMapping CDPL.Chem.AutomorphismGroupSearch.getMapping ( int  idx)

Returns a reference to the stored atom/bond mapping object at index idx.

Parameters
idxThe zero-based index of the atom/bond mapping object to return.
Returns
A reference to the atom/bond mapping object at index idx.
Exceptions
Base.IndexErrorif no mappings are available or idx is not in the range [0, getNumMappings() - 1].

◆ getMaxNumMappings()

int CDPL.Chem.AutomorphismGroupSearch.getMaxNumMappings ( )

Returns the specified limit on the number of stored atom/bond mappings.

Returns
The specified maximum number of stored atom/bond mappings.
See also
setMaxNumMappings(), findMappings()

◆ setMaxNumMappings()

None CDPL.Chem.AutomorphismGroupSearch.setMaxNumMappings ( int  max_num_mappings)

Allows to specify a limit on the number of stored atom/bond mappings.

In a call to findMappings() the automorphism search will terminate as soon as the specified maximum number of stored atom/bond mappings has been reached. A previously set limit on the number of mappings can be disabled by providing zero for the value of max_num_mappings.

Parameters
max_num_mappingsThe maximum number of atom/bond mappings to store.
Note
By default, no limit is imposed on the number of stored mappings.

◆ setFoundMappingCallback()

None CDPL.Chem.AutomorphismGroupSearch.setFoundMappingCallback ( BoolMolecularGraphAtomBondMappingFunctor  func)
Parameters
func

◆ getFoundMappingCallback()

BoolMolecularGraphAtomBondMappingFunctor CDPL.Chem.AutomorphismGroupSearch.getFoundMappingCallback ( )
Returns

◆ __getitem__()

AtomBondMapping CDPL.Chem.AutomorphismGroupSearch.__getitem__ ( int  idx)
Parameters
idx
Returns

◆ __len__()

int CDPL.Chem.AutomorphismGroupSearch.__len__ ( )
Returns