Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.ConfGen.FragmentLibraryEntry Class Reference

Data structure representing a single entry of a conformer generation fragment library. More...

+ Inheritance diagram for CDPL.ConfGen.FragmentLibraryEntry:

Public Member Functions

None __init__ ()
 Constructs an empty FragmentLibraryEntry instance.
 
None __init__ (FragmentLibraryEntry entry)
 Initializes a copy of the FragmentLibraryEntry instance entry. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
FragmentLibraryEntry assign (FragmentLibraryEntry entry)
 Replaces the current state of self with a copy of the state of the FragmentLibraryEntry instance entry. More...
 
None setHashCode (int hash_code)
 Sets the hash code identifying the entry within the FragmentLibrary. More...
 
int getHashCode ()
 Returns the hash code identifying the entry within the FragmentLibrary. More...
 
None setSMILES (str smiles)
 Sets the canonical SMILES string describing the stored fragment. More...
 
str getSMILES ()
 Returns the canonical SMILES string describing the stored fragment. More...
 
int getNumAtoms ()
 Returns the number of atoms of the stored fragment. More...
 
int getNumConformers ()
 Returns the number of stored conformers. More...
 
None clearConformers ()
 Removes all stored conformers from the entry.
 
None addConformer (ConformerData conf_data)
 Appends the given conformer to the entry. More...
 
ConformerData getConformer (int idx)
 Returns a reference to the stored conformer at index idx. More...
 
ConformerData __getitem__ (int idx)
 

Properties

 objectID = property(getObjectID)
 
 numConformers = property(getNumConformers)
 
 numAtoms = property(getNumAtoms)
 
 hashCode = property(getHashCode, setHashCode)
 
 smiles = property(getSMILES, setSMILES)
 

Detailed Description

Data structure representing a single entry of a conformer generation fragment library.

Each entry is identified by the hash code of the associated ConfGen.CanonicalFragment and stores the canonical SMILES string plus a list of ConformerData instances (one per stored conformer).

Constructor & Destructor Documentation

◆ __init__()

None CDPL.ConfGen.FragmentLibraryEntry.__init__ ( FragmentLibraryEntry  entry)

Initializes a copy of the FragmentLibraryEntry instance entry.

Parameters
entryThe FragmentLibraryEntry instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.ConfGen.FragmentLibraryEntry.getObjectID ( )

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

Different Python FragmentLibraryEntry 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 FragmentLibraryEntry 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.

◆ assign()

FragmentLibraryEntry CDPL.ConfGen.FragmentLibraryEntry.assign ( FragmentLibraryEntry  entry)

Replaces the current state of self with a copy of the state of the FragmentLibraryEntry instance entry.

Parameters
entryThe FragmentLibraryEntry instance to copy.
Returns
self

◆ setHashCode()

None CDPL.ConfGen.FragmentLibraryEntry.setHashCode ( int  hash_code)

Sets the hash code identifying the entry within the FragmentLibrary.

Parameters
hash_codeThe new hash code.

◆ getHashCode()

int CDPL.ConfGen.FragmentLibraryEntry.getHashCode ( )

Returns the hash code identifying the entry within the FragmentLibrary.

Returns
The hash code.

◆ setSMILES()

None CDPL.ConfGen.FragmentLibraryEntry.setSMILES ( str  smiles)

Sets the canonical SMILES string describing the stored fragment.

Parameters
smilesThe new SMILES string.

◆ getSMILES()

str CDPL.ConfGen.FragmentLibraryEntry.getSMILES ( )

Returns the canonical SMILES string describing the stored fragment.

Returns
A reference to the SMILES string.

◆ getNumAtoms()

int CDPL.ConfGen.FragmentLibraryEntry.getNumAtoms ( )

Returns the number of atoms of the stored fragment.

Returns
The number of atoms (zero if no conformer has been added yet).

◆ getNumConformers()

int CDPL.ConfGen.FragmentLibraryEntry.getNumConformers ( )

Returns the number of stored conformers.

Returns
The number of stored conformers.

◆ addConformer()

None CDPL.ConfGen.FragmentLibraryEntry.addConformer ( ConformerData  conf_data)

Appends the given conformer to the entry.

Parameters
conf_dataA smart reference to the conformer data to add.

◆ getConformer()

ConformerData CDPL.ConfGen.FragmentLibraryEntry.getConformer ( int  idx)

Returns a reference to the stored conformer at index idx.

Parameters
idxThe zero-based conformer index.
Returns
A reference to the conformer.
Exceptions
Base.IndexErrorif the number of stored conformers is zero or idx is not in the range [0, getNumConformers() - 1].

◆ __getitem__()

ConformerData CDPL.ConfGen.FragmentLibraryEntry.__getitem__ ( int  idx)
Parameters
idx
Returns