RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RascalDetails.h
Go to the documentation of this file.
1//
2// Copyright (C) David Cosgrove 2023
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
11#include <RDGeneral/export.h>
12#ifndef RDKIT_RASCAL_DETAILS_H
13#define RDKIT_RASCAL_DETAILS_H
14
15#include <map>
16
19namespace RDKit {
20class ROMol;
21
22namespace RascalMCES {
23
24struct RascalClusterOptions;
25
26namespace details {
27
28struct ClusNode {
29 std::shared_ptr<RascalResult> d_res;
30 double d_sim;
31 unsigned int d_mol1Num, d_mol2Num;
32};
33
35 const RDKit::ROMol &mol1, const RDKit::ROMol &mol2,
36 std::map<int, std::vector<std::pair<int, int>>> &degSeqs1,
37 std::map<int, std::vector<std::pair<int, int>>> &degSeqs2);
38
40 const ROMol &mol1, const ROMol &mol2,
41 const std::map<int, std::vector<std::pair<int, int>>> &degSeqs1,
42 const std::map<int, std::vector<std::pair<int, int>>> &degSeqs2,
43 const std::vector<unsigned int> &bondLabels1,
44 const std::vector<unsigned int> &bondLabels2);
45
47 const RDKit::ROMol &mol1, const RDKit::ROMol &mol2,
48 const RascalOptions &opts, std::vector<unsigned int> &bondLabels1,
49 std::vector<unsigned int> &bondLabels2);
50
51std::vector<std::vector<ClusNode>> buildProximityGraph(
52 const std::vector<std::shared_ptr<ROMol>> &mols,
54
56 const RascalResult &res2);
57
59 const std::vector<unsigned int> &clique,
60 const std::vector<std::pair<int, int>> &vtxPairs, bool swapped,
61 std::vector<std::pair<int, int>> &bondMatches);
62
63// do some simple cleaning of the SMARTS, to make it more user-friendly.
64RDKIT_RASCALMCES_EXPORT void cleanSmarts(std::string &smarts,
65 const std::string &equivalentAtoms);
66
67// Primarily for debugging, these write out the corresponding bonds/atoms
68// in Python list format, for ease of cut/paste into a highlighted image
69// creation.
71 std::ostream &os);
72
74 std::ostream &os);
75
76// This prints out the scores in the order they are used in resultCompare.
78 std::ostream &os);
79
80// Calculate the Johnson similarity between the two molecules using the given
81// bondMatches. It's the fraction of the 2 molecules that are in common,
82// somewhat akin to the tanimoto - the square of the number of atoms plus
83// number of bonds in the MCES divided by the product of the sums of the number
84// of atoms and bonds in the 2 molecules.
85// It has nothing to do with lying UK politicians.
87 const std::vector<std::pair<int, int>> &bondMatches,
88 const std::vector<std::pair<int, int>> &atomMatches,
89 const RDKit::ROMol &mol1, const RDKit::ROMol &mol2);
90
91} // namespace details
92
93} // namespace RascalMCES
94} // namespace RDKit
95#endif // RDKIT_RASCAL_MCES_H
#define RDKIT_RASCALMCES_EXPORT
Definition export.h:441
RDKIT_RASCALMCES_EXPORT bool resultCompare(const RascalResult &res1, const RascalResult &res2)
RDKIT_RASCALMCES_EXPORT void extractClique(const std::vector< unsigned int > &clique, const std::vector< std::pair< int, int > > &vtxPairs, bool swapped, std::vector< std::pair< int, int > > &bondMatches)
RDKIT_RASCALMCES_EXPORT void getBondLabels(const RDKit::ROMol &mol1, const RDKit::ROMol &mol2, const RascalOptions &opts, std::vector< unsigned int > &bondLabels1, std::vector< unsigned int > &bondLabels2)
RDKIT_RASCALMCES_EXPORT double johnsonSimilarity(const std::vector< std::pair< int, int > > &bondMatches, const std::vector< std::pair< int, int > > &atomMatches, const RDKit::ROMol &mol1, const RDKit::ROMol &mol2)
RDKIT_RASCALMCES_EXPORT void printScores(const RascalResult &res, std::ostream &os)
RDKIT_RASCALMCES_EXPORT void printAtomMatches(const RascalResult &res, std::ostream &os)
RDKIT_RASCALMCES_EXPORT double tier1Sim(const RDKit::ROMol &mol1, const RDKit::ROMol &mol2, std::map< int, std::vector< std::pair< int, int > > > &degSeqs1, std::map< int, std::vector< std::pair< int, int > > > &degSeqs2)
RDKIT_RASCALMCES_EXPORT void cleanSmarts(std::string &smarts, const std::string &equivalentAtoms)
RDKIT_RASCALMCES_EXPORT double tier2Sim(const ROMol &mol1, const ROMol &mol2, const std::map< int, std::vector< std::pair< int, int > > > &degSeqs1, const std::map< int, std::vector< std::pair< int, int > > > &degSeqs2, const std::vector< unsigned int > &bondLabels1, const std::vector< unsigned int > &bondLabels2)
std::vector< std::vector< ClusNode > > buildProximityGraph(const std::vector< std::shared_ptr< ROMol > > &mols, const RascalClusterOptions &clusOpts)
RDKIT_RASCALMCES_EXPORT void printBondMatches(const RascalResult &res, std::ostream &os)
Std stuff.
bool rdvalue_is(const RDValue_cast_t)
std::shared_ptr< RascalResult > d_res