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>
34class ChemicalReaction;
36namespace ScaffoldNetwork {
39 bool includeGenericScaffolds =
41 bool includeGenericBondScaffolds =
43 bool includeScaffoldsWithoutAttachments =
45 bool includeScaffoldsWithAttachments =
49 bool keepOnlyFirstFragment =
51 bool pruneBeforeFragmenting =
53 bool flattenIsotopes =
true;
54 bool flattenChirality =
56 bool flattenKeepLargest =
58 bool collectMolCounts =
true;
61 std::vector<std::shared_ptr<ChemicalReaction>>
83 : beginIdx(bi), endIdx(ei), type(typ) {}
90#ifdef RDK_USE_BOOST_SERIALIZATION
92 friend class boost::serialization::access;
93 template <
class Archive>
94 void serialize(Archive &ar,
const unsigned int version) {
105 std::vector<unsigned>
107 std::vector<unsigned>
111#ifdef RDK_USE_BOOST_SERIALIZATION
113 std::stringstream iss(pkl);
114 boost::archive::text_iarchive ia(iss);
119 friend class boost::serialization::access;
120 template <
class Archive>
121 void serialize(Archive &ar,
const unsigned int version) {
157 ostr <<
"GenericBond";
160 ostr <<
"RemoveAttachment";
163 ostr <<
"Initialize";
174 ostr <<
"NetworkEdge( " <<
e.beginIdx <<
"->" <<
e.endIdx
175 <<
", type:" <<
e.type <<
" )";
186#ifdef RDK_USE_BOOST_SERIALIZATION
188namespace serialization {
190struct version<
RDKit::ScaffoldNetwork::ScaffoldNetwork> {
191 BOOST_STATIC_CONSTANT(
int, value = 1);
RDKIT_GRAPHMOL_EXPORT std::ostream & operator<<(std::ostream &target, const RDKit::Atom &at)
allows Atom objects to be dumped to streams
#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
@ 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 rdvalue_is(const RDValue_cast_t)
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