![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
A library of pre-generated conformations for rigid molecular fragments, indexed by canonical-fragment hash code. More...
Inheritance diagram for CDPL.ConfGen.FragmentLibrary:Public Member Functions | |
| None | __init__ () |
Constructs an empty FragmentLibrary instance. | |
| None | __init__ (FragmentLibrary lib) |
Constructs a copy of the FragmentLibrary instance lib. More... | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| None | addEntries (FragmentLibrary lib) |
| Adds all entries from lib to this library. More... | |
| bool | addEntry (FragmentLibraryEntry entry) |
| Adds the given entry to the library. More... | |
| bool | removeEntry (int hash_code) |
| Removes the entry with the specified hash code. More... | |
| FragmentLibraryEntry | getEntry (int hash_code) |
| Returns the entry with the specified hash code. More... | |
| bool | containsEntry (int hash_code) |
| Tells whether the library contains an entry with the specified hash code. More... | |
| None | clear () |
| Removes all entries from the library. | |
| int | getNumEntries () |
| Returns the number of entries stored in the library. More... | |
| list | getEntries () |
| None | load (Base.IStream is) |
| Loads the contents of the library from the input stream is. More... | |
| None | loadDefaults () |
| Loads the default fragment library bundled with CDPKit. | |
| None | save (Base.OStream os) |
| Writes the contents of the library to the output stream os. More... | |
| FragmentLibrary | assign (FragmentLibrary lib) |
| Replaces the contents of this library with a copy of the contents of lib. More... | |
Static Public Member Functions | |
| None | set (FragmentLibrary lib) |
| Sets the process-wide default fragment library used by ConfGen routines. More... | |
| FragmentLibrary | get () |
| Returns the process-wide default fragment library. More... | |
Properties | |
| objectID = property(getObjectID) | |
| numEntries = property(getNumEntries) | |
| entries = property(getEntries) | |
A library of pre-generated conformations for rigid molecular fragments, indexed by canonical-fragment hash code.
Entries are FragmentLibraryEntry instances keyed by the hash code of the associated ConfGen.CanonicalFragment. The library is iterable, supports lookup/insertion/removal, can be serialized to and from a stream, and provides a process-wide default instance via the static set() / get() accessors. A built-in mutex is exposed via getMutex() to allow callers to coordinate concurrent access.
| None CDPL.ConfGen.FragmentLibrary.__init__ | ( | FragmentLibrary | lib | ) |
Constructs a copy of the FragmentLibrary instance lib.
| lib | The FragmentLibrary to copy. |
| int CDPL.ConfGen.FragmentLibrary.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python FragmentLibrary 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 FragmentLibrary 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().
| None CDPL.ConfGen.FragmentLibrary.addEntries | ( | FragmentLibrary | lib | ) |
Adds all entries from lib to this library.
| lib | The source FragmentLibrary. |
| bool CDPL.ConfGen.FragmentLibrary.addEntry | ( | FragmentLibraryEntry | entry | ) |
Adds the given entry to the library.
| entry | The entry to add. |
True if the entry was added, and False if an entry with the same hash code was already present. | bool CDPL.ConfGen.FragmentLibrary.removeEntry | ( | int | hash_code | ) |
Removes the entry with the specified hash code.
| hash_code | The hash code of the entry to remove. |
True if the entry was removed, and False if no matching entry existed. | FragmentLibraryEntry CDPL.ConfGen.FragmentLibrary.getEntry | ( | int | hash_code | ) |
Returns the entry with the specified hash code.
| hash_code | The hash code of the queried entry. |
| bool CDPL.ConfGen.FragmentLibrary.containsEntry | ( | int | hash_code | ) |
Tells whether the library contains an entry with the specified hash code.
| hash_code | The hash code of the queried entry. |
True if the entry exists, and False otherwise. | int CDPL.ConfGen.FragmentLibrary.getNumEntries | ( | ) |
Returns the number of entries stored in the library.
| list CDPL.ConfGen.FragmentLibrary.getEntries | ( | ) |
| None CDPL.ConfGen.FragmentLibrary.load | ( | Base.IStream | is | ) |
Loads the contents of the library from the input stream is.
| is | The input stream to read from. |
| None CDPL.ConfGen.FragmentLibrary.save | ( | Base.OStream | os | ) |
Writes the contents of the library to the output stream os.
| os | The output stream to write to. |
| FragmentLibrary CDPL.ConfGen.FragmentLibrary.assign | ( | FragmentLibrary | lib | ) |
Replaces the contents of this library with a copy of the contents of lib.
| lib | The source FragmentLibrary. |
|
static |
Sets the process-wide default fragment library used by ConfGen routines.
| lib | The new default fragment library. |
|
static |
Returns the process-wide default fragment library.