Loading...
Searching...
No Matches
RDKit::MultiFPBReader Class Reference

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.

## Detailed Description

class for reading and searching multiple FPB files

basic usage:

FPBReader r1("foo1.fpb"),r2("foo2.fpb");
std::vector<FPBReader *> readers;
readers.append(&r1);
readers.append(&r2);
MultiFPBReader fpbs(readers);
fpbs.init();
boost::shared_ptr<ExplicitBitVect> ebv = fpbs.getReader(0)->getFP(95);
std::vector<std::tuple<double,unsigned int, unsigned int> > nbrs =
fpbs.getTanimotoNeighbors(*ebv.get(), 0.70);
RDKit::FPBReader
class for reading and searching FPB files
Definition FPBReader.h:58
RDKit::MultiFPBReader::MultiFPBReader
MultiFPBReader()
Definition MultiFPBReader.h:56

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.

## Member Typedef Documentation

## ResultTuple

typedef std::tuple<double, unsigned int, unsigned int> RDKit::MultiFPBReader::ResultTuple

Definition at line 55 of file MultiFPBReader.h.

## Constructor & Destructor Documentation

## MultiFPBReader() [1/3]

RDKit::MultiFPBReader::MultiFPBReader | ( |  | ) |

inline

Definition at line 56 of file MultiFPBReader.h.

## MultiFPBReader() [2/3]

RDKit::MultiFPBReader::MultiFPBReader | ( | bool | initOnSearch | ) |

inline

Parameters

  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.

## MultiFPBReader() [3/3]

RDKit::MultiFPBReader::MultiFPBReader | ( | std::vector< FPBReader * > & | readers,
|  | bool | takeOwnership = false,
|  | bool | initOnSearch = false )

Parameters

  readers | the set of FPBReader objects to use.
  takeOwnership | if true, we own the memory for the FPBReaders
  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.

## ~MultiFPBReader()

RDKit::MultiFPBReader::~MultiFPBReader | ( |  | ) |

inline

Definition at line 77 of file MultiFPBReader.h.

## Member Function Documentation

## addReader()

unsigned int RDKit::MultiFPBReader::addReader | ( | FPBReader * | rdr | ) |

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.

Parameters

  rdr | the reader to add. If we have already been initialized, the reader's `init()` method will be called

Returns
  a count of the current number of readers

Definition at line 121 of file MultiFPBReader.h.

References RDKit::FPBReader::init(), and PRECONDITION.

## getContainingNeighbors() [1/3]

std::vector< std::pair< unsigned int, unsigned int > > RDKit::MultiFPBReader::getContainingNeighbors | ( | boost::shared_array< std::uint8_t > | bv,
|  | int | numThreads = 1 ) const

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.

References getContainingNeighbors().

## getContainingNeighbors() [2/3]

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.

## getContainingNeighbors() [3/3]

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)

Referenced by getContainingNeighbors().

## getReader()

FPBReader * RDKit::MultiFPBReader::getReader | ( | unsigned int | which | ) |

returns a particular reader

Parameters

  which | the reader to return

## getTanimotoNeighbors() [1/3]

std::vector< ResultTuple > RDKit::MultiFPBReader::getTanimotoNeighbors | ( | boost::shared_array< std::uint8_t > | bv,
|  | double | threshold = 0.7,
|  | int | numThreads = 1 ) const

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.

References getTanimotoNeighbors().

## getTanimotoNeighbors() [2/3]

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.

## getTanimotoNeighbors() [3/3]

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

Parameters

  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 getTanimotoNeighbors().

## getTverskyNeighbors() [1/3]

std::vector< ResultTuple > RDKit::MultiFPBReader::getTverskyNeighbors | ( | boost::shared_array< std::uint8_t > | bv,
|  | double | ca,
|  | double | cb,
|  | double | threshold = 0.7,
|  | int | numThreads = 1 ) const

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.

References getTverskyNeighbors().

## getTverskyNeighbors() [2/3]

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.

## getTverskyNeighbors() [3/3]

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

Parameters

  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 getTverskyNeighbors().

## init()

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

## length()

unsigned int RDKit::MultiFPBReader::length | ( |  | ) | const

inline

returns the number of readers

Definition at line 96 of file MultiFPBReader.h.

## nBits()

unsigned int RDKit::MultiFPBReader::nBits | ( |  | ) | const

returns the number of bits in our fingerprints (all readers are expected to have the same length)

The documentation for this class was generated from the following file:

- MultiFPBReader.h