OEAtomBase

class OEAtomBase : public OESystem::OEBase

The OEAtomBase class is the abstract interface for representing atoms within OpenEye’s Toolkits. An OEAtomBase object is created by calling the NewAtom method on the parent molecule.

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

The following classes derive from this class:

Assignment operator.

Clear

Clear() -> None

GetAtomicNum

GetAtomicNum() -> int

Returns the ‘atomic number’ property of the atom. A value of zero is returned for wildcard atoms, such as MDL super atoms. An atomic number is specified as the argument to OEMolBase.NewAtom and may be changed using OEAtomBase.SetAtomicNum. The set of valid values for this property are defined by the OEElemNo namespace.

GetAtoms

GetAtoms() -> OEAtomIter

Returns an iterator over the neighboring atoms of this atom. The returned iterator traverses only the explicit atoms that are bonded to the OEAtomBase. The number of neighbors in the iterator is identical to OEAtomBase.GetExplicitDegree.

GetAtoms(arg2: OEUnaryAtomPred) -> OEAtomIter

Returns an iterator over the neighboring atoms of the OEAtomBase that match the predicate (OEUnaryPredicate)

GetAxial

GetAxial(arg2: OEBondBase) -> bool

Warning

This is a deprecated API.

GetBond

GetBond(arg2: OEAtomBase) -> OEBondBase

Returns a OEBondBase pointer that connecting the OEAtomBase to the atom specified in the method argument. If the OEAtomBase is not connected to the specified atom, a NULL pointer (OEBondBase*)0 is returned.

GetBonds

GetBonds() -> OEBondIter

Returns an iterator over the bonds connected to the atom. The returned iterator traverses only the explicit bonds that are attached to the OEAtomBase. The number of bonds in the iterator is identical to OEAtomBase.GetExplicitDegree.

GetBonds(arg2: OEUnaryBondPred) -> OEBondIter

Returns an iterator over the bonds of the OEAtomBase that match the predicate (OEUnaryPredicate)

GetDegree

GetDegree() -> int

Returns the total number of neighbor atoms bonded to an atom, or equivalently the total number of bonds connected to an atom. This value includes bonds to implicit hydrogen atoms. This value is identical to OEAtomBase.GetExplicitDegree() + OEAtomBase.GetImplicitHCount(), and is also identical to OEAtomBase.GetHvyDegree() + OEAtomBase.GetTotalHCount().

GetExplicitDegree

GetExplicitDegree() -> int

Returns the number of explicit neighbor atoms bonded to an atom. This value does not include bonds to implicit hydrogen atoms.

GetExplicitHCount

GetExplicitHCount() -> int

Returns the number of explicit hydrogen neighbors bonded to an atom.

GetExplicitValence

GetExplicitValence() -> int

Returns the sum of the bond orders of explicit bonds connected to an atom.

GetFormalCharge

GetFormalCharge() -> int

Returns the ‘formal charge’ property of an atom. The default value is zero. The ‘formal charge’ property may be set using the SetFormalCharge method. Formal charges may also be set on a molecule using the OEAssignFormalCharges function that infers reasonable formal charges using the atomic number, and implicit hydrogen count for each atom.

GetHvyDegree

GetHvyDegree() -> int

Returns the number of non-hydrogen neighbors of an atom.

GetHvyValence

GetHvyValence() -> int

Returns the sum of bond orders of bonds to non-hydrogen atoms.

GetHyb

GetHyb() -> int

Returns the ‘hybridization’ property of an atom. The set of valid values for this property are defined in the OEHybridization namespace. The default value is zero, (OEHybridization_Unknown). The ‘hybridization’ property can be set with the OEAtomBase.SetHyb method.

GetIdx

GetIdx() -> int

Returns the atom index of an atom. This value is assigned when an atom is created. The atom index is unique for the atoms of a given molecule, and is stable (not reused) for the lifetime of that OEMolBase. These values may not be assigned sequentially, and may contain gaps. Atom indices are guaranteed to be less than OEMolBase.GetMaxAtomIdx. Atom indices are typically only used for efficiently storing data in arrays (or vectors) externally to the OEMolBase. They arrays can be conveniently indexed via OEAtomBase.GetIdx. For iterating across the atoms of a molecule, use OEMolBase.GetAtoms and for keeping track of a particular atom use an OEAtomBase*.

GetImplicitHCount

GetImplicitHCount() -> int

