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
66// Primarily for debugging, these write out the corresponding bonds/atoms
67// in Python list format, for ease of cut/paste into a highlighted image
68// creation.
70 std::ostream &os);
71
73 std::ostream &os);
74
75// This prints out the scores in the order they are used in resultCompare.
77 std::ostream &os);
78
79// Calculate the Johnson similarity between the two molecules using the given
80// bondMatches. It's the fraction of the 2 molecules that are in common,
81// somewhat akin to the tanimoto - the square of the number of atoms plus
82// number of bonds in the MCES divided by the product of the sums of the number
83// of atoms and bonds in the 2 molecules.
84// It has nothing to do with lying UK politicians.
86 const std::vector<std::pair<int, int>> &bondMatches,
87 const std::vector<std::pair<int, int>> &atomMatches,
88 const RDKit::ROMol &mol1, const RDKit::ROMol &mol2);
89
90} // namespace details
91
92} // namespace RascalMCES
93} // namespace RDKit
94#endif // RDKIT_RASCAL_MCES_H
#define RDKIT_RASCALMCES_EXPORT
Definition export.h:425
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 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)
RDKIT_RASCALMCES_EXPORT void cleanSmarts(std::string &smarts)
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