Pair

class ties.Pair(ligA, ligZ, config=None, **kwargs)[source]

Facilitates the creation of morphs. It offers functionality related to a pair of ligands (a transformation).

Parameters:
  • ligA (Ligand or string) – The ligand to be used as the starting state for the transformation.

  • ligZ (Ligand or string) – The ligand to be used as the ending point of the transformation.

  • config (Config) – The configuration object holding all settings.

check_json_file()[source]

Performance optimisation in case TIES is rerun again. Return the first matched atoms which can be used as a seed for the superimposition.

Returns:

If the superimposition was computed before, and the .json file is available, gets one of the matched atoms.

Return type:

[(ligA_atom, ligZ_atom)]

make_atom_names_unique(out_ligA_filename=None, out_ligZ_filename=None, save=True)[source]

Ensure that each that atoms across the two ligands have unique names.

While renaming atoms, start with the element (C, N, ..) followed by

the count so far (e.g. C1, C2, N1).

Resnames are set to “INI” and “FIN”, this is useful for the hybrid dual topology.

Parameters:
  • out_ligA_filename (string or bool) – The new filenames for the ligands with renamed atoms. If None, the default naming convention is used.

  • out_ligZ_filename (string or bool) – The new filenames for the ligands with renamed atoms. If None, the default naming convention is used.

  • save (bool) – Whether to save to the disk the ligands after renaming the atoms

merge_frcmod_files(ligcom=None)[source]

Merges the .frcmod files generated for each ligand separately, simply by adding them together.

The duplication has no effect on the final generated topology parm7 top file.

We are also testing the .frcmod here with the user’s force field in order to check if the merge works correctly.

Parameters:

ligcom (string "lig" or "com") – Either “lig” if only ligands are present, or “com” if the complex is present. Helps with the directory structure.

overlap_fractions()[source]

Calculate the size of the common area.

Returns:

Four decimals capturing: 1) the fraction of the common size with respect to the ligA topology, 2) the fraction of the common size with respect to the ligZ topology, 3) the percentage of the disappearing atoms in the disappearing molecule 4) the percentage of the appearing atoms in the appearing molecule

Return type:

[float, float, float, float]

set_suptop(suptop, parmed_ligA, parmed_ligZ)[source]

Attach a SuperimposedTopology object along with the ParmEd objects for the ligA and ligZ.

Parameters:
  • suptopSuperimposedTopology

  • parmed_ligA – An ParmEd for the ligA

  • parmed_ligZ – An ParmEd for the ligZ

superimpose(**kwargs)[source]

Please see Config class for the documentation of kwargs. The passed kwargs overwrite the config object passed in the constructor.

fixme - list all relevant kwargs here

Parameters:
  • use_element_in_superimposition – bool whether the superimposition should rely on the element initially, before refining the results with a more specific check of the atom type.

  • manually_matched_atom_pairs

  • manually_mismatched_pairs

  • redistribute_q_over_unmatched