RDKit
Open-source cheminformatics and machine learning.
Toggle main menu visibility
Loading...
Searching...
No Matches
SmartsWrite.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2004-2024 Greg Landrum and other RDKit contributors
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
#include <
RDGeneral/export.h
>
11
#ifndef RD_SMARTSWRITE_H_012020
12
#define RD_SMARTSWRITE_H_012020
13
14
#include <string>
15
#include <vector>
16
#include "
SmilesWrite.h
"
17
18
namespace
RDKit
{
19
class
Atom
;
20
class
Bond
;
21
class
ROMol
;
22
23
namespace
SmartsWrite
{
24
//! returns the SMARTS for an Atom
25
RDKIT_SMILESPARSE_EXPORT
std::string
GetAtomSmarts
(
26
const
Atom
*qatom,
const
SmilesWriteParams
¶ms);
27
28
//! returns the SMARTS for an Atom
29
inline
std::string
GetAtomSmarts
(
const
Atom
*qatom) {
30
SmilesWriteParams
params;
31
return
GetAtomSmarts
(qatom, params);
32
};
33
34
//! returns the SMARTS for a Bond
35
RDKIT_SMILESPARSE_EXPORT
std::string
GetBondSmarts
(
36
const
Bond
*qbond,
const
SmilesWriteParams
¶ms,
int
atomToLeftIdx = -1);
37
//! returns the SMARTS for a Bond
38
inline
std::string
GetBondSmarts
(
const
Bond
*qbond,
int
atomToLeftIdx = -1) {
39
SmilesWriteParams
params;
40
params.
doIsomericSmiles
=
false
;
41
return
GetBondSmarts
(qbond, params, atomToLeftIdx);
42
};
43
}
// namespace SmartsWrite
44
RDKIT_SMILESPARSE_EXPORT
std::string
MolToSmarts
(
45
const
ROMol
&mol,
const
SmilesWriteParams
¶ms);
46
47
//! returns the SMARTS for a molecule
48
inline
std::string
MolToSmarts
(
const
ROMol
&mol,
bool
doIsomericSmarts =
true
,
49
int
rootedAtAtom = -1) {
50
SmilesWriteParams
params;
51
params.
doIsomericSmiles
= doIsomericSmarts;
52
params.
rootedAtAtom
= rootedAtAtom;
53
return
MolToSmarts
(mol, params);
54
};
55
56
RDKIT_SMILESPARSE_EXPORT
std::string
MolFragmentToSmarts
(
57
const
ROMol
&mol,
const
SmilesWriteParams
¶ms,
58
const
std::vector<int> &atomsToUse,
59
const
std::vector<int> *bondsToUse =
nullptr
);
60
61
//! returns the CXSMARTS for a molecule
62
RDKIT_SMILESPARSE_EXPORT
std::string
MolToCXSmarts
(
63
const
ROMol
&mol,
const
SmilesWriteParams
¶ms);
64
65
RDKIT_SMILESPARSE_EXPORT
std::string
MolFragmentToCXSmarts
(
66
const
ROMol
&mol,
const
SmilesWriteParams
¶ms,
67
const
std::vector<int> &atomsToUse,
68
const
std::vector<int> *bondsToUse =
nullptr
);
69
70
inline
std::string
MolFragmentToSmarts
(
71
const
ROMol
&mol,
const
std::vector<int> &atomsToUse,
72
const
std::vector<int> *bondsToUse =
nullptr
,
73
bool
doIsomericSmarts =
true
) {
74
SmilesWriteParams
params;
75
params.
doIsomericSmiles
= doIsomericSmarts;
76
return
MolFragmentToSmarts
(mol, params, atomsToUse, bondsToUse);
77
}
78
79
//! returns the CXSMARTS for a molecule
80
inline
std::string
MolToCXSmarts
(
const
ROMol
&mol,
81
bool
doIsomericSmarts =
true
) {
82
SmilesWriteParams
params;
83
params.
doIsomericSmiles
= doIsomericSmarts;
84
return
MolToCXSmarts
(mol, params);
85
}
86
87
inline
std::string
MolFragmentToCXSmarts
(
88
const
ROMol
&mol,
const
std::vector<int> &atomsToUse,
89
const
std::vector<int> *bondsToUse =
nullptr
,
90
bool
doIsomericSmarts =
true
) {
91
SmilesWriteParams
params;
92
params.
doIsomericSmiles
= doIsomericSmarts;
93
return
MolFragmentToCXSmarts
(mol, params, atomsToUse, bondsToUse);
94
}
95
};
// namespace RDKit
96
97
#endif
SmilesWrite.h
RDKit::Atom
The class for representing atoms.
Definition
Atom.h:75
RDKit::Bond
class for representing a bond
Definition
Bond.h:48
RDKit::ROMol
Definition
ROMol.h:344
export.h
RDKIT_SMILESPARSE_EXPORT
#define RDKIT_SMILESPARSE_EXPORT
Definition
export.h:681
RDKit::SmartsWrite
Definition
SmartsWrite.h:23
RDKit::SmartsWrite::GetAtomSmarts
RDKIT_SMILESPARSE_EXPORT std::string GetAtomSmarts(const Atom *qatom, const SmilesWriteParams ¶ms)
returns the SMARTS for an Atom
RDKit::SmartsWrite::GetBondSmarts
RDKIT_SMILESPARSE_EXPORT std::string GetBondSmarts(const Bond *qbond, const SmilesWriteParams ¶ms, int atomToLeftIdx=-1)
returns the SMARTS for a Bond
RDKit
Std stuff.
Definition
Abbreviations.h:19
RDKit::MolFragmentToCXSmarts
RDKIT_SMILESPARSE_EXPORT std::string MolFragmentToCXSmarts(const ROMol &mol, const SmilesWriteParams ¶ms, const std::vector< int > &atomsToUse, const std::vector< int > *bondsToUse=nullptr)
RDKit::MolToCXSmarts
RDKIT_SMILESPARSE_EXPORT std::string MolToCXSmarts(const ROMol &mol, const SmilesWriteParams ¶ms)
returns the CXSMARTS for a molecule
RDKit::MolToSmarts
RDKIT_SMILESPARSE_EXPORT std::string MolToSmarts(const ROMol &mol, const SmilesWriteParams ¶ms)
RDKit::MolFragmentToSmarts
RDKIT_SMILESPARSE_EXPORT std::string MolFragmentToSmarts(const ROMol &mol, const SmilesWriteParams ¶ms, const std::vector< int > &atomsToUse, const std::vector< int > *bondsToUse=nullptr)
RDKit::SmilesWriteParams
Definition
SmilesWrite.h:30
RDKit::SmilesWriteParams::doIsomericSmiles
bool doIsomericSmiles
Definition
SmilesWrite.h:31
RDKit::SmilesWriteParams::rootedAtAtom
int rootedAtAtom
Definition
SmilesWrite.h:44
GraphMol
SmilesParse
SmartsWrite.h
Generated on
for RDKit by
1.17.0