Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
core::chemical::gasteiger::PossibleAtomTypesForAtom Class Reference

A helper class by which AtomTypes can return all possible atom types for a given atom in a structure that is easily accessed by orbital type. More...

#include <GasteigerAtomTyper.hh>

Inheritance diagram for core::chemical::gasteiger::PossibleAtomTypesForAtom:
Inheritance graph
[legend]

Public Member Functions

 PossibleAtomTypesForAtom ()
 default constructor More...
 
void gasteiger_atom_type_set (GasteigerAtomTypeSetCOP GASTEIGER_ATOM_TYPE_SET)
 
bool CouldHaveHybridization (const GasteigerAtomTypeData::HybridOrbitalType HYBRID) const
 tell whether a particular hybrid orbital type is possible given what we know about this atom More...
 
core::Size GetNumberPossibleTypes () const
 return the number of types that the atom has the potential to become More...
 
GasteigerAtomTypeDataCOP GetMostStableType () const
 return the most stable type More...
 
void AddAtomType (GasteigerAtomTypeDataCOP ATOM_TYPE)
 add an atom type to be considered More...
 
void SetToType (GasteigerAtomTypeDataCOP ATOM_TYPE)
 set this object to only consider the given atom type More...
 
void Finalize (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD)
 set the final type based on the given atom and smallest ring size More...
 
core::Size hybridization_rank (GasteigerAtomTypeData::HybridOrbitalType const hybrid)
 
void RemoveHybridization (const GasteigerAtomTypeData::HybridOrbitalType HYBRID)
 remove a particular hybrid orbital type from the possible types, unless that would remove all possibilities More...
 
void AddAromaticAtomType (GasteigerAtomTypeDataCOP ATOM_TYPE, const int DESIRED_CHARGE)
 add an atom type to the search using a set of rules for atom types in aromatic rings More...
 
void Finalize ()
 Select the best choice for the atom type wherever possible. More...
 
void FinalizeUnhybridized ()
 choose the preferred atom type (using VSEPR theory) assuming that the orbitals do not hybridize More...
 
void FinalizeAromatic (const int DESIRED_CHARGE)
 only keep the most stable types for the atom that span the set of desired pi orbital electrons (0-2) More...
 
void FinalizeNitrogenTwoSingle (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD)
 choose the final atom type for Nitrogen with two single bonds More...
 
void FinalizeNitrogenSingleDouble (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD)
 choose the final atom type for a nitrogen with a single and a double bond More...
 
void FinalizeNitrogenThreeSingle (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD)
 choose the final atom type for Nitrogen with three single bonds More...
 
void FinalizeOxygenTwoSingle (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD)
 choose the final atom type for Oxygen with two single bonds More...
 
void FinalizeOxygenSingleDouble (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD)
 choose the final atom type for Oxygen with a single and a double bond More...
 
void FinalizeOxygenThreeSingle (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD)
 choose the final atom type for Oxygen with three single bonds More...
 
bool IsUnsaturated (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD) const
 test whether a particular atom is unsaturated, without relying on atom types having already been set More...
 
core::Size CountUnsaturatedNeighbors (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD) const
 count unsaturated neighbors More...
 
bool IsBondedToAHalogen (const core::chemical::RealResidueGraph &graph, const core::chemical::RealResidueVD &atomVD) const
 test whether atom is bonded to any halogens More...
 

Static Public Member Functions

static PossibleAtomTypesForAtom FindPossibleAtomTypesForAtom (GasteigerAtomTypeSetCOP GASTEIGER_ATOM_TYPE_SET, const Element &ELEMENT, const core::Size NUMBER_ELECTRONS_IN_BONDS, const core::Size NUMBER_BONDS, const int SUSPECTED_CHARGE, const bool IN_AROMATIC_RING)
 constructor from the known information about the atom More...
 

Static Private Member Functions

static std::map< std::string,
PossibleAtomTypesForAtom
CreateAtomicEnvironmentToTypesMap (const bool IN_AROMATIC_RING, GasteigerAtomTypeSetCOP GASTEIGER_ATOM_TYPE_SET)
 Create the map from atom environment string to possible atom types. More...
 

Private Attributes

GasteigerAtomTypeSetCOP gasteiger_atom_type_set_
 < Number of atom types with each hybridization More...
 
std::map< std::string,
PossibleAtomTypesForAtom
s_atomic_env_outside_arom_ring_to_types_map
 
