35namespace MolStandardize {
48 virtual std::vector<ValidationErrorInfo>
validate(
49 const ROMol &mol,
bool reportAllFailures)
const = 0;
50 virtual std::shared_ptr<ValidationMethod>
copy()
const = 0;
59 const std::vector<std::shared_ptr<ValidationMethod>> &validations)
60 : validations(validations) {};
63 const ROMol &mol,
bool reportAllFailures)
const override;
65 std::shared_ptr<ValidationMethod>
copy()
const override {
66 return std::make_shared<CompositeValidation>(*
this);
70 std::vector<std::shared_ptr<ValidationMethod>> validations;
84 : allowEmptyMolecules(allowEmptyMolecules) {};
87 const ROMol &mol,
bool reportAllFailures)
const override;
89 std::shared_ptr<ValidationMethod>
copy()
const override {
90 return std::make_shared<RDKitValidation>(*
this);
105 const ROMol &mol,
bool reportAllFailures)
const override;
107 std::shared_ptr<ValidationMethod>
copy()
const override {
108 return std::make_shared<NoAtomValidation>(*
this);
116 const ROMol &mol,
bool reportAllFailures)
const override;
118 std::shared_ptr<ValidationMethod>
copy()
const override {
119 return std::make_shared<FragmentValidation>(*
this);
127 const ROMol &mol,
bool reportAllFailures)
const override;
129 std::shared_ptr<ValidationMethod>
copy()
const override {
130 return std::make_shared<NeutralValidation>(*
this);
146 const ROMol &mol,
bool reportAllFailures)
const override;
148 std::shared_ptr<ValidationMethod>
copy()
const override {
149 return std::make_shared<IsotopeValidation>(*
this);
166 const std::vector<std::shared_ptr<ValidationMethod>> &validations);
168 std::shared_ptr<ValidationMethod>
copy()
const override {
169 return std::make_shared<MolVSValidation>(*
this);
179 : d_allowedList(std::move(atoms)) {}
181 const ROMol &mol,
bool reportAllFailures)
const override;
183 std::shared_ptr<ValidationMethod>
copy()
const override {
184 return std::make_shared<AllowedAtomsValidation>(*
this);
188 std::vector<std::shared_ptr<Atom>> d_allowedList;
197 : d_disallowedList(std::move(atoms)) {}
199 const ROMol &mol,
bool reportAllFailures)
const override;
201 std::shared_ptr<ValidationMethod>
copy()
const override {
202 return std::make_shared<DisallowedAtomsValidation>(*
this);
206 std::vector<std::shared_ptr<Atom>> d_disallowedList;
216 const ROMol &mol,
bool reportAllFailures)
const override;
218 std::shared_ptr<ValidationMethod>
copy()
const override {
219 return std::make_shared<DisallowedRadicalValidation>(*
this);
228 bool allowAromaticBondType =
false,
229 bool allowDativeBondType =
false,
230 bool allowQueries =
false,
bool allowDummies =
false,
231 bool allowAtomAliases =
false)
232 : allowEnhancedStereo(allowEnhancedStereo),
233 allowAromaticBondType(allowAromaticBondType),
234 allowDativeBondType(allowDativeBondType),
235 allowQueries(allowQueries),
236 allowDummies(allowDummies),
237 allowAtomAliases(allowAtomAliases) {};
239 const ROMol &mol,
bool reportAllFailures)
const override;
240 std::shared_ptr<ValidationMethod>
copy()
const override {
241 return std::make_shared<FeaturesValidation>(*
this);
259 const ROMol &mol,
bool reportAllFailures)
const override;
260 std::shared_ptr<ValidationMethod>
copy()
const override {
261 return std::make_shared<Is2DValidation>(*
this);
273 bool allowLongBondsInRings =
true,
274 bool allowAtomBondClashExemption =
true,
275 double minMedianBondLength = 1e-3)
276 : clashLimit(clashLimit),
277 bondLengthLimit(bondLengthLimit),
278 allowLongBondsInRings(allowLongBondsInRings),
279 allowAtomBondClashExemption(allowAtomBondClashExemption),
280 minMedianBondLength(minMedianBondLength) {};
282 const ROMol &mol,
bool reportAllFailures)
const override;
283 std::shared_ptr<ValidationMethod>
copy()
const override {
284 return std::make_shared<Layout2DValidation>(*
this);
305 const ROMol &mol,
bool reportAllFailures)
const override;
306 std::shared_ptr<ValidationMethod>
copy()
const override {
307 return std::make_shared<StereoValidation>(*
this);
313 const std::string &smiles);
Defines the Atom class and associated typedefs.
pulls in the core RDKit functionality
Defines the primary molecule class ROMol as well as associated typedefs.
AllowedAtomsValidation(std::vector< std::shared_ptr< Atom > > atoms)
std::shared_ptr< ValidationMethod > copy() const override
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
The CompositeValidation class provides a simple way to apply a collection of.
std::shared_ptr< ValidationMethod > copy() const override
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
CompositeValidation(const std::vector< std::shared_ptr< ValidationMethod > > &validations)
DisallowedAtomsValidation(std::vector< std::shared_ptr< Atom > > atoms)
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
std::shared_ptr< ValidationMethod > copy() const override
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
std::shared_ptr< ValidationMethod > copy() const override
FeaturesValidation(bool allowEnhancedStereo=false, bool allowAromaticBondType=false, bool allowDativeBondType=false, bool allowQueries=false, bool allowDummies=false, bool allowAtomAliases=false)
std::shared_ptr< ValidationMethod > copy() const override
bool allowAromaticBondType
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
The FragmentValidation class logs if certain fragments are present.
std::shared_ptr< ValidationMethod > copy() const override
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
std::shared_ptr< ValidationMethod > copy() const override
Is2DValidation(double threshold=1.e-3)
The IsotopeValidation class logs if molecule contains isotopes.
std::shared_ptr< ValidationMethod > copy() const override
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
IsotopeValidation(bool strict=false)
Layout2DValidation(double clashLimit=0.15, double bondLengthLimit=25., bool allowLongBondsInRings=true, bool allowAtomBondClashExemption=true, double minMedianBondLength=1e-3)
bool allowAtomBondClashExemption
double minMedianBondLength
std::shared_ptr< ValidationMethod > copy() const override
bool allowLongBondsInRings
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
static double squaredMedianBondLength(const ROMol &mol, const Conformer &conf)
MolVSValidation(const std::vector< std::shared_ptr< ValidationMethod > > &validations)
overloaded constructor to take in a user-defined list of ValidationMethod
std::shared_ptr< ValidationMethod > copy() const override
The NeutralValidation class logs if not an overall neutral system.
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
std::shared_ptr< ValidationMethod > copy() const override
std::shared_ptr< ValidationMethod > copy() const override
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
RDKitValidation(bool allowEmptyMolecules=false)
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
std::shared_ptr< ValidationMethod > copy() const override
std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const override
std::shared_ptr< ValidationMethod > copy() const override
virtual std::shared_ptr< ValidationMethod > copy() const =0
virtual std::vector< ValidationErrorInfo > validate(const ROMol &mol, bool reportAllFailures) const =0
virtual ~ValidationMethod()=default
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.
std::string ValidationErrorInfo