 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
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>
33 class ChemicalReaction;
35 namespace ScaffoldNetwork {
38 bool includeGenericScaffolds =
40 bool includeGenericBondScaffolds =
42 bool includeScaffoldsWithoutAttachments =
44 bool includeScaffoldsWithAttachments =
46 bool keepOnlyFirstFragment =
48 bool pruneBeforeFragmenting =
50 bool flattenIsotopes =
true;
51 bool flattenChirality =
53 bool flattenKeepLargest =
56 std::vector<std::shared_ptr<ChemicalReaction>>
61 {
"[!#0;R:1]-!@[!#0:2]>>[*:1]-[#0].[#0]-[*:2]"}} {};
77 NetworkEdge() : beginIdx(0), endIdx(0), type(EdgeType::Initialize){};
79 : beginIdx(bi), endIdx(ei), type(typ){};
86 #ifdef RDK_USE_BOOST_SERIALIZATION
88 friend class boost::serialization::access;
89 template <
class Archive>
90 void serialize(Archive &ar,
const unsigned int version) {
101 std::vector<unsigned>
105 #ifdef RDK_USE_BOOST_SERIALIZATION
107 std::stringstream iss(pkl);
108 boost::archive::text_iarchive ia(iss);
113 friend class boost::serialization::access;
114 template <
class Archive>
115 void serialize(Archive &ar,
const unsigned int version) {
125 template <
typename T>
130 template <
typename T>
139 const RDKit::ScaffoldNetwork::EdgeType &e) {
148 ostr <<
"GenericBond";
151 ostr <<
"RemoveAttachment";
153 case RDKit::ScaffoldNetwork::EdgeType::Initialize:
154 ostr <<
"Initialize";
166 <<
", type:" << e.
type <<
" )";
ScaffoldNetworkParams(const std::vector< std::string > &bondBreakersSmarts)
std::vector< NetworkEdge > edges
edges in the network
std::vector< std::string > nodes
SMILES for the scaffolds.
#define RDUNUSED_PARAM(x)
bool operator==(const RDKit::ScaffoldNetwork::NetworkEdge &o) const
Fragment
molecule -> fragment
GenericBond
molecule -> generic bond molecule (all bonds single)
bool operator!=(const RDKit::ScaffoldNetwork::NetworkEdge &o) const
#define RDKIT_SCAFFOLDNETWORK_EXPORT
std::vector< std::shared_ptr< ChemicalReaction > > bondBreakersRxns
void updateScaffoldNetwork(const T &mols, ScaffoldNetwork &network, const ScaffoldNetworkParams ¶ms)
update an existing ScaffoldNetwork using a set of molecules
std::vector< unsigned > counts
number of times each scaffold was encountered
std::ostream & operator<<(std::ostream &ostr, const RDKit::ScaffoldNetwork::EdgeType &e)
allows nodes to output nicely as strings
NetworkEdge(size_t bi, size_t ei, EdgeType typ)
RemoveAttachment
molecule -> molecule with no attachment points
ScaffoldNetwork createScaffoldNetwork(const T &mols, const ScaffoldNetworkParams ¶ms)
create a new ScaffoldNetwork for a set of molecules
Generic
molecule -> generic molecule (all atoms are dummies)
RDKIT_SCAFFOLDNETWORK_EXPORT ScaffoldNetworkParams getBRICSNetworkParams()