mmtbx.ions package

Subpackages

Submodules

Module contents

This package is used to model elemental ions in crystal structures. It handles both identification and building of ions, but relies on the solvent module to flag candidate sites for screening.

Notes

class mmtbx.ions.atom_type_flags(name)

Bases: object

Simple container for information about the identity of an atom via a set of enumerated boolean flags. The responsibility for toggling these flags based on analysis of the site is left to external code.

Parameters:

name (element symbol or HOH)

Examples

>>> flags = atom_type_flags("HOH")
>>> if (fofc_map_value > 3.0):
...   flags.high_fofc = True
bad_coord_atom
bad_coord_residue
bad_geom
bad_halide
bad_valence
bad_vectors
close_contact
coord_geom
flag_names_and_labels = [('low_b_iso', 'Abnormally low B-factor'), ('high_occ', 'Abnormally high occupancy'), ('high_fofc', 'mFo-DFc peak'), ('high_two_fofc', 'Abnormally high 2mFo-DFc map value'), ('high_anom', 'Anomalous map peak'), ('high_fdp', "Abnormally high refined f''"), ('high_b_iso', 'Abnormally high B-factor'), ('low_occ', 'Abnormally low occupancy'), ('low_two_fofc', 'Low 2mFo-DFc map value'), ('low_fofc', 'mFo-DFc hole'), ('low_anom', 'Poor anomalous map value'), ('low_fdp', "Abnormally low refined f''"), ('bad_geom', 'Unexpected coordination geometry'), ('missing_geom', 'No recognizable coordination geometry'), ('bad_vectors', 'Bad coordination vectors'), ('bad_valence', 'Bad bond valence sum'), ('too_few_non_waters', 'Too few non-water coordinating atoms'), ('too_few_coord', 'Too few coordinating atoms'), ('too_many_coord', 'Too many coordinating atoms'), ('like_coord', 'Coordinating atom of same charge'), ('bad_coord_atom', 'Disallowed or unusual coordinating atom'), ('bad_coord_residue', 'Disallowed or unusual coordinating residue'), ('very_bad_valence', 'Very bad bond valence sum'), ('bad_halide', 'Poor halide site'), ('coord_geom', 'Appears to be coordinating another site with distinct geometry'), ('close_contact', 'Unusually close contact to oxygen atom')]
get_flag_captions()

Retrieve a list of strings describing the issues that have been identified. These will have ‘+++’ or ‘—’ appended if they indicate that the actual element is heavier or lighter than the current refined scatterer type.

high_anom
high_b_iso
high_fdp
high_fofc
high_occ
high_two_fofc
like_coord
low_anom
low_b_iso
low_fdp
low_fofc
low_occ
low_two_fofc
missing_geom
name
show(out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, prefix='')

Print out a list of all issues that have been identified.

too_few_coord
too_few_non_waters
too_many_coord
very_bad_valence
mmtbx.ions.check_supported(elements)

Checks if elements are supported by ion identitication process.

Parameters:

elements (list of str)

Return type:

bool

Raises:

libtbx.utils.Sorry

Examples

>>> from mmtbx.ions import check_supported
>>> check_supported(["CA", "ZN", "FE"])
True
class mmtbx.ions.metal_parameters(**keyword_arguments)

Bases: group_args

charge_as_int()

Gets the charge of a parameter as an integer.

Return type:

int

scattering_type()

Makes a string showing the element and its associated charge. Note that this format is slightly different from the __str__ method, which puts the +/- between the element symbol and the charge number.

Return type:

str

Examples

>>> from mmtbx.ions import metal_parameters
>>> print metal_parameters(element="FE", charge=3)
FE+3
>>> print metal_parameters(element="FE", charge=3).scattering_type()
FE3+
>>> print metal_parameters(element="CL", charge=-1).scattering_type()
CL1-
class mmtbx.ions.parameter_server

Bases: slots_getstate_setstate

Class for retrieving information from ion_parameters.cif

params
Type:

iotbx.cif.model.block

calculate_valence(ion, donor, distance)

