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.
Calculation types¶
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.InputFileSpecify 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. Seecalculation_type()for list.parameters: Object with parameters for calculation. See calculation types above for details.
-
calculation_type¶ Calculation type.
One of the following:
nonpolar: A nonpolar solvation energy calculation using grid-based integrals. Seenonpolar.Nonpolar.
Raises: - TypeError – if not a string
- ValueError – if not a recognized calculation type
-
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_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.InputFileDescription of a single mobile ion species.
Objects can be initialized with dictionary/JSON/YAML data with the following keys:
charge: charge of ion; seecharge()radius: radius of ion; seeradius()concentration: concentration of ion species; seeconcentration()
-
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_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.InputFileProvide 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; seespecies()
-
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 IonobjectsRaises: TypeError – if set to something other than a list of Ionobjects
-
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.InputFileUse 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; seeproperty()alias: alias assigned when reading in map; seealias()
-
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 theFiniteDifference.solute_dielectric(),FiniteDifference.solvent_dielectric(),FiniteDifference.solvent_radius(),FiniteDifference.surface_method(), andFiniteDifference.surface spline window()properties to be ignored, along with the radii of the solute atoms. Note thatFiniteDifference.solute_dielectric()andFiniteDifference.solvent_dielectric()are still used for some boundary condition calculations (seeFiniteDifference.boundary_condition())ion accessibility: Mobile ion-accessibility function map (as read in Data loading input file section (required)); this causes theFiniteDifference.surface_method(), andFiniteDifference.surface spline window()properties to be ignored, along with the radii of the solute atoms. TheFiniteDifference.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 thecharge 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 theboundary_condition()property to be ignored.
Raises: - TypeError – if not string
- ValueError – if not valid value
-
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.InputFileWrite 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; seeproperty()format: output format; seeformat()path: a suggested path and file name for the map; seepath()
-
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: - TypeError – if not set to a strinng
- ValueError – if invalid format specified
-
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 (seeFiniteDifference.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 (seeFiniteDifference.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 xordielectric yordielectric z: Write out the dielectric map shifted by 1/2 grid spacing in the {x,y,z}-direction. The values are unitless.
Raises: - TypeError – if not a string
- ValueError – if invalid value
-
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