18 #ifndef __RD_VALIDATE_H__
19 #define __RD_VALIDATE_H__
33 namespace MolStandardize {
42 const char *
what() const noexcept
override {
return d_msg.c_str(); };
56 virtual std::vector<ValidationErrorInfo>
validate(
57 const ROMol &mol,
bool reportAllFailures)
const = 0;
71 const ROMol &mol,
bool reportAllFailures)
const override;
83 virtual void run(
const ROMol &mol,
bool reportAllFailures,
84 std::vector<ValidationErrorInfo> &errors)
const = 0;
85 virtual boost::shared_ptr<MolVSValidations>
copy()
const = 0;
93 void run(
const ROMol &mol,
bool reportAllFailures,
94 std::vector<ValidationErrorInfo> &errors)
const override;
97 virtual boost::shared_ptr<MolVSValidations>
copy()
const override {
98 return boost::make_shared<NoAtomValidation>(*
this);
107 std::vector<ValidationErrorInfo> &errors)
const override;
110 virtual boost::shared_ptr<MolVSValidations>
copy()
const override {
111 return boost::make_shared<FragmentValidation>(*
this);
120 std::vector<ValidationErrorInfo> &errors)
const override;
123 virtual boost::shared_ptr<MolVSValidations>
copy()
const override {
124 return boost::make_shared<NeutralValidation>(*
this);
133 std::vector<ValidationErrorInfo> &errors)
const override;
136 virtual boost::shared_ptr<MolVSValidations>
copy()
const override {
137 return boost::make_shared<IsotopeValidation>(*
this);
150 const std::vector<boost::shared_ptr<MolVSValidations>> validations);
155 const ROMol &mol,
bool reportAllFailures)
const override;
158 std::vector<boost::shared_ptr<MolVSValidations>> d_validations;
168 : d_allowedList(atoms){};
170 const ROMol &mol,
bool reportAllFailures)
const override;
173 std::vector<std::shared_ptr<Atom>> d_allowedList;
183 : d_disallowedList(atoms){};
185 const ROMol &mol,
bool reportAllFailures)
const override;
188 std::vector<std::shared_ptr<Atom>> d_disallowedList;
193 const std::string &smiles);
Defines the Atom class and associated typedefs.
pulls in the core RDKit functionality
#define BOOST_LOG(__arg__)
RDKIT_RDGENERAL_EXPORT RDLogger rdInfoLog
Defines the primary molecule class ROMol as well as associated typedefs.
AllowedAtomsValidation(const std::vector< std::shared_ptr< Atom >> &atoms)
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
DisallowedAtomsValidation(const std::vector< std::shared_ptr< Atom >> &atoms)
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
The FragmentValidation class logs if certain fragments are present.
virtual boost::shared_ptr< MolVSValidations > copy() const override
void run(const ROMol &mol, bool reportAllFailures, std::vector< ValidationErrorInfo > &errors) const override
The IsotopeValidation class logs if molecule contains isotopes.
virtual boost::shared_ptr< MolVSValidations > copy() const override
void run(const ROMol &mol, bool reportAllFailures, std::vector< ValidationErrorInfo > &errors) const override
The MolVSValidation class can be used to perform all MolVSValidions.
MolVSValidation(const std::vector< boost::shared_ptr< MolVSValidations >> validations)
overloaded constructor to take in a user-defined list of MolVSValidations
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
MolVSValidation(const MolVSValidation &other)
The MolVSValidations class includes most of the same validations as.
virtual void run(const ROMol &mol, bool reportAllFailures, std::vector< ValidationErrorInfo > &errors) const =0
virtual boost::shared_ptr< MolVSValidations > copy() const =0
The NeutralValidation class logs if not an overall neutral system.
void run(const ROMol &mol, bool reportAllFailures, std::vector< ValidationErrorInfo > &errors) const override
virtual boost::shared_ptr< MolVSValidations > copy() const override
The NoAtomValidation class throws an error if no atoms are present in the.
virtual boost::shared_ptr< MolVSValidations > copy() const override
void run(const ROMol &mol, bool reportAllFailures, std::vector< ValidationErrorInfo > &errors) const override
The RDKitValidation class throws an error when there are no atoms in the.
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
The ValidationErrorInfo class is used to store the information returned by a.
~ValidationErrorInfo() noexcept
const char * what() const noexcept override
ValidationErrorInfo(const std::string &msg)
The ValidationMethod class is the abstract base class upon which all the.
virtual ~ValidationMethod()=default
virtual std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const =0
ValidationMethod()=default
#define RDKIT_MOLSTANDARDIZE_EXPORT
RDKIT_MOLSTANDARDIZE_EXPORT std::vector< ValidationErrorInfo > validateSmiles(const std::string &smiles)
A convenience function for quickly validating a single SMILES string.