Calculates the single valence contribution of one ion donor pair, separated by distance. ion and donor should be AtomGuess objects.

Parameters:
Return type:

float

Examples

>>> from mmtbx.ions import server, metal_parameters
>>> ion = server.get_metal_parameters("ZN")
>>> donor = metal_parameters(element="N", charge="-3")
>>> valence = server.calculate_valence(ion, donor, 2.20)
>>> print round(valence, 2)
0.31
calculate_valences(ion, nearby_atoms)

Calculates all of the valence contributions between ion and each atom of nearby_atoms, each element of which should be a tuple of an atom and a vector from the ion’s location.

Parameters:
Returns:

List of vectors, whose magnitudes are equal to the valence contributions from each donor atom.

Return type:

list of scitbx.matrix.rec

Examples

>>> from libtbx import group_args
>>> from iotbx.pdb.hierarchy import atom
>>> from mmtbx.ions import server
>>> from mmtbx.ions.environment import atom_contact
>>> from scitbx.matrix import rec
>>> ion = server.get_metal_parameters("ZN")
>>> vector_1 = rec([2.0, 0, 0], [1, 3])
>>> vector_2 = rec([-2.0, 0, 0], [1, 3])
>>> vector_3 = rec([0, 2.0, 0], [1, 3])
>>> vector_4 = rec([0, 0, 2.0], [1, 3])
>>> atom_dummy = atom()
>>> atom_dummy.element = "N"
>>> atom_dummy.charge = "-3"
>>> atom_dummy.occ = 1
>>> atom_dummy.parent = lambda: group_args(atoms=lambda: [])
>>> donors = [atom_contact(atom_dummy, vector_1, None, None),
...           atom_contact(atom_dummy, vector_2, None, None),
...           atom_contact(atom_dummy, vector_3, None, None),
...           atom_contact(atom_dummy, vector_4, None, None)]
>>> vectors = server.calculate_valences(ion, donors)
>>> bvs = sum(abs(i) for i in vectors)
>>> print round(bvs, 2)
2.15
get_charge(atom)

Gets the charge associated with an atom or element.

Parameters:

atom (iotbx.pdb.hierarchy.atom or str)

Return type:

int

Examples

>>> from iotbx.pdb.hierarchy import atom
>>> from mmtbx.ions import server
>>> atom_dummy = atom()
>>> atom_dummy.element = "N"
>>> atom_dummy.charge = "-3"
>>> print server.get_charge(atom_dummy)
-3
>>> print server.get_charge("N")
-3
get_charges(atom)

Retrieves all charges that are expected to be associated with an atom or element within ion_parameters.cif. This list is manually updated based on the ligand IDs listed by the PDB.

Parameters:

atom (iotbx.pdb.hierarchy.atom or str)

Return type:

list of int

Examples

>>> from mmtbx.ions import server
>>> print server.get_charges("CU")
[1, 2, 3]
>>> print server.get_charges("ZN")
[2]
get_element(atom)

Gets the element associated with an atom.

Parameters:

atom (iotbx.pdb.hierarchy.atom or str)

Return type:

str

get_metal_parameters(element)

Gets all metal parameters associated with an element.

Parameters:

element (str)

Return type:

mmtbx.ions.metal_parameters or None

get_valence_params(atom1, atom2)

Gets the valence parameters (r_0 and b) used for calculating valences from bond distances.

Parameters:
Returns:

  • float or None – r_0 in the equation exp((r - r_0) / b)

  • float or None – b in the equation exp((r - r_0) / b)

Examples

>>> from mmtbx.ions import server, metal_parameters
>>> zn_params = metal_parameters(element="ZN", charge=2)
>>> n_params = metal_parameters(element="N", charge=-3)
>>> print server.get_valence_params(zn_params, n_params)
(1.77, 0.37)
is_supported_donor(symbol)

Checks if an element is a supported donor atom.

Parameters:

symbol (str)

Return type:

bool

is_supported_element(symbol)

Checks if symbol is a supported element by this parameter server.

Parameters:

symbol (str)

Return type:

bool

params