#include <openbabel/data.h>
Public Member Functions | |
OBElementTable (void) | |
~OBElementTable () | |
void | ParseLine (const char *) |
unsigned int | GetNumberOfElements () |
unsigned int | GetSize () |
int | GetAtomicNum (const char *) |
int | GetAtomicNum (const char *, int &iso) |
const char * | GetSymbol (int) |
double | GetVdwRad (int) |
double | GetCovalentRad (int) |
double | GetMass (int) |
double | CorrectedBondRad (int, int=3) |
double | CorrectedVdwRad (int, int=3) |
int | GetMaxBonds (int) |
double | GetElectroNeg (int) |
double | GetAllredRochowElectroNeg (int) |
double | GetIonization (int) |
double | GetElectronAffinity (int) |
std::vector< double > | GetRGB (int) |
std::string | GetName (int) |
void | Init () |
void | SetReadDirectory (char *dir) |
void | SetEnvironmentVariable (char *var) |
Protected Attributes | |
bool | _init |
const char * | _dataptr |
std::string | _filename |
std::string | _dir |
std::string | _subdir |
std::string | _envvar |
Translating element data is a common task given that many file formats give either element symbol or atomic number information, but not both. The OBElementTable class facilitates conversion between textual and numeric element information. An instance of the OBElementTable class (etab) is declared as external in data.cpp. Source files that include the header file mol.h automatically have an extern definition to etab. The following code sample demonstrates the use of the OBElementTable class:
cout << "The symbol for element 6 is " << etab.GetSymbol(6) << endl; cout << "The atomic number for Sulfur is " << etab.GetAtomicNum(16) << endl; cout << "The van der Waal radius for Nitrogen is " << etab.GetVdwRad(7);
Stored information in the OBElementTable includes elemental:
OBElementTable | ( | void | ) |
~OBElementTable | ( | ) |
void ParseLine | ( | const char * | ) | [virtual] |
Specified by particular table classes (parses an individual data line).
Reimplemented from OBGlobalDataBase.
unsigned int GetNumberOfElements | ( | ) |
unsigned int GetSize | ( | ) | [inline, virtual] |
int GetAtomicNum | ( | const char * | sym | ) |
int GetAtomicNum | ( | const char * | sym, | |
int & | iso | |||
) |
const char * GetSymbol | ( | int | atomicnum | ) |
Referenced by OpenBabel::CalculateSymmetry(), and OBMol::GetSpacedFormula().
double GetVdwRad | ( | int | atomicnum | ) |
double GetCovalentRad | ( | int | atomicnum | ) |
double GetMass | ( | int | atomicnum | ) |
Referenced by OBAtom::GetAtomicMass(), and OBMol::GetMolWt().
double CorrectedBondRad | ( | int | atomicnum, | |
int | hyb = 3 | |||
) |
Referenced by OBMol::AddHydrogens(), OBBond::GetEquibLength(), OBAtom::HtoMethyl(), and OBAtom::SetHybAndGeom().
double CorrectedVdwRad | ( | int | atomicnum, | |
int | hyb = 3 | |||
) |
int GetMaxBonds | ( | int | atomicnum | ) |
Referenced by OBMol::ConnectTheDots(), and OBMol::PerceiveBondOrders().
double GetElectroNeg | ( | int | atomicnum | ) |
double GetAllredRochowElectroNeg | ( | int | atomicnum | ) |
double GetIonization | ( | int | atomicnum | ) |
double GetElectronAffinity | ( | int | atomicnum | ) |
vector< double > GetRGB | ( | int | atomicnum | ) |
string GetName | ( | int | atomicnum | ) |
void Init | ( | ) | [inherited] |
Read in the data file, falling back as needed.
Referenced by OBAromaticTyper::AssignAromaticFlags(), OBResidueData::AssignBonds(), OBBondTyper::AssignFunctionalGroupBonds(), OBAtomTyper::AssignHyb(), OBAtomTyper::AssignImplicitValence(), OBPhModel::AssignSeedPartialCharge(), OBRingTyper::AssignTypes(), OBAtomTyper::AssignTypes(), OBAtomTyper::CorrectAromaticNitrogens(), OBElementTable::CorrectedBondRad(), OBElementTable::CorrectedVdwRad(), OBPhModel::CorrectForPH(), OBElementTable::GetAllredRochowElectroNeg(), OBElementTable::GetAtomicNum(), OBElementTable::GetCovalentRad(), OBElementTable::GetElectronAffinity(), OBElementTable::GetElectroNeg(), OBIsotopeTable::GetExactMass(), OBTypeTable::GetFromType(), OBElementTable::GetIonization(), OBElementTable::GetMass(), OBElementTable::GetMaxBonds(), OBElementTable::GetName(), OBElementTable::GetNumberOfElements(), OBElementTable::GetRGB(), OBRotorRules::GetRotorIncrements(), OBElementTable::GetSymbol(), OBTypeTable::GetToType(), OBElementTable::GetVdwRad(), OBTypeTable::SetFromType(), OBResidueData::SetResName(), OBTypeTable::SetToType(), and OBTypeTable::Translate().
void SetReadDirectory | ( | char * | dir | ) | [inline, inherited] |
Set the directory before calling Init().
void SetEnvironmentVariable | ( | char * | var | ) | [inline, inherited] |
Set the environment variable to use before calling Init().
bool _init [protected, inherited] |
Whether the data been read already.
Referenced by OBAromaticTyper::AssignAromaticFlags(), OBResidueData::AssignBonds(), OBBondTyper::AssignFunctionalGroupBonds(), OBAtomTyper::AssignHyb(), OBAtomTyper::AssignImplicitValence(), OBPhModel::AssignSeedPartialCharge(), OBRingTyper::AssignTypes(), OBAtomTyper::AssignTypes(), OBAtomTyper::CorrectAromaticNitrogens(), OBElementTable::CorrectedBondRad(), OBElementTable::CorrectedVdwRad(), OBPhModel::CorrectForPH(), OBElementTable::GetAllredRochowElectroNeg(), OBElementTable::GetAtomicNum(), OBElementTable::GetCovalentRad(), OBElementTable::GetElectronAffinity(), OBElementTable::GetElectroNeg(), OBIsotopeTable::GetExactMass(), OBTypeTable::GetFromType(), OBElementTable::GetIonization(), OBElementTable::GetMass(), OBElementTable::GetMaxBonds(), OBElementTable::GetName(), OBElementTable::GetNumberOfElements(), OBElementTable::GetRGB(), OBRotorRules::GetRotorIncrements(), OBElementTable::GetSymbol(), OBTypeTable::GetToType(), OBElementTable::GetVdwRad(), OBGlobalDataBase::Init(), OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), OBTypeTable::SetFromType(), OBResidueData::SetResName(), OBTypeTable::SetToType(), and OBTypeTable::Translate().
const char* _dataptr [protected, inherited] |
Default data table if file is unreadable.
Referenced by OBGlobalDataBase::Init(), OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
std::string _filename [protected, inherited] |
File to search for.
Referenced by OBGlobalDataBase::Init(), OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
std::string _dir [protected, inherited] |
Data directory for file if _envvar fails.
Referenced by OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
std::string _subdir [protected, inherited] |
Subdirectory (if using environment variable).
Referenced by OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
std::string _envvar [protected, inherited] |
Environment variable to check first.
Referenced by OBGlobalDataBase::Init(), OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().