Loading...
Searching...
No Matches
OBPhModel Class Reference

`#include <phmodel.h>`

Inheritance diagram for OBPhModel:
[legend]

## Public Member Functions

| OBPhModel ()
| ~OBPhModel ()
void | ParseLine (const char *)
size_t | GetSize ()
void | AssignSeedPartialCharge (OBMol &)
void | CorrectForPH (OBMol &, double pH=7.4)
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

## Detailed Description

Corrections for pH used by OBMol::CorrectForPH().

The data/phmodel.txt file contains transformations which are applied to correct the charges for a given pH. This function uses the Henderson-Hasselbalch equation to calculate which species (protonated/ unprotonated) is present in the highest concentration at the given pH.

For acids an entry would look like:

# carboxylic acid
O=C[OD1:1] >> O=C[O-:1] 4.0

The 4.0 is the pKa for the dissociation [HA] -> [H+] + [A-]. To calculate [HA]/[A-] we use:

[HA] / [A-] = 10^(pKa - pH)
[HA]/[A-] > 1 : [HA] > [A-]
[HA]/[A-] < 1 : [A-] > [HA]

For a base, an entry would look be:

# methyl amine
C[N:1] >> C[N+:1] 10.7

Here, the 10.7 is the pKa for the dissociation [BH+] -> [H+] + [B:]. To calculate [BH+]/[B:] we use:

[BH+] / [B:] = 10^(pKa - pH)
[BH+]/[B:] > 1 : [BH+] > [B:]
[BH+]/[B:] < 1 : [B:] > [BH+]

The transformations are all applied (if needed at the specified pH value) in the same order they are found in data/phmodel.txt.

## Constructor & Destructor Documentation

## OBPhModel()

OBPhModel | ( |  | ) |

## ~OBPhModel()

~OBPhModel | ( |  | ) |

## Member Function Documentation

## ParseLine()

void ParseLine | ( | const char * |  | ) |

virtual

Specified by particular table classes (parses an individual data line).

Reimplemented from OBGlobalDataBase.

## GetSize()

size_t GetSize | ( |  | ) |

inline virtual

Returns
  the number of chemical transformations

Reimplemented from OBGlobalDataBase.

## AssignSeedPartialCharge()

void AssignSeedPartialCharge | ( | OBMol & | mol | ) |

## CorrectForPH()

void CorrectForPH | ( | OBMol & | mol,
|  | double | pH = 7.4 )

## Init()

void Init | ( |  | ) |

inherited

Read in the data file, falling back as needed.

Referenced by OBResidueData::AssignBonds(), OBBondTyper::AssignFunctionalGroupBonds(), OBAtomTyper::AssignHyb(), OBPhModel::AssignSeedPartialCharge(), OBAtomTyper::AssignTypes(), OBRingTyper::AssignTypes(), OBPhModel::CorrectForPH(), OBTypeTable::GetFromType(), OBRotorRules::GetRotorIncrements(), OBTypeTable::GetToType(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBTypeTable::SetFromType(), OBResidueData::SetResName(), OBTypeTable::SetToType(), OBTypeTable::Translate(), OBTypeTable::Translate(), and OBTypeTable::Translate().

## SetReadDirectory()

void SetReadDirectory | ( | char * | dir | ) |

inline inherited

Set the directory before calling Init().

## SetEnvironmentVariable()

void SetEnvironmentVariable | ( | char * | var | ) |

inline inherited

Set the environment variable to use before calling Init().

## Member Data Documentation

## _init

bool _init

protected inherited

Whether the data been read already.

Referenced by OBResidueData::AssignBonds(), OBBondTyper::AssignFunctionalGroupBonds(), OBAtomTyper::AssignHyb(), OBPhModel::AssignSeedPartialCharge(), OBAtomTyper::AssignTypes(), OBRingTyper::AssignTypes(), OBPhModel::CorrectForPH(), OBTypeTable::GetFromType(), OBRotorRules::GetRotorIncrements(), OBTypeTable::GetToType(), Init(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBGlobalDataBase(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), OBTypeTable::SetFromType(), OBResidueData::SetResName(), OBTypeTable::SetToType(), OBTypeTable::Translate(), OBTypeTable::Translate(), and OBTypeTable::Translate().

## _dataptr

const char* _dataptr

protected inherited

Default data table if file is unreadable.

Referenced by Init(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBGlobalDataBase(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().

## _filename

std::string _filename

protected inherited

File to search for.

Referenced by Init(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), and OBRotorRules::SetFilename().

## _dir

std::string _dir

protected inherited

Data directory for file if _envvar fails.

Referenced by OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), and SetReadDirectory().

## _subdir

std::string _subdir

protected inherited

Subdirectory (if using environment variable).

Referenced by Init(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().

## _envvar

std::string _envvar

protected inherited

Environment variable to check first.

Referenced by Init(), OBAtomicHeatOfFormationTable::OBAtomicHeatOfFormationTable(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), and SetEnvironmentVariable().

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

- phmodel.h
- phmodel.cpp