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 =
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) {
155 ostr <<
"GenericBond";
158 ostr <<
"RemoveAttachment";
161 ostr <<
"Initialize";
172 ostr <<
"NetworkEdge( " <<
e.beginIdx <<
"->" <<
e.endIdx
173 <<
", type:" <<
e.type <<
" )";
184#ifdef RDK_USE_BOOST_SERIALIZATION
186namespace serialization {
188struct version<
RDKit::ScaffoldNetwork::ScaffoldNetwork> {
189 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