Calculation input file section (required)

This required section is denoted by the keyword calculate and includes a list of objects of the type apbs.input_file.calculate.Calculate.

Calculate API

These classes provide input syntax for APBS calculations.

class apbs.input_file.calculate.Calculate(dict_=None, yaml=None, json=None)[source]

Bases: apbs.input_file.InputFile

Specify parameters for APBS calculations.

Objects can be initialized with dictionary/JSON/YAML data with the following keys:

  • alias: A string that allows the output from the calculation to be referenced later.
  • type: A string that indicates the type of calculation to be performed. See calculation_type() for list.
  • parameters: Object with parameters for calculation. See calculation types above for details.
alias

Alias string to refer to this calculation elsewhere.

Raises:TypeError – if not string.
calculation_type

Calculation type.

One of the following:

  • nonpolar: A nonpolar solvation energy calculation using grid-based integrals. See nonpolar.Nonpolar.
Raises:
from_dict(input_)[source]

Load dictionary input into object.

Parameters:input (dict) – data to load into object
Raises:KeyError – if input contents are not found
from_json(input_)

Parse JSON-format input string into this object.

Parameters:input (str) – JSON-format input string
from_yaml(input_)

Parse YAML-format input string into this object.

Parameters:input (str) – YAML-format input string
parameters

Parameter object, dependent on calculation type, sub-classed from apbs.input_file.InputFile.

The format of this object is based on the calculation type; see calculation_type().

Raises:TypeError – if object is not derived from apbs.input_file.InputFile.
to_dict() → dict[source]

Produce dictionary representation of self.

to_json() → str

Produce JSON representation of self.

to_yaml() → str

Produce YAML representation of self.

validate()[source]

Check object for validity.

Raises:ValueError – if invalid content encountered

Generic objects for polar solvation calculations.

This only contains common properties that are complex objects (e.g., not strings, lists, etc.)

class apbs.input_file.calculate.generic.Ion(dict_=None, json=None, yaml=None)[source]

Bases: apbs.input_file.InputFile

Description of a single mobile ion species.

Objects can be initialized with dictionary/JSON/YAML data with the following keys:

charge

The charge (in electrons) of the ion.

Raises:TypeError – if set to something that is not a number
concentration

Concentration (in M) of ion species.

Raises:TypeError – if not a positive number or zero
from_dict(dict_)[source]

Populate object from dictionary.

Raises:KeyError – if dictionary missing information
from_json(input_)

Parse JSON-format input string into this object.

Parameters:input (str) – JSON-format input string
from_yaml(input_)

Parse YAML-format input string into this object.

Parameters:input (str) – YAML-format input string
radius

The radius (in Å) of the ion.

Raises:TypeError – if set to something that is not a positive number
to_dict() → dict[source]

Produce dictionary representation of self.

to_json() → str

Produce JSON representation of self.

to_yaml() → str

Produce YAML representation of self.

validate()[source]

Validate the object.

Raises:ValueError – if object is not valid
class apbs.input_file.calculate.generic.MobileIons(dict_=None, json=None, yaml=None)[source]

Bases: apbs.input_file.InputFile

Provide information about mobile ion species in system.

Objects can be initialized with dictionary/JSON/YAML data with the following keys:

  • species: list of ion species; see species()
from_dict(dict_)[source]

Parse dictionary-format input into this object.

Parameters:input (dict) – input dictionary
Raises:KeyError – when input is missing
from_json(input_)

Parse JSON-format input string into this object.

Parameters:input (str) – JSON-format input string
from_yaml(input_)

Parse YAML-format input string into this object.

Parameters:input (str) – YAML-format input string
species

List of mobile ion species.

Returns:list of Ion objects
Raises:TypeError – if set to something other than a list of Ion objects
to_dict() → dict[source]

Produce dictionary representation of self.

to_json() → str

Produce JSON representation of self.

to_yaml() → str

Produce YAML representation of self.

validate()[source]

Validate the object.

Raises:ValueError – if object is not valid
class apbs.input_file.calculate.generic.UseMap(dict_=None, yaml=None, json=None)[source]

Bases: apbs.input_file.InputFile

Use a previously read in map.

Objects can be initialized with dictionary/JSON/YAML data with the following keys:

  • property: what property being loaded from the map; see property()
  • alias: alias assigned when reading in map; see alias()
from_dict(input_)[source]

Load object from dictionary.

Raises:KeyError – if missing items
from_json(input_)

Parse JSON-format input string into this object.

Parameters:input (str) – JSON-format input string
from_yaml(input_)

Parse YAML-format input string into this object.

Parameters:input (str) – YAML-format input string
property

Specify the property being read from the map.