Returns the ‘implicit hydrogen count’ property of an atom. The default value is zero. The ‘implicit hydrogen count’ property may be set using the OEAtomBase.SetImplicitHCount method. Implicit hydrogen counts may also be set on a molecule using the OEAssignImplicitHydrogens function. The ‘implicit hydrogen count’ property of an atom is a stored, not a computed, property. To calculate a reasonable implicit hydrogen count for an atom from connectivity, use the OEDefaultImplicitHCount function.

To convert explicit hydrogens to implicit hydrogens, use the OESuppressHydrogens function, and to convert implicit hydrogens to explicit hydrogens, use the OEAddExplicitHydrogens function.

GetIntType

GetIntType() -> int

Returns the ‘integer atom type’ of an atom. The default value is zero. The ‘integer atom type’ property may be set using the OEAtomBase.SetIntType method.

GetIsotope

GetIsotope() -> int

Returns the ‘isotopic mass’ property of an atom. The default value is zero, meaning that the atom isn’t a specific single isotope, but a composition of isotopes in their naturally occurring abundances. A non-zero value indicates that the atom is a specific isotope. The ‘isotopic mass’ property may be set using the OEAtomBase.SetIsotope method.

GetMapIdx

GetMapIdx() -> int

Returns the ‘reaction map index’ of property of an atom. This integer value is used for tracking equivalent atom positions in a reaction molecule/transform. The default value is zero, meaning that the atom isn’t mapped in the reaction. This property is also used to store ‘R-group’ indices, for example when parsing the SMILES string CCC[R1].

See also

GetName

GetName() -> str

Returns the ‘atom name’ property of an atom. This property is typically used when reading or writing molecular file formats. For example in PDB files, the atom name `` CA `` is used to denote that the atom is a peptide alpha carbon. The default value is the empty string. The ‘atom name’ property may be set using the OEAtomBase.SetName method.

GetParent

GetParent() -> OEGraphMol

Returns the parent molecule (OEMolBase) of an atom. All OEAtomBases are created as a component of an OEMolBase, this method can be used to determine the molecule of which an atom is part. The ‘parent molecule’ property of an atom cannot be assigned, as its determined at the point the atom is created.

GetPartialCharge

GetPartialCharge() -> float

Returns the ‘partial charge’ property of an atom. The default value is 0.0. The ‘partial charge’ property on an atom may be set using the OEAtomBase.SetPartialCharge method. The ‘partial charge’ property is a stored, not a calculated, property. The OEClearPartialCharges function resets the partial charges on a molecule to zero, and the OEFormalPartialCharges function sets the partial charge on each atom equal to its formal charge.

GetRadius

GetRadius() -> float

Returns the ‘radius’ property of an atom. The default value is 0.0. The ‘radius’ property on an atom may be set using the OEAtomBase.SetRadius method. The ‘radius’ property is typically used to hold a Van der Waal’s or ionic radius for a given atom when passing an OEMolBase to an algorithm requiring some form of radii, such as a surface area calculation.

GetRxnRole

GetRxnRole() -> int

Returns the ‘reaction role’ property of an atom in a reaction molecule/transform. The set of valid values for this property are defined in the namespace OERxnRole. The default value is zero, OERxnRole_None, which means that the atom does have a role, i.e. is part of a normal molecule. Other values include OERxnRole_Reactant, OERxnRole_Agent and OERxnRole_Product which correspond to reactant, agent and product atoms, respectively, in a reaction or transform. The ‘reaction role’ property may be set using the OEAtomBase.SetRxnRole method.

GetStereo

GetStereo(arg2: OEAtomVector, arg3: int) -> int

Returns the stereochemistry annotation of the atom.

neighs

A vector of neighboring atoms and a specific stereochemistry class and returns whether that stereochemistry is specified at this atom, and if so, what that specified value is.

stereoclass

OEChem TK currently only supports the tetrahedral atom stereochemistry class. The only valid stereoclass value is OEAtomStereo_Tetra.

This method returns the value OEAtomStereo_Undefined if the stereo chemistry for the given stereochemistry class is unspecified, if the stereo chemistry class is invalid or if the vector of neighboring atoms is invalid.

For a specified tetrahedral stereo center, it returns either OEAtomStereo_Left or OEAtomStereo_Right.

The stereochemistry annotation of an atom may be set using the OEAtomBase.SetStereo method.

