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>>
64 {
"[!#0;R:1]-!@[!#0:2]>>[*:1]-[#0].[#0]-[*:2]"}} {};
80 NetworkEdge() : beginIdx(0), endIdx(0), type(EdgeType::Initialize){};
82 : beginIdx(bi), endIdx(ei), type(typ){};
89 #ifdef RDK_USE_BOOST_SERIALIZATION
91 friend class boost::serialization::access;
92 template <
class Archive>
93 void serialize(Archive &ar,
const unsigned int version) {
104 std::vector<unsigned>
106 std::vector<unsigned>
110 #ifdef RDK_USE_BOOST_SERIALIZATION
112 std::stringstream iss(pkl);
113 boost::archive::text_iarchive ia(iss);
118 friend class boost::serialization::access;
119 template <
class Archive>
120 void serialize(Archive &ar,
const unsigned int version) {
133 template <
typename T>
138 template <
typename T>
147 const RDKit::ScaffoldNetwork::EdgeType &e) {
156 ostr <<
"GenericBond";
159 ostr <<
"RemoveAttachment";
161 case RDKit::ScaffoldNetwork::EdgeType::Initialize:
162 ostr <<
"Initialize";
174 <<
", type:" << e.
type <<
" )";
185 #ifdef RDK_USE_BOOST_SERIALIZATION
187 namespace serialization {
189 struct version<
RDKit::ScaffoldNetwork::ScaffoldNetwork> {
190 BOOST_STATIC_CONSTANT(
int, value = 1);
#define RDUNUSED_PARAM(x)
Fragment
molecule -> fragment
Generic
molecule -> generic molecule (all atoms are dummies)
GenericBond
molecule -> generic bond molecule (all bonds single)
RemoveAttachment
molecule -> molecule with no attachment points
#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
RDKIT_SCAFFOLDNETWORK_EXPORT ScaffoldNetworkParams getBRICSNetworkParams()
std::ostream & operator<<(std::ostream &oss, const TextAlignType &tat)
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