class OEAtomBase : public OESystem::OEBase
The OEAtomBase class is the abstract interface for representing atoms
within OEChem. OEAtomBases are created by calling the
OEMolBase::NewAtom method on the parent molecule.
virtual unsigned int GetAtomicNum() const
Return the atomic number 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 OEAtomBase::NewAtom and may be changed using
OEAtomBase::SetAtomicNum. The set of unsigned integer values for
this property are defined by the OEElemNo namespace.
virtual OESystem::OEIterBase<OEAtomBase> *GetAtoms() const
virtual OESystem::OEIterBase<OEAtomBase> *GetAtoms(
const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &) const
Return an OEAtomBase iterator of 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.
virtual OEBondBase *GetBond(const OEAtomBase *nbor) const
Return a pointer to the bond connecting the OEAtomBase to the atom specified in the method argument. If the OEAtomBase is not connected to the specified atom, a NULL pointer code(OEBondBase*)0 is returned.
virtual OESystem::OEIterBase<OEBondBase> *GetBonds() const virtual OESystem::OEIterBase<OEBondBase> *GetBonds( const OESystem::OEUnaryPredicate<OEChem::OEBondBase> &) const
Return an OEBondBase iterator of the bonds connected to an 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.
virtual unsigned int GetDegree() const
Return 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().
virtual unsigned int GetExplicitDegree() const
Return the number of explicit neighbor atoms bonded to an atom. This value does not include bonds to implicit hydrogen atoms.
virtual unsigned int GetExplicitHCount() const
Return the number of explicit hydrogen neighbors bonded to an atom.
virtual unsigned int GetExplicitValence() const
Return the sum of the bond orders of explicit bonds connected to an atom.
virtual int GetFormalCharge() const
Return the formal charge on an atom. The default value is zero. The
``formal charge'' property may be set using the
OEAtomBase::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.
virtual unsigned int GetHvyDegree() const
Return the number of non-hydrogen neighbors of an atom.
virtual unsigned int GetHvyValence() const
Return the sum of bond orders of bonds to non-hydrogen atoms.
virtual unsigned int GetHyb() const
Return the ``hybridization'' of an atom. The set of unsigned integer
values for this property are defined in the namespace
OEHybridization. The default value is zero,
OEHybridization::Unknown. The ``hybridization'' property may be
set with the OEAtomBase::SetHyb method. Hybridizations may also
be set on a molecule using the function OEAssignHybridization.
The hybridization property of an atom is a stored, not a computed, property.
To calculate a reasonable hybridization of an atom from connectivity, use
the function OEGetHybridization.
virtual unsigned int GetIdx() const
Return the atom index of an atom. This value is assigned by OEChem
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*.
virtual unsigned int GetImplicitHCount() const
Return the number of implicit hydrogens attached to 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 function
OEAssignImplicitHydrogens. 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 function OEDefaultImplicitHCount.
To convert explicit hydrogens to implicit hydrogens, use the OEChem
function OESupressHydrogens, and to convert implicit hydrogens
to explicit hydrogens, use the function OEAddExplicitHydrogens.
virtual int GetIntType() const
Return 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.
virtual unsigned int GetIsotope() const
Return the isotopic mass 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.
virtual unsigned int GetMapIdx() const
Return the reaction atom map index 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. The ``reaction map index'' property may
be set using the OEAtomBase::SetMapIdx method.
virtual const char *GetName() const
Return the atom name string 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.
virtual OEMolBase *GetParent() const
Return the parent molecule 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.
virtual double GetPartialCharge() const
Return the floating point partial charge on 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 function
OEClearPartialCharges may be used to reset the partial charges on
a molecule to zero, and the function OEFormalPartialCharges may be
used to set the partial charge on each atom equal to its formal charge.
virtual double GetRadius() const
Return the floating point radius assigned to 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.
virtual unsigned int GetRxnRole() const
Return the reaction role of an atom in a reaction molecule/transform.
The set of unsigned integer 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 in a reaction or transform. The reaction role property may be
set using the OEAtomBase::SetRxnRole method.
virtual unsigned int GetStereo(const std::vector<OEAtomBase*> &v,
unsigned int c)
Return the chirality (or stereochemistry) annotation of the current
atom. This method takes a STL vector of neighboring atoms, v,
and a specific stereochemistry class, c, and returns whether that
stereochemisty is specified at this atom, and if so, what that
specified value is. The chiral annotation of an atom may be set
using the OEAtomBase::SetStereo method. This function 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.
In the current version of OEChem, the only class of stereochemistry
supported for atoms is OEAtomStereo::Tetrahedral which corresponds
to sp3 tetrahedral chirality. Valid return values for the
OEAtomStereo::Tetrahedral stereochemistry class are
OEAtomStereo::Left and OEAtomStereo::Right.
virtual unsigned int GetSymmetryClass()
Return the symmetry class 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
function OEPerceiveSymmetry.
virtual unsigned int GetTotalHCount() const
Return 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().
virtual const char *GetType() const
Return the ``atom type name'' string 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.
virtual unsigned int GetValence() const
Return 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().
virtual bool HasStereoSpecified(unsigned int c=OEAtomStereo::All) const
Determine whether the given atom has specified stereochemistry. The
optional argument specifies the class of stereochemisty to check for.
The default value, OEAtomStereo::All, checks whether any class
of stereochemistry is specified for the current atom.
In the current version of OEChem, the only class of stereochemistry
supported for atoms is OEAtomStereo::Tetrahedral which corresponds
to sp3 tetrahedral chirality. If a chiral atom has unspecified
stereochemistry, and this function returns false, the molecule is
assumed to represent either a racemic mixture or an undetermined isomer
of this compound. If this function 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, c, 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.
virtual bool IsAromatic() const
Return the Boolean 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 properties of atoms
and bonds in a molecule are typically set by calling either the OEChem
OEAssignAromaticFlags function, or possibly the
OEClearAromaticFlags function.
virtual bool IsCarbon() const
Determine 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.
virtual bool IsChiral() const
Determine whether the current atom is a stereogenic center. If this method returns true, the atom is a chiral center and the different left-handed and right-handed configurations about this atom represent two distinct isomers. If this function returns false, this atom is not a chiral stereocenter.
This method/value is independent of the current
OEAtomBase::HasStereoSpecified setting which records whether
a particular left-handed or right-handed configuration is specified
at a particular atom.
virtual bool IsConnected(const OEAtomBase *nbor) const
Determine whether the atom is bonded to the given atom ``nbor''. 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.
virtual bool IsHalogen() const
Determine whether an atom is a halogen atom. This method tests whether the atom is Fluorine, Chlorine, Bromine, Iodine or Astatine (atomic number 9, 17, 35, 53 or 85).
virtual bool IsHydrogen() const
Determine 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.
virtual bool IsInRing() const
Return the Boolean ``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 OEChem's
OEFindRingAtomsAndBonds function. This is a stored, not a computed,
property.
To determine whether an atom is a member of a specific ring/cycle
size, use the function OEAtomIsInRingSize().
virtual bool IsMetal() const
Determine whether an atom is a metal atom. This tests whether the atom is not H, He, B, C, N, O, F, Ne, Si, P, S, Cl, Ar, As, Se, Br, Kr, Te, I, Xe, At or Rn.
virtual bool IsNitrogen() const
Determine 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.
virtual bool IsOxygen() const
Determine 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.
virtual bool IsPhosphorus() const
Determine 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.
virtual bool IsPolar() const
Determine whether an atom is neither a carbon nor hydrogen. The method tests whether the atom's atomic number is any value other the 1 or 6.
virtual bool IsPolarHydrogen() const
Determine whether an atom is a hydrogen attached to a polar atom. If
the atom's atomic number is not one,
OEAtomBase::IsHydrogen() == false, then this method returns false.
Otherwise, this method returns true if any of its neighbors return true
for OEAtomBase::IsPolar().
virtual bool IsSulfur() const
Determine 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.
virtual bool SetAromatic(bool arom)
Set the Boolean 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 function is normally only
used by the functions OEClearAromaticity and
OEAssignAromaticityFlags.
virtual bool SetAtomicNum(unsigned int atno)
Set the atomic number of an atom. The set of unsigned integer values
for this property is specified by the OEElemNo namespace. The
default value is specified when an atom is created with
MolBase::NewAtom. The atomic number property of an atom may be
retrieved using the OEAtomBase::GetAtomicNum method.
virtual bool SetFormalCharge(int charge)
Set the formal charge of an atom. The default value is zero. The
formal charge property may be retrieved using the
OEAtomBase::GetFormalCharge method.
virtual bool SetHyb(unsigned int hyb)
Set the hybridization of an atom. The set of unsigned integer values
for this property is specified by the OEHybridization namespace.
The default value is zero, OEHybridization::undefined. The
hybridization property may be retrieved using the
OEAtomBase::GetHybridization method.
virtual bool SetImplicitHCount(unsigned int imph)
Set the implicit hydrogen count of an atom. The default value is
zero. The implicit hydrogen count property may be retrieved using the
OEAtomBase::GetImplicitHCount method.
virtual bool SetIntType(int type)
Set 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.
virtual bool SetInRing(bool inring)
Set the Boolean ``in ring'' property of an atom. This property is
usually set by the OEChem function OEFindRingAtomsAndBonds.
The default value is false. The ``in ring'' property of an atom may
be retrieved using the OEAtomBase::IsInRing method.
virtual bool SetIsotope(unsigned int mass)
Set the isotopic mass 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::GetIsotope method.
virtual bool SetMapIdx(unsigned int mapidx)
Set the reaction atom map index 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. The ``reaction map index'' property may
be retrieved using the OEAtomBase::GetMapIdx method.
virtual bool SetName(const std::string &nam) virtual bool SetName(const char *nam)
Set the atom name string 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.
virtual bool SetPartialCharge(double charge)
Set 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.
virtual bool SetRadius(double radius)
Set the ``radius'' property of an atom. The default value is 0.0.
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.
virtual bool SetRxnRole(unsigned int role)
Set the reaction role of an atom in a reaction molecule/transform.
The set of unsigned integer 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 in a reaction or transform. The reaction role property may be
retrieved using the OEAtomBase::SetRxnRole method.
virtual bool SetStereo(const std::vector<OEAtomBase*> &v,
unsigned int c, unsigned int p)
Set the chirality (or stereochemistry) annotation of the current
atom. This method takes a STL vector of neighboring atoms, v,
and a specific stereochemisty class, c and the value for that
chirality to be set to. This function returns true if the atom
chirality 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 chiral annotation of a atom may be retrieved using the
OEAtomBase::GetStereo.
If set sucessfully, to a value other than OEAtomStereo::Undefined,
future calls to OEAtomBase::HasStereoSpecified with the given
stereochemistry class (or OEAtomStereo::All) will return true.
If sucessfully set to the value OEAtomStereo::Undefined, future
calls to OEAtomBase::HasStereoSpecified will return false.
In the current version of OEChem, the only class of stereochemistry
supported for atoms is OEAtomStereo::Tetrahedral which corresponds
to sp3 tetrahedral chirality. Valid values for the
OEAtomStereo::Tetrahedral stereochemistry class are
OEAtomStereo::Left and OEAtomStereo::Right.
virtual bool SetSymmetryClass(unsigned int symclass)
Set the symmetry class of an atom. This routine is normally only
called by the OEChem function OEPerceiveSymmetry. 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::OEGetSymmetryClass function.
virtual bool SetType(const std::string &typ) virtual bool SetType(const char *typ)
Set the ``atom type name'' string 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.