# OELibraryGen¶

class OELibraryGen


This class represents OELibraryGen.

## Constructors¶

OELibraryGen()


Default constructor.

OELibraryGen(const OELibraryGen &rhs)


Copy constructor.

OELibraryGen(const char * smirks, bool strictSmirks=true)


Creates a OELibraryGen object with a ‘smirks’ (SMIRKS) pattern.

Success of initialization can be tested using the operator OELibraryGen.operator bool method. The second argument to the constructor is used to specify the interpretation of the SMIRKS semantics. By default, the ‘smirks string is interpreted using strict semantics.

• SMIRKS definition describing the strict SMIRKS semantics in the Glossary chapter.

## operator=¶

OELibraryGen &operator=(const OELibraryGen &rhs)


## operator()¶

bool operator()(OEMolBase &) const


## operator bool¶

operator bool() const


Returns true, if the OELibraryGen object was initialized with no failures using either the constructors or one of the OELibraryGen.Init methods.

The method will return false when the OELibraryGen object has not been properly initialized as it will be unable to apply transform operations to molecules.

unsigned int AddStartingMaterial(const OEMolBase &mol, unsigned int reacnum,
bool umatch=true)
unsigned int reacnum, bool umatch=true)
unsigned int reacnum, bool umatch=true)


Initializes the starting materials corresponding to a reaction component. An iterator over molecules or a single molecule may be passed as the first argument to the overloaded methods. Subsequent calls to the OELibraryGen.AddStartingMaterial methods append to the list of starting materials set in prior calls. The second argument (‘reacnum’) specifies the reactant to which the starting materials correspond.

A copy of the starting material molecules are stored internally with the atom maps from the reactant pattern. This is done for efficiency, as each product molecule requires very little computational work to be done because of the starting material preprocessing.

The final argument (‘umatch) is used to control the pattern matching of the reactant pattern to the starting material. If the value passed is true, only matches that contain a unique set of atoms relative to previously identified matches are used. If the value is false, every possible match including those related by symmetry will be used. Reactant patterns are unique matched by default.

## ClearStartingMaterial¶

void ClearStartingMaterial(unsigned reacnum)


Removes any starting materials previously set by either the OELibraryGen.AddStartingMaterial or the OELibraryGen.SetStartingMaterial methods corresponding to the reactant pattern number (‘reacnum’ ) passed as the argument to the method.

## GetAssignMapIdx¶

bool GetAssignMapIdx() const


## GetClearCoordinates¶

bool GetClearCoordinates() const


Returns whether the coordinates of a molecule are cleared when the molecule is added to the library generation by calling the OELibraryGen.AddStartingMaterial or OELibraryGen.SetStartingMaterial methods.

## GetExplicitHydrogens¶

bool GetExplicitHydrogens() const


## GetProducts¶

OESystem::OEIterBase<OEMolBase> *GetProducts() const


Returns an iterator over all the products generated by the library generation.

## GetRemoveUnmappedFragments¶

bool GetRemoveUnmappedFragments() const


## GetStartingMaterial¶

OESystem::OEIterBase<OEMolBase> *GetStartingMaterial(unsigned int rnum) const


## GetTitleSeparator¶

const std::string& GetTitleSeparator() const


Retrieves the string used to separate molecule titles in product molecules generated by the OELibraryGen object. The titles of product molecules are created by concatenating reactant molecule titles with a delimiter or separator inserted between the reactant molecule titles. The default separator is the underscore character _. The title separator string can be changed by calling the OELibraryGen.SetTitleSeparator method.

## GetValenceCorrection¶

bool GetValenceCorrection() const


## GetValidateKekule¶

bool GetValidateKekule() const


Returns whether the library generation validates the Kekulé form of the returned products.

## Init¶

bool Init(const char *smirks, bool strictSmirks=true)
bool Init(const OEQMolBase &, bool strictSmirks=true)


## NumReactants¶

unsigned int NumReactants() const


Returns the number of separate reactants that the OELibraryGen object perceived during initialization. The value returned will be equal to the number of graphically disconnected reactants that are not grouped together using the SMIRKS parts primitive.

## SetAssignMapIdx¶

bool SetAssignMapIdx(bool)


## SetClearCoordinates¶

bool SetClearCoordinates(bool clearcoords)


Sets whether the coordinates of a molecule are cleared when the molecule is added to the library generation by calling the OELibraryGen.AddStartingMaterial or OELibraryGen.SetStartingMaterial methods.

Note

The OELibraryGen modifies the molecular graph of the reactant(s) to generate products. Generating valid 2D or 3D coordinates for the products is beyond the scope of the OELibraryGen class.

It is recommended to either clear the coordinates by invoking the OELibraryGen.SetClearCoordinates method or regenerate the coordinates of the products afterwards.

## SetExplicitHydrogens¶

bool SetExplicitHydrogens(bool)


## SetRemoveUnmappedFragments¶

bool SetRemoveUnmappedFragments(bool)


## SetStartingMaterial¶

unsigned int SetStartingMaterial(const OEMolBase &mol, unsigned int reacnum,
bool umatch=true)
unsigned int SetStartingMaterial(OESystem::OEIter<OEMolBase> &,
unsigned int reacnum, bool umatch=true)
unsigned int SetStartingMaterial(OESystem::OEIterBase<OEMolBase> *,
unsigned int reacnum, bool umatch=true)


Initializes the starting materials corresponding to a reaction component. An iterator over molecules or a single molecule may be passed as the first argument to the overloaded methods. Subsequent calls to the OELibraryGen.SetStartingMaterial methods discard the list of starting materials set in prior calls. The second argument (‘reacnum’) specifies the reactant to which the starting materials correspond.

A copy of the starting material molecules are stored internally with the atom maps from the reactant pattern. This is done for efficiency, as each product molecule requires very little computational work to be done because of the starting material preprocessing.

The final argument (‘umatch’) is used to control the pattern matching of the reactant pattern to the starting material. If the value passed is true, only matches that contain a unique set of atoms relative to previously identified matches are used. If the value is false, every possible match including those related by symmetry will be used. Reactant patterns are unique matched by default.

## SetTitleSeparator¶

bool SetTitleSeparator(const char *c)


Sets the separator or delimiter used by the OELibraryGen object to compose product molecule titles. Product molecule titles are created by concatenating reactant molecule titles separated by a title separator or delimiter. The default separator is the underscore character _.

Note

The title separator must be set prior to calling OELibraryGen.GetProducts. Calling OELibraryGen.SetTitleSeparator after calling OELibraryGen.GetProducts will have no affect on the resultant product molecule titles.

The title separator or delimiter can be accessed by the OELibraryGen.GetTitleSeparator method.

bool SetValenceCorrection(bool)

bool SetValidateKekule(bool validate)
`