std::map< std::string,
PossibleAtomTypesForAtom
s_element_bonds_in_arom_ring_to_types_map
 
utility::vector0< core::Sizem_NumberAtomTypesWithHybridization
 
std::list
< GasteigerAtomTypeDataCOP
m_AtomTypesByDecreasingStability
 Most stable types first. More...
 
core::Size m_NumberConjugatedTypes
 Number of conjugated types in the list. More...
 
void(PossibleAtomTypesForAtom::* m_FinalizeFunction )(core::chemical::RealResidueGraph const &, core::chemical::RealResidueVD const &)
 

Detailed Description

A helper class by which AtomTypes can return all possible atom types for a given atom in a structure that is easily accessed by orbital type.

See also
example_chemistry_possible_atom_types_for_atom.cpp
Author
mendenjl
Date
Aug 27, 2010

Constructor & Destructor Documentation

core::chemical::gasteiger::PossibleAtomTypesForAtom::PossibleAtomTypesForAtom ( )

default constructor

Member Function Documentation

void core::chemical::gasteiger::PossibleAtomTypesForAtom::AddAromaticAtomType ( GasteigerAtomTypeDataCOP  ATOM_TYPE,
const int  DESIRED_CHARGE 
)

add an atom type to the search using a set of rules for atom types in aromatic rings

Parameters
ATOM_TYPEthe type of atom to consider
DESIRED_CHARGEthe charge desired The atom type will be ordered using the distance from the desired charge as the first sort key, second by the stability. Unlike AddAtomType, AddAromaticAtomType always adds the type to the considered list

References hybridization_rank(), m_AtomTypesByDecreasingStability, m_NumberAtomTypesWithHybridization, and m_NumberConjugatedTypes.

void core::chemical::gasteiger::PossibleAtomTypesForAtom::AddAtomType ( GasteigerAtomTypeDataCOP  ATOM_TYPE)
bool core::chemical::gasteiger::PossibleAtomTypesForAtom::CouldHaveHybridization ( const GasteigerAtomTypeData::HybridOrbitalType  HYBRID) const

tell whether a particular hybrid orbital type is possible given what we know about this atom

Parameters
HYBRIDthe type of hybrid orbital
Returns
true iff there is a possible atom type for that hybrid orbital

References m_NumberAtomTypesWithHybridization.

Referenced by AddAtomType().

core::Size core::chemical::gasteiger::PossibleAtomTypesForAtom::CountUnsaturatedNeighbors ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
) const

count unsaturated neighbors

Returns
the number of unsaturated neighbors around ATOM
Parameters
ATOMthe atom of interest
Returns
the number of unsaturated neighbors around ATOM

Virtual atoms are treated like ordinary atoms.

References IsUnsaturated().

Referenced by FinalizeNitrogenThreeSingle(), and FinalizeOxygenTwoSingle().

std::map< std::string, PossibleAtomTypesForAtom > core::chemical::gasteiger::PossibleAtomTypesForAtom::CreateAtomicEnvironmentToTypesMap ( const bool  IN_AROMATIC_RING,
GasteigerAtomTypeSetCOP  GASTEIGER_ATOM_TYPE_SET 
)
staticprivate

Create the map from atom environment string to possible atom types.

store the atomic environment for each atom type in a map for fast lookup when determining atom types

Parameters
IN_AROMATIC_RINGwhether to only include types that could be in an aromatic ring

References core::id::to_string(), core::chemical::gasteiger::TR(), and core::chemical::gasteiger::GasteigerAtomTypeData::Unhybridized.

void core::chemical::gasteiger::PossibleAtomTypesForAtom::Finalize ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
)

set the final type based on the given atom and smallest ring size

Parameters
ATOMthe atom of interest
SMALLEST_RING_SIZEthe size of the smallest ring this atom is part of

References m_FinalizeFunction.

void core::chemical::gasteiger::PossibleAtomTypesForAtom::Finalize ( )
void core::chemical::gasteiger::PossibleAtomTypesForAtom::FinalizeAromatic ( const int  DESIRED_CHARGE)

only keep the most stable types for the atom that span the set of desired pi orbital electrons (0-2)

Parameters
DESIRED_CHARGEthe preferred charge used during construction of the maps when there is no part of standardization that should edit this class

