RDKit
Open-source cheminformatics and machine learning.
RGroupMatch.h
Go to the documentation of this file.
1//
2// Copyright (C) 2017 Novartis Institutes for BioMedical Research
3//
4// @@ All Rights Reserved @@
5// This file is part of the RDKit.
6// The contents are covered by the terms of the BSD license
7// which is included in the file license.txt, found at the root
8// of the RDKit source tree.
9//
10#ifndef RGROUP_MATCH_DATA
11#define RGROUP_MATCH_DATA
12#include "RGroupData.h"
13
14namespace RDKit {
15typedef boost::shared_ptr<RGroupData> RData;
16typedef std::map<int, RData> R_DECOMP;
17
18//! RGroupMatch is the decomposition for a single molecule
20 size_t core_idx; // index of the matching core
22 R_DECOMP rgroups; // rlabel->RGroupData mapping
23 ROMOL_SPTR matchedCore; // Core with dummy or query atoms and bonds matched
24
25 RGroupMatch(size_t core_index, size_t numberMissingUserRGroups,
26 R_DECOMP input_rgroups, ROMOL_SPTR matchedCore)
27 : core_idx(core_index),
29 rgroups(std::move(input_rgroups)),
30 matchedCore(std::move(matchedCore)) {}
31
32 std::string toString() const {
33 auto rGroupsString = std::accumulate(
34 rgroups.cbegin(), rgroups.cend(), std::string(),
35 [](std::string s, const std::pair<int, RData>& rgroup) {
36 return std::move(s) + "\n\t(" + std::to_string(rgroup.first) + ':' +
37 rgroup.second->toString() + ')';
38 });
39 std::stringstream ss;
40 ss << "Match coreIdx " << core_idx << " missing count "
41 << numberMissingUserRGroups << " " << rGroupsString;
42 return ss.str();
43 }
44};
45
46} // namespace RDKit
47#endif
Std stuff.
Definition: Abbreviations.h:18
boost::shared_ptr< RGroupData > RData
Definition: RGroupMatch.h:15
std::map< int, RData > R_DECOMP
Definition: RGroupMatch.h:16
boost::shared_ptr< ROMol > ROMOL_SPTR
RGroupMatch is the decomposition for a single molecule.
Definition: RGroupMatch.h:19
RGroupMatch(size_t core_index, size_t numberMissingUserRGroups, R_DECOMP input_rgroups, ROMOL_SPTR matchedCore)
Definition: RGroupMatch.h:25
ROMOL_SPTR matchedCore
Definition: RGroupMatch.h:23
size_t numberMissingUserRGroups
Definition: RGroupMatch.h:21
std::string toString() const
Definition: RGroupMatch.h:32