11 #ifndef RD_SCAFFOLDNETWORK_H
12 #define RD_SCAFFOLDNETWORK_H
21 #ifdef RDK_USE_BOOST_SERIALIZATION
24 #include <boost/archive/text_oarchive.hpp>
25 #include <boost/archive/text_iarchive.hpp>
26 #include <boost/serialization/vector.hpp>
27 #include <boost/serialization/shared_ptr.hpp>
28 #include <boost/serialization/version.hpp>
34 class ChemicalReaction;
36 namespace ScaffoldNetwork {
39 bool includeGenericScaffolds =
41 bool includeGenericBondScaffolds =
43 bool includeScaffoldsWithoutAttachments =
45 bool includeScaffoldsWithAttachments =
47 bool keepOnlyFirstFragment =
49 bool pruneBeforeFragmenting =
51 bool flattenIsotopes =
true;
52 bool flattenChirality =
54 bool flattenKeepLargest =
56 bool collectMolCounts =
true;
59 std::vector<std::shared_ptr<ChemicalReaction>>
81 : beginIdx(bi), endIdx(ei), type(typ) {}
88 #ifdef RDK_USE_BOOST_SERIALIZATION
90 friend class boost::serialization::access;
91 template <
class Archive>
92 void serialize(Archive &ar,
const unsigned int version) {
103 std::vector<unsigned>
105 std::vector<unsigned>
109 #ifdef RDK_USE_BOOST_SERIALIZATION
111 std::stringstream iss(pkl);
112 boost::archive::text_iarchive ia(iss);
117 friend class boost::serialization::access;
118 template <
class Archive>
119 void serialize(Archive &ar,
const unsigned int version) {
132 template <
typename T>
137 template <
typename T>
155 ostr <<
"GenericBond";
158 ostr <<
"RemoveAttachment";
161 ostr <<
"Initialize";
173 <<
", type:" << e.
type <<
" )";
184 #ifdef RDK_USE_BOOST_SERIALIZATION
186 namespace serialization {
188 struct version<
RDKit::ScaffoldNetwork::ScaffoldNetwork> {
189 BOOST_STATIC_CONSTANT(
int, value = 1);
#define RDUNUSED_PARAM(x)
#define RDKIT_SCAFFOLDNETWORK_EXPORT
ScaffoldNetwork createScaffoldNetwork(const T &mols, const ScaffoldNetworkParams ¶ms)
create a new ScaffoldNetwork for a set of molecules
void updateScaffoldNetwork(const T &mols, ScaffoldNetwork &network, const ScaffoldNetworkParams ¶ms)
update an existing ScaffoldNetwork using a set of molecules
std::ostream & operator<<(std::ostream &ostr, const RDKit::ScaffoldNetwork::NetworkEdge &e)
allows edges to output nicely as strings
@ Initialize
molecule -> flattened molecule
@ Fragment
molecule -> fragment
@ Generic
molecule -> generic molecule (all atoms are dummies)
@ RemoveAttachment
molecule -> molecule with no attachment points
@ GenericBond
molecule -> generic bond molecule (all bonds single)
RDKIT_SCAFFOLDNETWORK_EXPORT ScaffoldNetworkParams getBRICSNetworkParams()
bool operator==(const RDKit::ScaffoldNetwork::NetworkEdge &o) const
NetworkEdge(size_t bi, size_t ei, EdgeType typ)
bool operator!=(const RDKit::ScaffoldNetwork::NetworkEdge &o) const
std::vector< std::shared_ptr< ChemicalReaction > > bondBreakersRxns
ScaffoldNetworkParams(const std::vector< std::string > &bondBreakersSmarts)
std::vector< NetworkEdge > edges
edges in the network
std::vector< unsigned > molCounts
number of molecules each scaffold was found in
std::vector< std::string > nodes
SMILES for the scaffolds.
std::vector< unsigned > counts
number of times each scaffold was encountered