Ligand

class ties.Ligand(ligand, config=None, save=True)[source]

The ligand helper class. Helps to load and manage the different copies of the ligand file. Specifically, it tracks the different copies of the original input files as it is transformed (e.g. charge assignment).

Parameters:
  • ligand (string) – ligand filepath

  • config (Config) – Optional configuration from which the relevant ligand settings can be used

  • save (bool) – write a file with unique atom names for further inspection

antechamber_prepare_mol2(**kwargs)[source]

Converts the ligand into a .mol2 format.

BCC charges are generated if missing or requested. It calls antechamber (the charge type -c is not used if user prefers to use their charges). Any DU atoms created in the antechamber call are removed.

Parameters:
  • atom_type – Atom type bla bla

  • net_charge (int) –

are_atom_names_correct()[source]
Checks if atom names:
  • are unique

  • have a correct format “LettersNumbers” e.g. C17

convert_acprep_to_mol2()[source]

If the file is not a prep/ac file, this function does not do anything. Antechamber is called to convert the .prepi/.prep/.ac file into a .mol2 file.

Returns: the name of the original file, or of it was .prepi, a new filename with .mol2

correct_atom_names()[source]
Ensure that each atom name:
  • is unique

  • has letter followed by digits

  • has max 4 characters

E.g. C17, NX23

Parameters:

self.save – if the path is provided, the updated file will be saved with the unique names and a handle to the new file (ParmEd) will be returned.

generate_frcmod(**kwargs)[source]
params
  • parmchk2

  • atom_type

overwrite_coordinates_with(file, output_file)[source]

Load coordinates from another file and overwrite the coordinates in the current file.

removeDU_atoms()[source]

Ambertools antechamber creates sometimes DU dummy atoms. These are not created when BCC charges are computed from scratch. They are only created if you reuse existing charges. They appear to be a side effect. We remove the dummy atoms therefore.

property renaming_map

Otherwise, key: newName, value: oldName.

If None, means no renaming took place.