fast_forward.hydrogen module

Module to reconstruct hydrogens from a group of atoms. Most of this comes from buildh.readthedocs.io and is proted to be compatible with the vermouth way of handling molecules.

fast_forward.hydrogen.find_any_bonded_neighbor(atom, bonded_graph, black_list)[source]

Find any bonded neighbor of atomgroup.

Parameters:
  • atomgroup (AtomGroup) – atom-group of single atom

  • attributes (dict) – a dict of attributes the atom has to full-fill only string attributes are allowed

Returns:

atomgroup of bonded neighbor

Return type:

AtomGroup

fast_forward.hydrogen.find_helper_atoms(universe, atom, carbon_type, bonded_graph)[source]

Given a carbon-type find all helper atoms needed in the reconstruction of the coordinates.

fast_forward.hydrogen.get_CH(atom, helper1, helper2, helper3)[source]

Reconstruct the unique hydrogen of a sp3 carbon.

Parameters:
  • atom (ndarray) – Central atom on which we want to reconstruct the hydrogen.

  • helper1 (ndarray) – First neighbor of central atom.

  • helper2 (ndarray) – Second neighbor of central atom.

  • helper3 (ndarray) – Third neighbor of central atom.

Returns:

Coordinates of the rebuilt hydrogen: ([x_H, y_H, z_H]).

Return type:

ndarray

fast_forward.hydrogen.get_CH2(atom, helper1, helper2)[source]

Reconstruct the 2 hydrogens of a sp3 carbon (methylene group).

Parameters:
  • atom (ndarray) – Central atom on which we want to reconstruct hydrogens.

  • helper1 (ndarray) – Heavy atom before central atom.

  • helper2 (ndarray) – Heavy atom after central atom.

Returns:

tupple of ndarray Coordinates of the two hydrogens: ([x_H1, y_H1, z_H1], [x_H2, y_H2, z_H2]).

Return type:

tuple

fast_forward.hydrogen.get_CH3(atom, helper1, helper2)[source]

Reconstruct the 3 hydrogens of a sp3 carbon (methyl group).

Parameters:
  • atom (ndarray) – Central atom on which we want to reconstruct hydrogens.

  • helper1 (ndarray) – Heavy atom before central atom.

  • helper2 (ndarray) – Heavy atom before helper1 (two atoms away from central atom).

Returns:

tuple of ndarray Coordinates of the 3 hydrogens: ([x_H1, y_H1, z_H1], [x_H2, y_H2, z_H2], [x_H3, y_H3, z_H3]).

Return type:

tuple

fast_forward.hydrogen.get_CH_double_bond(atom, helper1, helper2)[source]

Reconstruct the hydrogen of a sp2 carbon. :param atom: Central atom on which we want to reconstruct the hydrogen. :type atom: ndarray :param helper1: Heavy atom before central atom. :type helper1: ndarray :param helper2: Heavy atom after central atom. :type helper2: ndarray

Returns:

tuple of ndarray Coordinates of the rebuilt hydrogen: ([x_H, y_H, z_H]).

Return type:

tuple

fast_forward.hydrogen.match_attributes(atom, attributes)[source]