mchammer.Collapser

class mchammer.Collapser(step_size, distance_threshold, scale_steps=True)[source]

Bases: object

Moves rigid-subunits toward center of mass of molecule.

Methods

get_result

Get final result of the optimization of mol.

get_trajectory

Get trajectory of optimization run on mol.

Parameters:
  • step_size (float) –

  • distance_threshold (float) –

  • scale_steps (bool) –

get_result(mol, bond_pair_ids, subunits)[source]

Get final result of the optimization of mol.

Parameters:
  • mol (Molecule) – The molecule to be optimized.

  • bond_pair_ids (tuple) – iterable of tuple of ints Iterable of pairs of atom ids with bond between them to optimize.

  • subunits (dict) – The subunits of mol split by bonds defined by bond_pair_ids. Key is subunit identifier, Value is iterable of atom ids in subunit.

Returns:

The optimized molecule.

result:

The result of the final optimization step.

Return type:

mol

get_trajectory(mol, bond_pair_ids, subunits)[source]

Get trajectory of optimization run on mol.

Parameters:
  • mol (Molecule) – The molecule to be optimized.

  • bond_pair_ids (tuple) – iterable of tuple of ints Iterable of pairs of atom ids with bond between them to optimize.

  • subunits (dict) – The subunits of mol split by bonds defined by bond_pair_ids. Key is subunit identifier, Value is iterable of atom ids in subunit.

Returns:

The optimized molecule.

result:

The result of the optimization including all steps.

Return type:

mol