References hybridization_rank(), m_AtomTypesByDecreasingStability, m_NumberConjugatedTypes, and core::chemical::gasteiger::GasteigerAtomTypeData::ZeroOrTwo.

void core::chemical::gasteiger::PossibleAtomTypesForAtom::FinalizeNitrogenSingleDouble ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
)

choose the final atom type for a nitrogen with a single and a double bond

choose the final atom type for a single and a double bond

Parameters
ATOMthe atom of interest
SMALLEST_RING_SIZEthe size of the smallest ring this atom is part of

References gasteiger_atom_type_set_, and SetToType().

Referenced by Finalize().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::FinalizeNitrogenThreeSingle ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
)

choose the final atom type for Nitrogen with three single bonds

References core::chemical::element::C, CountUnsaturatedNeighbors(), gasteiger_atom_type_set_, IsBondedToAHalogen(), core::chemical::element::O, and SetToType().

Referenced by Finalize().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::FinalizeNitrogenTwoSingle ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
)

choose the final atom type for Nitrogen with two single bonds

References gasteiger_atom_type_set_, core::chemical::element::N, core::chemical::element::S, and SetToType().

Referenced by Finalize().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::FinalizeOxygenSingleDouble ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
)

choose the final atom type for Oxygen with a single and a double bond

Parameters
ATOMthe atom of interest
SMALLEST_RING_SIZEthe size of the smallest ring this atom is part of

References gasteiger_atom_type_set_, and SetToType().

Referenced by Finalize().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::FinalizeOxygenThreeSingle ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
)

choose the final atom type for Oxygen with three single bonds

References gasteiger_atom_type_set_, and SetToType().

Referenced by Finalize().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::FinalizeOxygenTwoSingle ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
)

choose the final atom type for Oxygen with two single bonds

Parameters
ATOMthe atom of interest
SMALLEST_RING_SIZEthe size of the smallest ring this atom is part of

References core::chemical::element::C, CountUnsaturatedNeighbors(), gasteiger_atom_type_set_, core::chemical::element::H, core::chemical::IsAromaticBond, IsUnsaturated(), core::chemical::element::N, core::chemical::element::O, core::chemical::element::S, SetToType(), and core::chemical::element::Si.

Referenced by Finalize().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::FinalizeUnhybridized ( )

choose the preferred atom type (using VSEPR theory) assuming that the orbitals do not hybridize

This is used for elements in group 1, 2, & 7, which do hybridize in the gasteiger scheme

References m_AtomTypesByDecreasingStability, RemoveHybridization(), SetToType(), core::chemical::gasteiger::GasteigerAtomTypeData::SP, core::chemical::gasteiger::GasteigerAtomTypeData::SP2, core::chemical::gasteiger::GasteigerAtomTypeData::SP3, and core::id::swap().

Referenced by Finalize().

PossibleAtomTypesForAtom core::chemical::gasteiger::PossibleAtomTypesForAtom::FindPossibleAtomTypesForAtom ( GasteigerAtomTypeSetCOP  gasteiger_atom_type_set,
const Element ELEMENT,
const core::Size  NUMBER_ELECTRONS_IN_BONDS,
const core::Size  NUMBER_BONDS,
const int  SUSPECTED_CHARGE,
const bool  IN_AROMATIC_RING 
)
static

constructor from the known information about the atom

Parameters
ELEMENTelement type,
NUMBER_ELECTRONS_IN_BONDSnumber of electrons in bonds for the atom type
NUMBER_BONDSnumber of bonds for the atom
SUSPECTED_CHARGE;expected charge, ignored if no atom type matching the other criteria if found
IN_AROMATIC_RINGtrue iff the atom has bonds of the aromatic unspecified type
ELEMENTelement type,
NUMBER_ELECTRONS_IN_BONDSnumber of electrons in bonds for the atom type; for atom in declared aromatic environment, number of exocyclic bonds
NUMBER_BONDSnumber of bonds for the atom
SUSPECTED_CHARGE;expected charge, ignored if no atom type matching the other criteria if found
IN_AROMATIC_RINGtrue iff the atom has bonds of the aromatic unspecified type

References core::chemical::Element::get_chemical_name(), core::chemical::Element::get_chemical_symbol(), core::id::to_string(), and core::chemical::gasteiger::TR().