GetSymmetryClass

GetSymmetryClass() -> int

Returns the ‘symmetry class’ property of an atom. The default value is zero, indicating that symmetry classes haven’t been assigned. The ‘symmetry class’ property may be set using the OEAtomBase.SetSymmetryClass method. Symmetry classes of a molecule are usually set by calling the OEPerceiveSymmetry function.

GetTotalHCount

GetTotalHCount() -> int

Returns the total number of hydrogen atoms attached to an atom. This value includes the implicit hydrogen atoms. This value is identical to OEAtomBase.GetExplicitHCount() + OEAtomBase.GetImplicitHCount().

GetType

GetType() -> str

Returns the ‘atom type name’ property of an atom. This value is typically used when reading and writing molecular formats. For example, in Sybyl mol2 file, the atom type name N.pl3 means that the atom should be treated as a three-valent planar nitrogen. The default value is the empty string. The ‘atom type name’ property may be set using the OEAtomBase.SetType method.

GetValence

GetValence() -> int

Returns the sum of all bond orders to an atom. This value includes bonds to implicit hydrogen atoms. This value is equal to OEAtomBase.GetExplicitValence() + OEAtomBase.GetImplicitHCount().

HasAlphaBetaUnsat

HasAlphaBetaUnsat(includePandS: bool = True) -> bool

Warning

This is a deprecated method. Use OEHasAlphaBetaUnsat predicate instead.

HasStereoSpecified

HasStereoSpecified(v: int) -> bool

Determines whether the given atom has specified stereochemistry. The optional argument specifies the class of stereochemistry to check for. The default value, OEAtomStereo_All, checks whether any class of stereochemistry is specified for the current atom.

If an atom has unspecified stereochemistry, and this method returns false, the molecule is assumed to represent either a racemic mixture or an undetermined isomer of this compound. If this method returns true, this atom has an explicit stereochemistry which may be retrieved using the OEAtomBase.GetStereo method.

This method initially returns false for a newly created atom. The stereochemistry of an atom may be set by calling the OEAtomBase.SetStereo method with the appropriate stereochemistry class and any value other than OEAtomStereo_Undefined. The atom stereochemistry may subsequently be cleared by calling the same method, with the appropriate stereochemistry class, but specifying the value OEAtomStereo_Undefined.

IsAromatic

IsAromatic() -> bool

Returns the ‘aromatic’ property of an atom. The default value is false. The ‘aromatic’ property of an atom can be set using the OEAtomBase.SetAromatic method. The ‘aromatic’ property of atoms and bonds in a molecule are typically set by calling either the OEAssignAromaticFlags function and cleared by the OEClearAromaticFlags function.

See also

IsCarbon

IsCarbon() -> bool

Determines whether an atom is a carbon atom. This method tests whether the atom’s atomic number is 6, and is equivalent to OEAtomBase.GetAtomicNum() == OEElemNo_C.

IsChiral

IsChiral() -> bool

Determines whether the current atom is a stereogenic center. If this method returns true, the atom is a chiral atom and the different left-handed and right-handed configurations about this atom represent two distinct isomers. If this method returns false, this atom is not a chiral stereocenter.

Note

This chiral atom property is independent of the stereo atom property that records whether a particular left-handed or right-handed configuration is specified at a particular atom.

IsConnected

IsConnected(arg2: OEAtomBase) -> bool

Determines whether the atom is bonded to the given atom. To obtain the actual bond linking the atom to its neighbor use the OEAtomBase.GetBond method. This method is equivalent to OEAtomBase.GetBond() != (OEBondBase*)0.

IsDataType

IsDataType(arg2: void) -> bool

IsDeleted

IsDeleted() -> bool

IsHalogen

IsHalogen() -> bool

Determines whether an atom is a halogen atom. This method tests whether the atom is Fluorine, Chlorine, Bromine, Iodine or Astatine (atomic number OEElemNo_F, OEElemNo_Cl, OEElemNo_Br, OEElemNo_I or OEElemNo_As).

IsHydrogen

IsHydrogen() -> bool

Determines whether an atom is a hydrogen atom. This method tests whether the atom’s atomic number is 1, and is equivalent to OEAtomBase.GetAtomicNum() == OEElemNo_H.

IsInRing

IsInRing() -> bool

