OEMCMolBase

class OEMCMolBase : public OEMolBase

The OEMCMolBase class provides the basic multi-conformer molecule in OEChem. It is an abstract base class which defines the interface for multi-conformer molecule implementations. Coordinates can be stored in OEHalfFloat (16-bit), float (32-bit), double (64-bit), or long double (>= 64-bit). The precision is determined by the constructor argument given to OEMol, taken from the OEMCMolType namespace. OEMCMolBase have an interface which allow access to conformers in a modal (OEMCMolBase.GetActive) or a non-modal manner (OEMCMolBase.GetConfs).

The following methods are publicly inherited from OEMolBase:

operator=

GetDimension

NumBonds

operator bool

GetEnergy

NumGroups

Clear

GetGroup

OrderAtoms

ClearCoords

GetGroups

OrderBonds

Compress

GetMaxAtomIdx

ResetPerceived

Count

GetMaxBondIdx

SetCoords

CreateCopy

GetTitle

SetDimension

DeleteAtom

HasPerceived

SetEnergy

DeleteBond

IsDataType

SetPerceived

DeleteGroup

IsDeleted

SetRxn

GetAtom

IsRxn

SetTitle

GetAtoms

NewAtom

Sweep

GetBond

NewBond

UnCompress

GetBonds

NewGroup

GetCoords

NumAtoms

The following methods are publicly inherited from OEBase:

operator=

GetData

IsDataType

operator+=

GetDataIter

SetBaseData

AddBaseData

GetDataType

SetBoolData

AddData

GetDoubleData

SetData

Clear

GetFloatData

SetDoubleData

CreateCopy

GetIntData

SetFloatData

DeleteData

GetStringData

SetIntData

GetBoolData

HasData

SetStringData

ClearBase

ClearBase() -> None

Clear the generic data from the OEBase base class of this object. Equivalent to just calling OEBase.Clear without actually clearing away molecule data like atoms, bonds, and conformers.

ClearMCMol

ClearMCMol() -> None

Clears molecule data like atoms, bonds, and conformers without clearing away the OEBase generic data.

ClearMolBase

ClearMolBase() -> None

Equivalent to calling OEMolBase.Clear.

DeleteConf

DeleteConf(arg2: OEConfBase) -> bool

Deletes the conformer which is passed in from the OEMCMolBase object.

DeleteConfs

DeleteConfs() -> None

Warning

OEMCMolBase.DeleteConfs leaves the OEMCMolBase object in an unstable state. It should be used with care and followed shortly with a call to OEMCMolBase.NewConf.

Deletes all of the conformers from the OEMCMolBase object. This is a very useful function for creating a new transformed OEMCMolBase from an untransformed molecule.

See also

Listing 3 code example in the Conformer Creation section

GetActive

GetActive() -> OEConfBase

Returns the currently active conformer of the OEMCMolBase object.

Note

The OEMCMolBase.GetActive and OEMCMolBase.SetActive methods are often sufficient for accessing conformations in multi-conformer molecules.

GetConf

GetConf(arg2: OEUnaryConfPred) -> OEConfBase

Returns the first conformer in the molecule for which the predicate passed in returns true.

GetConfs

GetConfs() -> OEConfIter
GetConfs(arg2: OEUnaryConfPred) -> OEConfIter

Returns an iterator over the conformers in the multi-conformer molecule. The return value of this function should always be assigned to an OEIter object. The function which takes no arguments returns an iterator over all of the conformers. The function which takes a predicate returns an iterator which only contains conformers for which the predicate returns true.

GetMaxConfIdx

GetMaxConfIdx() -> int

For performance reasons, conformer indices are not guaranteed to be contiguous. OEMCMolBase.GetMaxConfIdx returns a lower bound for the maximum conformer index i.e. all indices returned by OEConfBase.GetIdx of the multi-conformer molecule will be less than this value. The value returned by OEMCMolBase.GetMaxConfIdx is always at least as large as OEMCMolBase.NumConfs.

This method is useful for allocating temporary external data structures that need to be indexed by conformer index, as returned by OEConfBase.GetIdx.

GetMCMolTitle

GetMCMolTitle() -> str

Return the title for the parent molecule, don’t fall back to a conformer title like OEConfBase.GetTitle.

IsDeleted

IsDeleted(arg2: OEConfBase) -> bool

Returns whether the passed in conformer has already been deleted.

See also

NewConf

NewConf() -> OEConfBase
NewConf(arg2: OEHalfFloat) -> OEConfBase
NewConf(arg2: OEFloatArray) -> OEConfBase
NewConf(arg2: OEDoubleArray) -> OEConfBase
NewConf(arg2: Union[OEGraphMol,OEMol,OEQMol]) -> OEConfBase
NewConf(arg2: OEConfBase) -> OEConfBase
NewConf(arg2: OEConfBase, arg3: OETrans) -> OEConfBase
NewConf(arg2: OEConfBase, t: List[OETorsion]) -> OEConfBase

These methods generate a new conformer that is owned by the current OEMCMolBase. Each of the methods will return a pointer to the newly created conformer. The OEMCMolBase.NewConf methods act as virtual constructors of the OEConfBase objects. OEMCMolBase.NewConf constructs a conformer with its default constructor. NewConf(const OEMolBase *) and NewConf(const OEConfBase *) copy construct a new conformer with the coordinates from the object passed into the function. The objects passed in must have the same graph as the current OEMCMolBase. NewConf that takes a OEHalfFloat, float, double, or long double pointer constructs a new conformer with the coordinates passed in as coords. The array must be of length GetMaxAtomIdx() * 3, and the coordinates for each atom in the new conformer should be the dimension values in the array starting at coords[atom->GetIdx() * 3].

Passing a NULL to any of these methods will effectively do nothing and just return a NULL OEConfBase pointer.

Warning

The dimension of the conformer will be set to 0 for the NewConf default constructor. The NewConf methods that create conformers from coordinates will set the dimension of the conformer to 3. The NewConf methods that copy construct will copy the dimension from the source.

NumConfs

NumConfs() -> int

Returns the number of conformers contained in the OEMCMolBase object.

OrderConfs

OrderConfs(arg2: OEConfVector) -> bool

Reorders the conformers in the molecule to the order specified in the vector argument. If the vector contains an incomplete list, the remaining conformers will come at the end. This function call changes the order in which the conformers are returned by OEMCMolBase.GetConfs, but does not change the conformer indices.

PopActive

PopActive() -> None

The OEMCMolBase.PopActive method along with the OEMCMolBase.PushActive method allow to maintain a stack of active conformers.

The OEMCMolBase.PopActive method removes the top active conformer from the active stack and makes the next highest conformer in the stack active.

PushActive

PushActive(arg2: OEConfBase) -> bool

The OEMCMolBase.PushActive method along with the OEMCMolBase.PopActive method allow to maintain a stack of active conformers.

The OEMCMolBase.PushActive method makes the new conformer the active one and pushes the previous active conformer down the stack.

SetActive

SetActive(arg2: OEConfBase) -> bool

Makes the conformer passed in become the active conformer. The conformer passed in must already be a member of the OEMCMolBase object.

Note

The OEMCMolBase.GetActive and OEMCMolBase.SetActive methods are often sufficient for accessing conformations in multi-conformer molecules.

SweepConfs

SweepConfs() -> bool

Cleans up unused memory and objects which may be associated with the conformers of the OEMCMolBase. Renumber the conformer indices sequentially. This function invalidates the conformer indices of all conformers in a molecule. Note that this function doesn’t guarantee that all conformer indices are sequential upon completion (some molecule implementations may treat OEMolBase.Sweep as a no-op).