11 #ifndef RD_MULTIFPBREADER_H_APR2016
12 #define RD_MULTIFPBREADER_H_APR2016
24 #include <boost/tuple/tuple.hpp>
25 #include <boost/foreach.hpp>
56 typedef boost::tuple<double, unsigned int, unsigned int>
ResultTuple;
67 df_initOnSearch(initOnSearch),
68 df_takeOwnership(false){};
76 MultiFPBReader(std::vector<FPBReader *> &readers,
bool takeOwnership =
false,
77 bool initOnSearch =
false);
81 if (df_takeOwnership) {
82 BOOST_FOREACH (
FPBReader *rdr, d_readers) {
delete rdr; };
96 unsigned int length()
const {
return d_readers.size(); };
123 d_readers.push_back(rdr);
124 if (df_init) rdr->
init();
125 return d_readers.size();
141 double threshold = 0.7,
142 int numThreads = 1)
const;
145 boost::shared_array<std::uint8_t> bv,
double threshold = 0.7,
146 int numThreads = 1)
const {
147 return getTanimotoNeighbors(bv.get(), threshold, numThreads);
151 double threshold = 0.7,
152 int numThreads = 1)
const;
169 double ca,
double cb,
170 double threshold = 0.7,
171 int numThreads = 1)
const;
174 boost::shared_array<std::uint8_t> bv,
double ca,
double cb,
175 double threshold = 0.7,
int numThreads = 1)
const {
176 return getTverskyNeighbors(bv.get(), ca, cb, threshold, numThreads);
180 double ca,
double cb,
181 double threshold = 0.7,
182 int numThreads = 1)
const;
189 const std::uint8_t *bv,
int numThreads = 1)
const;
192 boost::shared_array<std::uint8_t> bv,
int numThreads = 1)
const {
193 return getContainingNeighbors(bv.get(), numThreads);
200 std::vector<FPBReader *> d_readers;
201 bool df_init{
false}, df_initOnSearch{
false}, df_takeOwnership{
false};
207 MultiFPBReader(
const MultiFPBReader &);
208 MultiFPBReader &operator=(
const MultiFPBReader &);
contains a simple class for reading and searching FPB files
#define PRECONDITION(expr, mess)
a class for bit vectors that are densely occupied
class for reading and searching FPB files
void init()
Read the data from the file and initialize internal data structures.
class for reading and searching multiple FPB files
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 o...
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 o...
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 o...
unsigned int length() const
returns the number of readers
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 o...
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(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 o...
unsigned int addReader(FPBReader *rdr)
adds a new FPBReader to our list
FPBReader * getReader(unsigned int which)
returns a particular reader
void init()
Read the data from the file and initialize internal data structures.
MultiFPBReader(std::vector< FPBReader * > &readers, bool takeOwnership=false, bool initOnSearch=false)
MultiFPBReader(bool initOnSearch)
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(const ExplicitBitVect &ebv, int numThreads=1) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
unsigned int nBits() const
boost::tuple< double, unsigned int, unsigned int > ResultTuple
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
#define RDKIT_DATASTRUCTS_EXPORT