Returns the ‘in ring’ property of an atom. The default value is false. The ‘in ring’ property of an atom may be set using the OEAtomBase.SetInRing method. The ‘in ring’ properties of atoms and bonds are typically set by calling OEFindRingAtomsAndBonds function.

To determine whether an atom is a member of a specific ring/cycle size, use the OEAtomIsInRingSize function.

See also

IsMetal

IsMetal() -> bool

Determines whether an atom is a metal atom. This tests whether the atom number is not OEElemNo_H, OEElemNo_He, OEElemNo_B, OEElemNo_C, OEElemNo_N, OEElemNo_O, OEElemNo_F, OEElemNo_Ne, OEElemNo_Si, OEElemNo_P, OEElemNo_S, OEElemNo_Cl, OEElemNo_Ar, OEElemNo_As, OEElemNo_Se, OEElemNo_Br, OEElemNo_Kr, OEElemNo_Te, OEElemNo_I, OEElemNo_Xe, OEElemNo_At or OEElemNo_Rn.

IsNitrogen

IsNitrogen() -> bool

Determines whether an atom is a nitrogen atom. This method tests whether the atom’s atomic number is 7, and is equivalent to OEAtomBase.GetAtomicNum() == OEElemNo_N.

IsOxygen

IsOxygen() -> bool

Determines whether an atom is an oxygen atom. This method tests whether the atom’s atomic number is 8, and is equivalent to OEAtomBase.GetAtomicNum() == OEElemNo_O.

IsPhosphorus

IsPhosphorus() -> bool

Determines whether an atom is a phosphorus atom. This method tests whether the atom’s atomic number is 15, and is equivalent to OEAtomBase.GetAtomicNum() == OEElemNo_P.

IsPolar

IsPolar() -> bool

Determines whether an atom is neither a carbon (OEElemNo_C) nor hydrogen (OEElemNo_H).

IsPolarHydrogen

IsPolarHydrogen() -> bool

Determines whether an atom is a hydrogen attached to a polar atom. If the atom’s atomic number is not one, i.e. OEAtomBase.IsHydrogen() == false, then this method returns false too. Otherwise, this method returns true if any of its neighbors return true for OEAtomBase.IsPolar.

IsSulfur

IsSulfur() -> bool

Determines whether an atom is a sulfur (sulphur) atom. This method tests whether the atom’s atomic number is 16, and is equivalent to OEAtomBase.GetAtomicNum() == OEElemNo_S.

OrderBonds

OrderBonds(arg2: OEBondVector) -> bool

SetAromatic

SetAromatic(arg2: bool) -> bool

Sets the ‘aromatic’ property of an atom. This value is false by default. The ‘aromatic’ property of an atom may be retrieved using the OEAtomBase.IsAromatic method. This method is normally only used by the OEClearAromaticFlags function and the OEAssignAromaticFlags function.

See also

SetAtomicNum

SetAtomicNum(arg2: int) -> bool

Sets the ‘atomic number’ property of an atom. The set of valid values for this property is specified by the OEElemNo. The default value is specified when an atom is created with OEMolBase.NewAtom method. The ‘atomic number’ property of an atom can be retrieved using the OEAtomBase.GetAtomicNum method.

SetAxial

SetAxial(arg2: OEBondBase, arg3: bool) -> bool

Warning

This is a deprecated method.

SetChiral

SetChiral(arg2: bool) -> bool

SetFormalCharge

SetFormalCharge(arg2: int) -> bool

Sets the ‘formal charge’ property of an atom. The default value is zero. The ‘formal charge’ property may be retrieved using the OEAtomBase.GetFormalCharge method.

SetHyb

SetHyb(arg2: int) -> bool

Sets the ‘hybridization’ property of an atom. The set of valid values for this property is specified by the OEHybridization namespace. The default value is zero (OEHybridization_Unknown). The ‘hybridization’ property may be retrieved using the OEAtomBase.GetHyb method.

SetImplicitHCount

SetImplicitHCount(arg2: int) -> bool

Sets the ‘implicit hydrogen count’ property of an atom. The default value is zero. The ‘implicit hydrogen count’ property may be retrieved using the OEAtomBase.GetImplicitHCount method.

SetInRing

SetInRing(arg2: bool) -> bool

Sets the ‘in ring’ property of an atom. This property is usually set by the OEFindRingAtomsAndBonds function. The default value is false. The ‘in ring’ property of an atom may be retrieved using the OEAtomBase.IsInRing method.

See also

