![]() |
RDKit
Open-source cheminformatics and machine learning.
|
class for reading and searching multiple FPB files More...
#include <MultiFPBReader.h>
Public Types | |
typedef boost::tuple< double, unsigned int, unsigned int > | ResultTuple |
Public Member Functions | |
MultiFPBReader () | |
MultiFPBReader (bool initOnSearch) | |
MultiFPBReader (std::vector< FPBReader *> &readers, bool takeOwnership=false, bool initOnSearch=false) | |
~MultiFPBReader () | |
void | init () |
Read the data from the file and initialize internal data structures. More... | |
unsigned int | length () const |
returns the number of readers More... | |
unsigned int | nBits () const |
FPBReader * | getReader (unsigned int which) |
returns a particular reader More... | |
unsigned int | addReader (FPBReader *rdr) |
adds a new FPBReader to our list More... | |
std::vector< ResultTuple > | getTanimotoNeighbors (const boost::uint8_t *bv, double threshold=0.7, int numThreads=1) const |
returns tanimoto neighbors that are within a similarity threshold More... | |
std::vector< ResultTuple > | getTanimotoNeighbors (boost::shared_array< boost::uint8_t > bv, double threshold=0.7, int numThreads=1) const |
std::vector< ResultTuple > | getTanimotoNeighbors (const ExplicitBitVect &ebv, double threshold=0.7, int numThreads=1) const |
std::vector< ResultTuple > | getTverskyNeighbors (const boost::uint8_t *bv, double ca, double cb, double threshold=0.7, int numThreads=1) const |
returns Tversky neighbors that are within a similarity threshold More... | |
std::vector< ResultTuple > | getTverskyNeighbors (boost::shared_array< boost::uint8_t > bv, double ca, double cb, double threshold=0.7, int numThreads=1) const |
std::vector< ResultTuple > | getTverskyNeighbors (const ExplicitBitVect &ebv, double ca, double cb, double threshold=0.7, int numThreads=1) const |
std::vector< std::pair< unsigned int, unsigned int > > | getContainingNeighbors (const boost::uint8_t *bv, int numThreads=1) const |
returns indices of all fingerprints that completely contain this one More... | |
std::vector< std::pair< unsigned int, unsigned int > > | getContainingNeighbors (boost::shared_array< boost::uint8_t > bv, int numThreads=1) const |
std::vector< std::pair< unsigned int, unsigned int > > | getContainingNeighbors (const ExplicitBitVect &ebv, int numThreads=1) const |
class for reading and searching multiple FPB files
basic usage:
Note: this functionality is experimental and the API may change in future releases.
Note on thread safety Operations that involve reading from FPB files are not thread safe. This means that the init()
method is not thread safe and none of the search operations are thread safe when an FPBReader
is initialized in lazyRead
mode.
Definition at line 53 of file MultiFPBReader.h.
typedef boost::tuple<double, unsigned int, unsigned int> RDKit::MultiFPBReader::ResultTuple |
Definition at line 55 of file MultiFPBReader.h.
|
inline |
Definition at line 56 of file MultiFPBReader.h.
Referenced by getContainingNeighbors(), and MultiFPBReader().
|
inline |
initOnSearch | if this is true, the init() method on child readers will not be called until the first search is done. This is useful with large FPB readers. |
Definition at line 64 of file MultiFPBReader.h.
References MultiFPBReader().
RDKit::MultiFPBReader::MultiFPBReader | ( | std::vector< FPBReader *> & | readers, |
bool | takeOwnership = false , |
||
bool | initOnSearch = false |
||
) |
|
inline |
Definition at line 78 of file MultiFPBReader.h.
References init().
|
inline |
adds a new FPBReader to our list
This does no error checking on the reader, so be careful.
If takeOwnership
is true
then we will take ownership of the memory.
rdr | the reader to add. If we have already been initialized, the reader's init() method will be called |
Definition at line 120 of file MultiFPBReader.h.
References getTanimotoNeighbors(), RDKit::FPBReader::init(), and PRECONDITION.
std::vector<std::pair<unsigned int, unsigned int> > RDKit::MultiFPBReader::getContainingNeighbors | ( | const boost::uint8_t * | bv, |
int | numThreads = 1 |
||
) | const |
returns indices of all fingerprints that completely contain this one
(i.e. where all the bits set in the query are also set in the db molecule)
Referenced by getContainingNeighbors(), and getTverskyNeighbors().
|
inline |
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 190 of file MultiFPBReader.h.
References getContainingNeighbors(), and MultiFPBReader().
std::vector<std::pair<unsigned int, unsigned int> > RDKit::MultiFPBReader::getContainingNeighbors | ( | const ExplicitBitVect & | ebv, |
int | numThreads = 1 |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
FPBReader* RDKit::MultiFPBReader::getReader | ( | unsigned int | which | ) |
std::vector<ResultTuple> RDKit::MultiFPBReader::getTanimotoNeighbors | ( | const boost::uint8_t * | bv, |
double | threshold = 0.7 , |
||
int | numThreads = 1 |
||
) | const |
returns tanimoto neighbors that are within a similarity threshold
The result vector of (similarity,index,reader) tuples is sorted in order of decreasing similarity
bv | the query fingerprint |
threshold | the minimum similarity to return |
numThreads | Sets the number of threads to use (more than one thread will only be used if the RDKit was build with multithread support) If set to zero, the max supported by the system will be used. |
Referenced by addReader(), and getTanimotoNeighbors().
|
inline |
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 143 of file MultiFPBReader.h.
References getTanimotoNeighbors(), and getTverskyNeighbors().
std::vector<ResultTuple> RDKit::MultiFPBReader::getTanimotoNeighbors | ( | const ExplicitBitVect & | ebv, |
double | threshold = 0.7 , |
||
int | numThreads = 1 |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
std::vector<ResultTuple> RDKit::MultiFPBReader::getTverskyNeighbors | ( | const boost::uint8_t * | bv, |
double | ca, | ||
double | cb, | ||
double | threshold = 0.7 , |
||
int | numThreads = 1 |
||
) | const |
returns Tversky neighbors that are within a similarity threshold
The result vector of (similarity,index) pairs is sorted in order of decreasing similarity
bv | the query fingerprint |
ca | the Tversky a coefficient |
cb | the Tversky a coefficient |
threshold | the minimum similarity to return |
numThreads | Sets the number of threads to use (more than one thread will only be used if the RDKit was build with multithread support) If set to zero, the max supported by the system will be used. |
Referenced by getTanimotoNeighbors(), and getTverskyNeighbors().
|
inline |
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 172 of file MultiFPBReader.h.
References getContainingNeighbors(), and getTverskyNeighbors().
std::vector<ResultTuple> RDKit::MultiFPBReader::getTverskyNeighbors | ( | const ExplicitBitVect & | ebv, |
double | ca, | ||
double | cb, | ||
double | threshold = 0.7 , |
||
int | numThreads = 1 |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void RDKit::MultiFPBReader::init | ( | ) |
Read the data from the file and initialize internal data structures.
This must be called before most of the other methods of this clases. It calls the init()
method on each of the child FPBReaders
Referenced by ~MultiFPBReader().
|
inline |
returns the number of readers
Definition at line 95 of file MultiFPBReader.h.
References getReader(), and nBits().
unsigned int RDKit::MultiFPBReader::nBits | ( | ) | const |
returns the number of bits in our fingerprints (all readers are expected to have the same length)
Referenced by length().