RDKit
Open-source cheminformatics and machine learning.
|
class for reading and searching multiple FPB files More...
#include <MultiFPBReader.h>
Public Types | |
typedef std::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. | |
unsigned int | length () const |
returns the number of readers | |
unsigned int | nBits () const |
FPBReader * | getReader (unsigned int which) |
returns a particular reader | |
unsigned int | addReader (FPBReader *rdr) |
adds a new FPBReader to our list | |
std::vector< ResultTuple > | getTanimotoNeighbors (const std::uint8_t *bv, double threshold=0.7, int numThreads=1) const |
returns tanimoto neighbors that are within a similarity threshold | |
std::vector< ResultTuple > | getTanimotoNeighbors (boost::shared_array< std::uint8_t > bv, 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 > | 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 > | getTverskyNeighbors (const std::uint8_t *bv, double ca, double cb, double threshold=0.7, int numThreads=1) const |
returns Tversky neighbors that are within a similarity threshold | |
std::vector< ResultTuple > | getTverskyNeighbors (boost::shared_array< std::uint8_t > bv, 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. | |
std::vector< ResultTuple > | 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. | |
std::vector< std::pair< unsigned int, unsigned int > > | getContainingNeighbors (const std::uint8_t *bv, int numThreads=1) const |
returns indices of all fingerprints that completely contain this one | |
std::vector< std::pair< unsigned int, unsigned int > > | getContainingNeighbors (boost::shared_array< std::uint8_t > bv, 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< std::pair< unsigned int, unsigned int > > | 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. | |
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.
Definition at line 55 of file MultiFPBReader.h.
|
inline |
Definition at line 56 of file MultiFPBReader.h.
|
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 63 of file MultiFPBReader.h.
|
inline |
Definition at line 77 of file MultiFPBReader.h.
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 121 of file MultiFPBReader.h.
References RDKit::FPBReader::init(), and PRECONDITION.
|
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 193 of file MultiFPBReader.h.
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.
std::vector< std::pair< unsigned int, unsigned int > > RDKit::MultiFPBReader::getContainingNeighbors | ( | const std::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)
returns a particular reader
which | the reader to return |
|
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 146 of file MultiFPBReader.h.
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::getTanimotoNeighbors | ( | const std::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. |
|
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 175 of file MultiFPBReader.h.
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.
std::vector< ResultTuple > RDKit::MultiFPBReader::getTverskyNeighbors | ( | const std::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. |
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 class. It calls the init()
method on each of the child FPBReaders
returns the number of readers
Definition at line 96 of file MultiFPBReader.h.
returns the number of bits in our fingerprints (all readers are expected to have the same length)