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:
- The following classes derive from this class:
operator=¶
OEAtomBase &operator=(const OEAtomBase &a)
AddBond¶
bool AddBond(const OEBondBase *)=0
Clear¶
void Clear()=0
GetAtomicNum¶
unsigned int GetAtomicNum() const =0
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¶
OESystem::OEIterBase<OEAtomBase> *GetAtoms() const =0
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
.
OESystem::OEIterBase<OEAtomBase> *
GetAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &) const =0
Returns an iterator over the neighboring atoms of the OEAtomBase that match the predicate (OEUnaryPredicate)
GetBond¶
OEBondBase *GetBond(const OEAtomBase *) const
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¶
OESystem::OEIterBase<OEBondBase> *GetBonds() const =0
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
.
OESystem::OEIterBase<OEBondBase> *
GetBonds(const OESystem::OEUnaryPredicate<OEChem::OEBondBase> &) const =0
Returns an iterator over the bonds of the OEAtomBase that match the predicate (OEUnaryPredicate)
GetDegree¶
unsigned int GetDegree() const
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¶
unsigned int GetExplicitDegree() const =0
Returns the number of explicit neighbor atoms bonded to an atom. This value does not include bonds to implicit hydrogen atoms.
GetExplicitHCount¶
unsigned int GetExplicitHCount() const
Returns the number of explicit hydrogen neighbors bonded to an atom.
GetExplicitValence¶
unsigned int GetExplicitValence() const
Returns the sum of the bond orders of explicit bonds connected to an atom.
GetFormalCharge¶
int GetFormalCharge() const =0
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¶
unsigned int GetHvyDegree() const
Returns the number of non-hydrogen neighbors of an atom.
GetHvyValence¶
unsigned int GetHvyValence() const
Returns the sum of bond orders of bonds to non-hydrogen atoms.
GetHyb¶
unsigned int GetHyb() const =0
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¶
unsigned int GetIdx() const =0
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*
.
See also
GetImplicitHCount¶
unsigned int GetImplicitHCount() const =0
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¶
int GetIntType() const =0
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¶
unsigned int GetIsotope() const =0
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¶
unsigned int GetMapIdx() const =0
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
OEAtomBase::SetMapIdx
methodOEIsRGroup predicate
GetName¶
const char *GetName() const =0
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¶
OEMolBase *GetParent() const =0
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¶
double GetPartialCharge() const =0
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¶
double GetRadius() const
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¶
unsigned int GetRxnRole() const
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¶
unsigned int GetStereo(const std::vector<OEAtomBase *> &neighs, unsigned int stereoclass) const
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¶
unsigned int GetSymmetryClass() const =0
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¶
unsigned int GetTotalHCount() const
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¶
const char *GetType() const =0
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¶
unsigned int GetValence() const
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¶
bool HasAlphaBetaUnsat(bool includePandS=true) const
Warning
This is a deprecated method. Use OEHasAlphaBetaUnsat predicate instead.
HasStereoSpecified¶
bool HasStereoSpecified(unsigned int v=OEAtomStereo::All) const
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
.
See also
IsAromatic¶
bool IsAromatic() const =0
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
Aromaticity Perception chapter
IsCarbon¶
bool IsCarbon() const
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¶
bool IsChiral() const
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¶
bool IsConnected(const OEAtomBase *) const
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¶
bool IsDataType(const void *) const
IsDeleted¶
bool IsDeleted() const =0
IsHalogen¶
bool IsHalogen() const
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¶
bool IsHydrogen() const
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¶
bool IsInRing() const =0
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
Ring Perception chapter
IsMetal¶
bool IsMetal() const
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¶
bool IsNitrogen() const
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¶
bool IsOxygen() const
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¶
bool IsPhosphorus() const
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¶
bool IsPolar() const
Determines whether an atom is neither a carbon
(OEElemNo::C
) nor hydrogen
(OEElemNo::H
).
IsPolarHydrogen¶
bool IsPolarHydrogen() const
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¶
bool IsSulfur() const
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¶
bool OrderBonds(const std::vector<OEBondBase *> &)=0
RemoveBond¶
bool RemoveBond(OEBondBase *)=0
SetAromatic¶
bool SetAromatic(bool)=0
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
Aromaticity Perception chapter
SetAtomicNum¶
bool SetAtomicNum(unsigned int)=0
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.
SetFormalCharge¶
bool SetFormalCharge(int)=0
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¶
bool SetHyb(unsigned int)=0
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.
See also
SetImplicitHCount¶
bool SetImplicitHCount(unsigned int)=0
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¶
bool SetInRing(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
Ring Perception chapter
SetIntType¶
bool SetIntType(int)=0
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¶
bool SetIsotope(unsigned int)=0
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¶
bool SetMapIdx(unsigned int)=0
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
OEAtomBase::GetMapIdx
method
SetName¶
bool SetName(const char *)=0
bool SetName(const std::string &)=0
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¶
bool SetPartialCharge(float)=0
bool SetPartialCharge(double)=0
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¶
bool SetRadius(double)
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¶
bool SetRxnRole(unsigned int)
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¶
bool SetStereo(const std::vector<OEAtomBase *> & neighs,
unsigned int stereoclass, unsigned int stereovalue)
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
orOEAtomStereo::Right
when specifying a tetrahedral atom stereo center, orOEAtomStereo::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
.
See also
SetSymmetryClass¶
bool SetSymmetryClass(unsigned int)=0
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¶
bool SetType(const char *)=0
bool SetType(const std::string &)=0
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.
Sweep¶
bool Sweep()=0