One of the following values:

  • dielectric: Dielectric function map (as read in Data loading input file section (required)); this causes the FiniteDifference.solute_dielectric(), FiniteDifference.solvent_dielectric(), FiniteDifference.solvent_radius(), FiniteDifference.surface_method(), and FiniteDifference.surface spline window() properties to be ignored, along with the radii of the solute atoms. Note that FiniteDifference.solute_dielectric() and FiniteDifference.solvent_dielectric() are still used for some boundary condition calculations (see FiniteDifference.boundary_condition())
  • ion accessibility: Mobile ion-accessibility function map (as read in Data loading input file section (required)); this causes the FiniteDifference.surface_method(), and FiniteDifference.surface spline window() properties to be ignored, along with the radii of the solute atoms. The FiniteDifference.ions() property is not ignored and will still be used.
  • charge density: Charge distribution map (as read in Data loading input file section (required)); this causes the charge discretization() parameter and the charges of the biomolecular atoms to be ignored when assembling the fixed charge distribution for the Poisson-Boltzmann equation.
  • potential: Potential map (as read in Data loading input file section (required)); this is used to set the boundary condition and causes the boundary_condition() property to be ignored.
Raises:
to_dict() → dict[source]

Produce dictionary representation of self.

to_json() → str

Produce JSON representation of self.

to_yaml() → str

Produce YAML representation of self.

validate()[source]

Validate the object.

Raises:ValueError – if object is not valid
class apbs.input_file.calculate.generic.WriteMap(dict_=None, yaml=None, json=None)[source]

Bases: apbs.input_file.InputFile

Write the specified property to a map.

Objects can be initialized with dictionary/JSON/YAML data with the following keys:

  • property: what property is being written to the map; see property()
  • format: output format; see format()
  • path: a suggested path and file name for the map; see path()
format

Format for writing output.

Allowed formats (see documentation for details) include:

  • dx: OpenDX-format data. This is the preferred format for APBS input/output.
  • dx.gz: GZipped OpenDX-format data.
  • flat: Write out data as a plain text file.
  • uhbd: UHBD-format data.
Raises:
from_dict(input_)[source]

Parse dictionary-format input into this object.

Parameters:input (dict) – input dictionary
Raises:KeyError – when input is missing
from_json(input_)

Parse JSON-format input string into this object.

Parameters:input (str) – JSON-format input string
from_yaml(input_)

Parse YAML-format input string into this object.

Parameters:input (str) – YAML-format input string
path

Suggested path for writing results.

This path is only a suggestion; if parallel calculations are performed, then the filename will be modified to include the processor number for the output.

Raises:TypeError – if not set to string.
property

Property to write to map.

See the documentation for a discussion of units for these properties.

One of:

  • charge density: Write out the biomolecular charge distribution in units of \(e_c\) (electron charge) per Å3.
  • potential: Write out the electrostatic potential over the entire problem domain in units of \(k_b \, T \, e_c^{-1}\).
  • solvent accessibility: Write out the solvent accessibility defined by the molecular surface definition (see FiniteDifference.surface_definition()). Values are unitless and range from 0 (inaccessible) to 1 (accessible).
  • ion accessibility: Write out the inflated van der Waals-based ion accessibility (see FiniteDifference.surface_definition()). Values are unitless and range from 0 (inaccessible) to 1 (accessible).
  • laplacian: Write out the Laplacian of the potential \(\nabla^2 \phi\) in units of kB T ec-1 Å-2.
  • energy density: Write out the “energy density” \(-\nabla \cdot \epsilon \nabla \phi\) in units of kB T ec-1 Å-2.
  • ion number density: Write out the total mobile ion number density for all ion species in units of M. The output is calculated according to the formula (for nonlinear PB calculations): \(\rho(x) = \sum_i^N {\bar{\rho}_i e^{-q_i\phi(x) - V_i (x)}}\), where \(N\) is the number of ion species, \(\bar{\rho}_i\) is the bulk density of ion species \(i\), \(q_i\) is the charge of ion species \(i\), \(\phi(x)\) is the electrostatic potential, and \(V_i\) is the solute-ion interaction potential for species \(i\).
  • ion charge density: Write out the total mobile ion charge density for all ion species in units of ec M. The output is calculated according to the formula (for nonlinear PB calculations): \(\rho(x) = \sum_i^N {\bar{\rho}_i q_i e^{-q_i\phi(x) - V_i(x)}}\), where \(N\) is the number of ion species, \(\bar{\rho}_i\) is the bulk density of ion species \(i\), \(q_i\) is the charge of ion species \(i\), \(\phi(x)\) is the electrostatic potential, and \(V_i\) is the solute-ion interaction potential for species \(i\).
  • dielectric x or dielectric y or dielectric z: Write out the dielectric map shifted by 1/2 grid spacing in the {x, y, z}-direction. The values are unitless.
Raises:
to_dict() → dict[source]

Produce dictionary representation of self.

to_json() → str

Produce JSON representation of self.

to_yaml() → str

Produce YAML representation of self.

validate()[source]

Validate the object.

Raises:ValueError – if object is not valid