10#ifndef RD_MOLSTANDARDIZE_PIPELINE_H
11#define RD_MOLSTANDARDIZE_PIPELINE_H
21namespace MolStandardize {
25 bool strictParsing{
false};
28 bool reportAllFailures{
true};
29 bool allowEmptyMolecules{
false};
30 bool allowEnhancedStereo{
false};
31 bool allowAromaticBondType{
false};
32 bool allowDativeBondType{
false};
33 double is2DZeroThreshold{1e-3};
34 double atomClashLimit{0.03};
35 double minMedianBondLength{1e-3};
36 double bondLengthLimit{100.};
37 bool allowLongBondsInRings{
true};
38 bool allowAtomBondClashExemption{
true};
42 std::string metalNof{
"[Li,Na,K,Rb,Cs,Fr]~[#7,#8,F]"};
43 std::string metalNon{};
45 std::string normalizerData{
47 "Nitro to N+(O-)=O\t[N,P,As,Sb;X3:1](=[O,S,Se,Te:2])=[O,S,Se,Te:3]>>[*+1:1]([*-1:2])=[*:3]\n"
48 "Sulfone to S(=O)(=O)\t[S+2:1]([O-:2])([O-:3])>>[S+0:1](=[O-0:2])(=[O-0:3])\n"
49 "Pyridine oxide to n+O-\t[nH0+0:1]=[OH0+0:2]>>[n+:1][O-:2]\n"
50 "Azide to N=N+=N-\t[*:1][N:2]=[N:3]#[N:4]>>[*:1][N:2]=[N+:3]=[N-:4]\n"
51 "Diazo/azo to =N+=N-\t[*:1]=[N:2]#[N:3]>>[*:1]=[N+:2]=[N-:3]\n"
56 "[SH](=O)(=O) to S(=O)O\t[c,C,N,O,F,Cl,Br,I:1][SH+0:2](=[O:3])=[O:4]>>[*:1][*:2]([*:3])=[*:4]\n"
60 "Phosphate to P(O-)=O\t[O-:1][P+;D4:2][O,S,Se,Te;-1:3]>>[O+0:1]=[P+0;D5:2][*-1:3]\n"
61 "Generalized phosphate to P(X-)=Y\t[S,Se,Te;-1:1][P+;D4:2][S,Se,Te;-1:3]>>[*+0:1]=[P+0;D5:2][*-1:3]\n"
62 "C/S+N to C/S=N+\t[C,S&!$([S+]-[O-]);X3+1:1]([NX3:2])[NX3!H0:3]>>[*+0:1]([N:2])=[N+:3]\n"
63 "P+N to P=N+\t[P;X4+1:1]([NX3:2])[NX3!H0:3]>>[*+0:1]([N:2])=[N+:3]\n"
64 "Recombine 1,3-separated charges\t[N,P,As,Sb,O,S,Se,Te;-1:1]-[A+0:2]=[N,P,As,Sb,O,S,Se,Te;+1:3]>>[*-0:1]=[*:2]-[*+0:3]\n"
65 "Recombine 1,3-separated charges\t[n,o,p,s;-1:1]:[a:2]=[N,O,P,S;+1:3]>>[*-0:1]:[*:2]-[*+0:3]\n"
66 "Recombine 1,3-separated charges\t[N,O,P,S;-1:1]-[a+0:2]:[n,o,p,s;+1:3]>>[*-0:1]=[*:2]:[*+0:3]\n"
67 "Recombine 1,5-separated charges\t[N,P,As,Sb,O,S,Se,Te;-1:1]-[A+0:2]=[A:3]-[A:4]=[N,P,As,Sb,O,S,Se,Te;+1:5]>>[*-0:1]=[*:2]-[*:3]=[*:4]-[*+0:5]\n"
68 "Recombine 1,5-separated charges\t[n,o,p,s;-1:1]:[a:2]:[a:3]:[c:4]=[N,O,P,S;+1:5]>>[*-0:1]:[*:2]:[*:3]:[c:4]-[*+0:5]\n"
69 "Recombine 1,5-separated charges\t[N,O,P,S;-1:1]-[c:2]:[a:3]:[a:4]:[n,o,p,s;+1:5]>>[*-0:1]=[c:2]:[*:3]:[*:4]:[*+0:5]\n"
73 "Normalize 1,3 conjugated cation\t[N;+0!H0:1]@-[A:2]=[N!$(*~[N,O,P,S;-1]),O;+1H0:3]>>[*+1:1]=[*:2]-[*+0:3]\n"
74 "Normalize 1,5 conjugated cation\t[N;+0!H0:1]@-[A:2]=[A:3]@-[A:4]=[N!$(*~[N,O,P,S;-1]),O;+1H0:5]>>[*+1:1]=[*:2]-[*:3]=[*:4]-[*+0:5]\n"
75 "Normalize 1,3 conjugated cation\t[N,O!$(*N);+0!H0:1]-[A:2]=[N!$(*~[N,O,P,S;-1]),O;+1H0:3]>>[*+1:1]=[*:2]-[*+0:3]\n"
76 "Normalize 1,3 conjugated cation\t[n;+0!H0:1]:[c:2]=[N!$(*~[N,O,P,S;-1]),O;+1H0:3]>>[*+1:1]:[*:2]-[*+0:3]\n"
77 "Normalize 1,5 conjugated cation\t[N;+0!H0:1]@-[A:2]=[A:3]-[A:4]=[N!$(*~[N,O,P,S;-1]),O;+1H0:5]>>[*+1:1]=[*:2]-[*:3]=[*:4]-[*+0:5]\n"
78 "Normalize 1,5 conjugated cation\t[N,O!$(*N);+0!H0:1]-[A:2]=[A:3]@-[A:4]=[N!$(*~[N,O,P,S;-1]),O;+1H0:5]>>[*+1:1]=[*:2]-[*:3]=[*:4]-[*+0:5]\n"
79 "Normalize 1,5 conjugated cation\t[N,O!$(*N);+0!H0:1]-[A:2]=[A:3]-[A:4]=[N!$(*~[N,O,P,S;-1]),O;+1H0:5]>>[*+1:1]=[*:2]-[*:3]=[*:4]-[*+0:5]\n"
80 "Normalize 1,5 conjugated cation\t[n;+0!H0:1]:[a:2]:[a:3]:[c:4]=[N!$(*~[N,O,P,S;-1]),O;+1H0:5]>>[n+1:1]:[*:2]:[*:3]:[*:4]-[*+0:5]\n"
81 "Charge normalization\t[F,Cl,Br,I,At;-1:1]=[O:2]>>[*-0:1][O-:2]\n"
82 "Charge recombination\t[N,P,As,Sb;-1:1]=[C+;v3:2]>>[*+0:1]#[C+0:2]\n"};
83 unsigned int normalizerMaxRestarts{200};
84 double scaledMedianBondLength{1.};
87 bool outputV2000{
false};
151 void append(PipelineStatus newStatus,
const std::string &info);
156namespace Operations {
188 {
static_cast<uint32_t>(PipelineStage::PREPARE_FOR_VALIDATION),
194 {
static_cast<uint32_t>(PipelineStage::PREPARE_FOR_STANDARDIZATION),
208 Operations::standardizationSteps;
219 validationSteps = steps;
222 standardizationSteps = steps;
PREPARE_FOR_STANDARDIZATION_ERROR
FRAGMENT_STANDARDIZATION_ERROR
NORMALIZER_STANDARDIZATION_ERROR
FEATURES_VALIDATION_ERROR
LAYOUT2D_VALIDATION_ERROR
PREPARE_FOR_VALIDATION_ERROR
CHARGE_STANDARDIZATION_ERROR
METAL_STANDARDIZATION_ERROR
Defines the editable molecule class RWMol.
void setValidationSteps(const Operations::PipelineVector &steps)
void setSerialize(Operations::SerializeOperation op)
PipelineResult run(const std::string &molblock) const
void setStandardizationSteps(const Operations::PipelineVector &steps)
void setParse(Operations::ParseOperation op)
void setMakeParent(Operations::ParentOperation op)
Pipeline(const PipelineOptions &o)
#define RDKIT_MOLSTANDARDIZE_EXPORT
RDKIT_MOLSTANDARDIZE_EXPORT RWMOL_SPTR reapplyWedging(RWMOL_SPTR mol, PipelineResult &result, const PipelineOptions &options)
RDKIT_MOLSTANDARDIZE_EXPORT RWMOL_SPTR validate(RWMOL_SPTR mol, PipelineResult &result, const PipelineOptions &options)
RDKIT_MOLSTANDARDIZE_EXPORT RWMOL_SPTR cleanup2D(RWMOL_SPTR mol, PipelineResult &result, const PipelineOptions &options)
decltype(&serialize) SerializeOperation
const PipelineVector standardizationSteps
RDKIT_MOLSTANDARDIZE_EXPORT RWMOL_SPTR standardize(RWMOL_SPTR mol, PipelineResult &result, const PipelineOptions &options)
RDKIT_MOLSTANDARDIZE_EXPORT RWMOL_SPTR parse(const std::string &molblock, PipelineResult &result, const PipelineOptions &options)
RDKIT_MOLSTANDARDIZE_EXPORT RWMOL_SPTR prepareForValidation(RWMOL_SPTR mol, PipelineResult &result, const PipelineOptions &options)
const PipelineVector validationSteps
RDKIT_MOLSTANDARDIZE_EXPORT RWMOL_SPTR prepareForStandardization(RWMOL_SPTR mol, PipelineResult &result, const PipelineOptions &options)
RDKIT_MOLSTANDARDIZE_EXPORT void serialize(RWMOL_SPTR_PAIR output, PipelineResult &result, const PipelineOptions &options)
decltype(&makeParent) ParentOperation
RDKIT_MOLSTANDARDIZE_EXPORT RWMOL_SPTR_PAIR makeParent(RWMOL_SPTR mol, PipelineResult &result, const PipelineOptions &options)
std::vector< std::pair< std::uint32_t, Operation > > PipelineVector
decltype(&prepareForValidation) Operation
decltype(&parse) ParseOperation
enum RDKIT_MOLSTANDARDIZE_EXPORT COMPLETED
enum RDKIT_MOLSTANDARDIZE_EXPORT PipelineStage
enum RDKIT_MOLSTANDARDIZE_EXPORT PREPARE_FOR_STANDARDIZATION
enum RDKIT_MOLSTANDARDIZE_EXPORT CLEANUP_2D
enum RDKIT_MOLSTANDARDIZE_EXPORT MAKE_PARENT
enum RDKIT_MOLSTANDARDIZE_EXPORT STANDARDIZATION
enum RDKIT_MOLSTANDARDIZE_EXPORT PARSING_INPUT
std::pair< RWMOL_SPTR, RWMOL_SPTR > RWMOL_SPTR_PAIR
enum RDKIT_MOLSTANDARDIZE_EXPORT VALIDATION
enum RDKIT_MOLSTANDARDIZE_EXPORT PREPARE_FOR_VALIDATION
enum RDKIT_MOLSTANDARDIZE_EXPORT REAPPLY_WEDGING
enum RDKIT_MOLSTANDARDIZE_EXPORT SERIALIZING_OUTPUT
std::vector< PipelineLogEntry > PipelineLog
bool rdvalue_is(const RDValue_cast_t)
boost::shared_ptr< RWMol > RWMOL_SPTR
std::string parentMolData
std::string outputMolData
void append(PipelineStatus newStatus, const std::string &info)