SetIntType

SetIntType(arg2: int) -> bool

Sets the ‘integer atom type’ property of an atom. The default value is zero. The ‘integer atom type’ property may be retrieved using the OEAtomBase.GetIntType method. Note that IntType is considered volatile and can be overwritten by different algorithms and also is not retained during I/O.

SetIsotope

SetIsotope(arg2: int) -> bool

Sets the ‘isotopic mass’ property of an atom (i.e. number of protons and neutrons). The default value is zero, meaning that the atom isn’t a specific single isotope, but a composition of isotopes in their naturally occurring abundances. A non-zero value indicates that the atom is a specific isotope. The ‘isotopic mass’ property can be retrieved using the OEAtomBase.GetIsotope method.

SetMapIdx

SetMapIdx(arg2: int) -> bool

Sets the ‘reaction map index’ property of an atom. This integer value is used for tracking equivalent atom positions in a reaction molecule/transform. The default value is zero, meaning that the atom isn’t mapped in the reaction.

See also

SetName

SetName(arg2: str) -> bool

Sets the ‘atom name’ property of an atom. This property is typically used when reading or writing molecular file formats. For example in PDB files, the atom name `` CA `` is used to denote that the atom is a peptide alpha carbon. The default value is the empty string. The ‘atom name’ property may be retrieved using the OEAtomBase.GetName method.

SetPartialCharge

SetPartialCharge(arg2: float) -> bool

Sets the ‘partial charge’ property of an atom. The default value is 0.0. The ‘partial charge’ property may be retrieved using the OEAtomBase.GetPartialCharge method.

SetRadius

SetRadius(arg2: float) -> bool

Sets the ‘radius’ property of an atom. The assigned radius may be retrieved using the OEAtomBase.GetRadius method. The ‘radius’ property is typically used to hold a Van der Waal’s or ionic radius for a given atom when passing an OEMolBase to an algorithm requiring some form of radii, such as a surface area calculation.

SetRxnRole

SetRxnRole(arg2: int) -> bool

Sets the ‘reaction role’ property of an atom in a reaction molecule/transform. The set of valid values for this property is defined by the OERxnRole namespace. The default value is zero, OERxnRole_None, which means that the atom does have a role, i.e. is part of a normal molecule. Other values include OERxnRole_Reactant, OERxnRole_Agent and OERxnRole_Product which correspond to reactant, agent and product atoms, respectively, in a reaction or transform. The ‘reaction role’ property may be retrieved using the OEAtomBase.SetRxnRole method.

SetStereo

SetStereo(arg2: OEAtomVector, arg3: int, arg4: int) -> bool

Sets the stereochemistry annotation of the atom.

neighs

A vector of neighboring atoms that defines the stereochemistry.

stereoclass

OEChem TK currently only supports the tetrahedral atom stereochemistry class. The only valid stereoclass value is OEAtomStereo_Tetra.

stereovalue

This value can be either OEAtomStereo_Left or OEAtomStereo_Right when specifying a tetrahedral atom stereo center, or OEAtomStereo_Undefined when unspecifying i.e. deleting an atom stereo center.

This method returns true if the atom stereo was correctly set, and false if the stereochemistry class is invalid, the stereochemistry value is invalid for the stereochemistry class, or the vector of neighboring atoms is invalid. The stereo information of an atom may be retrieved using the OEAtomBase.GetStereo.

If set successfully, to a value other than OEAtomStereo_Undefined, future calls to OEAtomBase.HasStereoSpecified with the given stereochemistry class (or OEAtomStereo_All) will return true. If successfully set to the value OEAtomStereo_Undefined, future calls to OEAtomBase.HasStereoSpecified will return false.

SetSymmetryClass

SetSymmetryClass(arg2: int) -> bool

Sets the symmetry class of an atom. This routine is normally only called by the OEPerceiveSymmetry function. The default value is zero, indicating that the symmetry class hasn’t be perceived. The symmetry class of an atom may be retrieved by using the OEAtomBase.GetSymmetryClass function.

SetType

SetType(arg2: str) -> bool

Sets the ‘atom type name’ property of an atom. This value is typically used when reading and writing molecular formats. For example, in Sybyl mol2 file, the atom type name N.pl3 means that the atom should be treated as a three-valent planar nitrogen. The default value is the empty string. The ‘atom type name’ property may be retrieved using the OEAtomBase.GetType method.