Open Babel  3.0
Public Member Functions | Protected Attributes | List of all members
OBPhModel Class Reference

#include <phmodel.h>

Inheritance diagram for OBPhModel:
OBGlobalDataBase

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 ( )
inlinevirtual
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 OBRotorList::Init().

◆ SetReadDirectory()

void SetReadDirectory ( char *  dir)
inlineinherited

Set the directory before calling Init()

◆ SetEnvironmentVariable()

void SetEnvironmentVariable ( char *  var)
inlineinherited

Set the environment variable to use before calling Init()

Member Data Documentation

◆ _init

bool _init
protectedinherited

Whether the data been read already.

◆ _dataptr

const char* _dataptr
protectedinherited

Default data table if file is unreadable.

◆ _filename

std::string _filename
protectedinherited

File to search for.

◆ _dir

std::string _dir
protectedinherited

Data directory for file if _envvar fails.

◆ _subdir

std::string _subdir
protectedinherited

Subdirectory (if using environment variable)

◆ _envvar

std::string _envvar
protectedinherited

Environment variable to check first.


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