![]() |
RDKit
Open-source cheminformatics and machine learning.
|
A Catalog with a hierarchical structure. More...
#include <Catalog.h>
Classes | |
struct | vertex_entry_t |
used by the BGL to set up the node properties in our graph More... | |
Public Types | |
typedef boost::property< vertex_entry_t, entryType * > | EntryProperty |
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, EntryProperty > | CatalogGraph |
the type of the graph itself: More... | |
typedef boost::graph_traits< CatalogGraph > | CAT_GRAPH_TRAITS |
typedef CAT_GRAPH_TRAITS::vertex_iterator | VER_ITER |
typedef std::pair< VER_ITER, VER_ITER > | ENT_ITER_PAIR |
typedef CAT_GRAPH_TRAITS::adjacency_iterator | DOWN_ENT_ITER |
typedef std::pair< DOWN_ENT_ITER, DOWN_ENT_ITER > | DOWN_ENT_ITER_PAIR |
![]() | |
typedef entryType | entryType_t |
typedef paramType | paramType_t |
Public Member Functions | |
HierarchCatalog () | |
HierarchCatalog (paramType *params) | |
Construct by making a copy of the input params object. More... | |
HierarchCatalog (const std::string &pickle) | |
Construct from a pickle (a serialized form of the HierarchCatalog) More... | |
~HierarchCatalog () | |
void | toStream (std::ostream &ss) const |
serializes this object to a stream More... | |
std::string | Serialize () const |
serializes this object and returns the resulting pickle More... | |
void | initFromStream (std::istream &ss) |
fills the contents of this object from a stream containing a pickle More... | |
unsigned int | getNumEntries () const |
returns the number of entries More... | |
void | initFromString (const std::string &text) |
fills the contents of this object from a string containing a pickle More... | |
unsigned int | addEntry (entryType *entry, bool updateFPLength=true) |
add a new entry to the catalog More... | |
void | addEdge (unsigned int id1, unsigned int id2) |
adds an edge between two entries in the catalog More... | |
const entryType * | getEntryWithIdx (unsigned int idx) const |
returns a pointer to our entry with a particular index More... | |
const entryType * | getEntryWithBitId (unsigned int idx) const |
returns a pointer to our entry with a particular bit ID More... | |
int | getIdOfEntryWithBitId (unsigned int idx) const |
returns the index of the entry with a particular bit ID More... | |
RDKit::INT_VECT | getDownEntryList (unsigned int idx) const |
returns a list of the indices of entries below the one passed in More... | |
const RDKit::INT_VECT & | getEntriesOfOrder (orderType ord) |
returns a list of the indices that have a particular order More... | |
const RDKit::INT_VECT & | getEntriesOfOrder (orderType ord) const |
returns a list of the indices that have a particular order More... | |
![]() | |
Catalog () | |
virtual | ~Catalog () |
unsigned int | getFPLength () const |
returns the length of our fingerprint More... | |
void | setFPLength (unsigned int val) |
sets our fingerprint length More... | |
virtual void | setCatalogParams (paramType *params) |
sets our parameters by copying the params argument More... | |
const paramType * | getCatalogParams () const |
returns a pointer to our parameters More... | |
Additional Inherited Members | |
![]() | |
unsigned int | d_fpLength |
the length of our fingerprint More... | |
paramType * | dp_cParams |
our params object More... | |
A Catalog with a hierarchical structure.
The entries of a HierarchCatalog are arranged in a directed graph
The difference between Indices and Bit Ids
A HierarchCatalog may contain more entries than the user is actually interested in. For example a HierarchCatalog constructed to contain orders 5 through 8 may well contain information about orders 1-5, in order to facilitate some search optimizations.
0
will be the first entry with order 5.0
will be the first entry with order 1. typedef boost::graph_traits<CatalogGraph> RDCatalog::HierarchCatalog< entryType, paramType, orderType >::CAT_GRAPH_TRAITS |
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, EntryProperty> RDCatalog::HierarchCatalog< entryType, paramType, orderType >::CatalogGraph |
typedef CAT_GRAPH_TRAITS::adjacency_iterator RDCatalog::HierarchCatalog< entryType, paramType, orderType >::DOWN_ENT_ITER |
typedef std::pair<DOWN_ENT_ITER, DOWN_ENT_ITER> RDCatalog::HierarchCatalog< entryType, paramType, orderType >::DOWN_ENT_ITER_PAIR |
typedef std::pair<VER_ITER, VER_ITER> RDCatalog::HierarchCatalog< entryType, paramType, orderType >::ENT_ITER_PAIR |
typedef boost::property<vertex_entry_t, entryType *> RDCatalog::HierarchCatalog< entryType, paramType, orderType >::EntryProperty |
typedef CAT_GRAPH_TRAITS::vertex_iterator RDCatalog::HierarchCatalog< entryType, paramType, orderType >::VER_ITER |
|
inline |
|
inline |
Construct by making a copy of the input params
object.
Definition at line 165 of file Catalog.h.
References RDCatalog::Catalog< entryType, paramType >::setCatalogParams().
|
inline |
Construct from a pickle
(a serialized form of the HierarchCatalog)
Definition at line 172 of file Catalog.h.
References RDKit::EnumerationStrategyPickler::pickle().
|
inline |
|
inline |
adds an edge between two entries in the catalog
Since we are using a bidirectional graph - the order in which the ids are supplied here makes a difference
id1 | index of the edge's beginning |
id2 | index of the edge's end |
Definition at line 336 of file Catalog.h.
References RDCatalog::Catalog< entryType, paramType >::getNumEntries(), and URANGE_CHECK.
|
inlinevirtual |
add a new entry to the catalog
entry | the entry to be added |
updateFPLength | (optional) if this is true, our internal fingerprint length will also be updated. |
Implements RDCatalog::Catalog< entryType, paramType >.
Definition at line 305 of file Catalog.h.
References RDCatalog::Catalog< entryType, paramType >::getFPLength(), PRECONDITION, and RDCatalog::Catalog< entryType, paramType >::setFPLength().
|
inline |
|
inline |
|
inline |
returns a list of the indices that have a particular order
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 422 of file Catalog.h.
References CHECK_INVARIANT.
|
inline |
returns a pointer to our entry with a particular bit ID
Definition at line 365 of file Catalog.h.
References RDCatalog::Catalog< entryType, paramType >::getFPLength(), RDCatalog::Catalog< entryType, paramType >::getNumEntries(), and URANGE_CHECK.
|
inlinevirtual |
returns a pointer to our entry with a particular index
Implements RDCatalog::Catalog< entryType, paramType >.
Definition at line 355 of file Catalog.h.
References RDCatalog::Catalog< entryType, paramType >::getNumEntries(), and URANGE_CHECK.
|
inline |
returns the index of the entry with a particular bit ID
Definition at line 382 of file Catalog.h.
References RDCatalog::Catalog< entryType, paramType >::getFPLength(), RDCatalog::Catalog< entryType, paramType >::getNumEntries(), and URANGE_CHECK.
|
inlinevirtual |
returns the number of entries
Implements RDCatalog::Catalog< entryType, paramType >.
|
inline |
fills the contents of this object from a stream containing a pickle
Definition at line 236 of file Catalog.h.
References RDCatalog::Catalog< entryType, paramType >::addEntry(), RDCatalog::Catalog< entryType, paramType >::setCatalogParams(), RDCatalog::Catalog< entryType, paramType >::setFPLength(), and RDKit::streamRead().
|
inline |
|
inlinevirtual |
serializes this object and returns the resulting pickle
Implements RDCatalog::Catalog< entryType, paramType >.
Definition at line 227 of file Catalog.h.
References RDLog::toStream().
|
inline |
serializes this object to a stream
Definition at line 181 of file Catalog.h.
References RDCatalog::Catalog< entryType, paramType >::getCatalogParams(), RDCatalog::Catalog< entryType, paramType >::getEntryWithIdx(), RDCatalog::Catalog< entryType, paramType >::getFPLength(), RDCatalog::Catalog< entryType, paramType >::getNumEntries(), PRECONDITION, and RDKit::streamWrite().