Referenced by core::chemical::gasteiger::GetPossibleTypesForAtom().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::gasteiger_atom_type_set ( GasteigerAtomTypeSetCOP  GASTEIGER_ATOM_TYPE_SET)
GasteigerAtomTypeDataCOP core::chemical::gasteiger::PossibleAtomTypesForAtom::GetMostStableType ( ) const

return the most stable type

Returns
the most stable type - NULL if no such type exists

References m_AtomTypesByDecreasingStability.

Referenced by core::chemical::gasteiger::assign_gasteiger_atom_types(), and Finalize().

core::Size core::chemical::gasteiger::PossibleAtomTypesForAtom::GetNumberPossibleTypes ( ) const

return the number of types that the atom has the potential to become

Returns
the number of types that the atom has the potential to become

References m_AtomTypesByDecreasingStability.

Referenced by RemoveHybridization().

core::Size core::chemical::gasteiger::PossibleAtomTypesForAtom::hybridization_rank ( GasteigerAtomTypeData::HybridOrbitalType const  hybrid)
bool core::chemical::gasteiger::PossibleAtomTypesForAtom::IsBondedToAHalogen ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
) const

test whether atom is bonded to any halogens

Parameters
ATOMthe atom of interest
Returns
true if the atom is bonded to any halogens

Referenced by FinalizeNitrogenThreeSingle().

bool core::chemical::gasteiger::PossibleAtomTypesForAtom::IsUnsaturated ( const core::chemical::RealResidueGraph graph,
const core::chemical::RealResidueVD atomVD 
) const

test whether a particular atom is unsaturated, without relying on atom types having already been set

test whether a particular atom is unsaturated

Returns
true if atom has no A. unsaturated bonds or B. is part of an aromatic ring or C. has empty orbitals
true if atom has no A. unsaturated bonds or B. is part of an aromatic ring or C. has empty orbitals

Virtual atoms are treated like ordinary atoms.

References core::chemical::DoubleBondOrder, core::chemical::IsAromaticBond, protocols::forge::methods::order(), and core::chemical::TripleBondOrder.

Referenced by CountUnsaturatedNeighbors(), and FinalizeOxygenTwoSingle().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::RemoveHybridization ( const GasteigerAtomTypeData::HybridOrbitalType  HYBRID)

remove a particular hybrid orbital type from the possible types, unless that would remove all possibilities

Parameters
HYBRIDthe type of hybrid orbital to remove

References GetNumberPossibleTypes(), m_AtomTypesByDecreasingStability, m_NumberAtomTypesWithHybridization, and m_NumberConjugatedTypes.

Referenced by Finalize(), and FinalizeUnhybridized().

void core::chemical::gasteiger::PossibleAtomTypesForAtom::SetToType ( GasteigerAtomTypeDataCOP  ATOM_TYPE)

Member Data Documentation

GasteigerAtomTypeSetCOP core::chemical::gasteiger::PossibleAtomTypesForAtom::gasteiger_atom_type_set_
private
std::list< GasteigerAtomTypeDataCOP > core::chemical::gasteiger::PossibleAtomTypesForAtom::m_AtomTypesByDecreasingStability
private
void( PossibleAtomTypesForAtom::* core::chemical::gasteiger::PossibleAtomTypesForAtom::m_FinalizeFunction)(core::chemical::RealResidueGraph const &, core::chemical::RealResidueVD const &)
private

Function used to resolve the final atom type; only used in a few ambiguous cases such as trigonal vs. tetrahedral nitrogen with 3 bonds, otherwise NULL Parameters are

  1. the atom
  2. the size of the smallest ring that this atom is part of

Referenced by Finalize(), and SetToType().

utility::vector0< core::Size > core::chemical::gasteiger::PossibleAtomTypesForAtom::m_NumberAtomTypesWithHybridization
private
core::Size core::chemical::gasteiger::PossibleAtomTypesForAtom::m_NumberConjugatedTypes
private

Number of conjugated types in the list.

Referenced by AddAromaticAtomType(), AddAtomType(), FinalizeAromatic(), RemoveHybridization(), and SetToType().

std::map< std::string, PossibleAtomTypesForAtom> core::chemical::gasteiger::PossibleAtomTypesForAtom::s_atomic_env_outside_arom_ring_to_types_map
private
std::map< std::string, PossibleAtomTypesForAtom> core::chemical::gasteiger::PossibleAtomTypesForAtom::s_element_bonds_in_arom_ring_to_types_map
private

The documentation for this class was generated from the following files: