 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
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;
58 : df_init(false), df_initOnSearch(false), df_takeOwnership(false){};
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, df_initOnSearch, df_takeOwnership;
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
unsigned int addReader(FPBReader *rdr)
adds a new FPBReader to our list
unsigned int length() const
returns the number of readers
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...
class for reading and searching multiple FPB files
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
boost::tuple< double, unsigned int, unsigned int > ResultTuple
unsigned int nBits() const
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...
void init()
Read the data from the file and initialize internal data structures.
void init()
Read the data from the file and initialize internal data structures.
FPBReader * getReader(unsigned int which)
returns a particular reader
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...
#define RDKIT_DATASTRUCTS_EXPORT
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< 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...
contains a simple class for reading and searching FPB files
MultiFPBReader(std::vector< FPBReader * > &readers, bool takeOwnership=false, bool initOnSearch=false)
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...
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...
MultiFPBReader(bool initOnSearch)
#define PRECONDITION(expr, mess)
class for reading and searching FPB files
a class for bit vectors that are densely occupied