4.2. ligandparam.stages.charge

class ligandparam.stages.charge.StageNormalizeCharge(name, base_cls=None, orig_mol2=None, new_mol2=None, precision=0.0001)[source]

Bases: AbstractStage

This class normalizes the charges to the net charge.

This class works by calculating the charge difference, and then normalizing the charges based on the overall precision that you select, by adjusting each atom charge by the precision until the charge difference is zero.

Methods

add_required(filename)

Add a required file to the stage.

check_charge(charges)

This function checks the total charge and the charge difference.

list_files_in_directory(directory)

List all the files in a directory.

normalize(charges, charge_difference)

This function normalizes the charges to the net charge.

append_stage

clean

execute

Initialize the StageNormalizeCharge class.

Parameters:
  • name (str) – The name of the stage

  • base_cls (Ligand) – The base class of the ligand

  • orig_mol2 (str) – The original mol2 file

  • new_mol2 (str) – The new mol2 file

  • precision (float) – The precision of the charge normalization

Raises:
  • ValueError – If the original mol2 file is not provided

  • ValueError – If the new mol2 file is not provided

Methods

add_required(filename)

Add a required file to the stage.

check_charge(charges)

This function checks the total charge and the charge difference.

list_files_in_directory(directory)

List all the files in a directory.

normalize(charges, charge_difference)

This function normalizes the charges to the net charge.

append_stage

clean

execute

check_charge(charges)[source]

This function checks the total charge and the charge difference.

Parameters:

charges (np.array) – The charges

Returns:

  • total_charge (float) – The total charge

  • charge_difference (float) – The charge difference

normalize(charges, charge_difference)[source]

This function normalizes the charges to the net charge.

Parameters:
  • charges (np.array) – The charges

  • charge_difference (float) – The charge difference

Returns:

charges – The normalized charges

Return type:

np.array

class ligandparam.stages.charge.StageUpdateCharge(name, base_cls=None, orig_mol2=None, new_mol2=None, charge_source='multistate', charge_column=None)[source]

Bases: AbstractStage

This class creates a new mol2 file with updated charges.

Methods

add_required(filename)

Add a required file to the stage.

list_files_in_directory(directory)

List all the files in a directory.

append_stage

clean

execute

Initialize the StageUpdateCharge class.

Parameters:
  • name (str) – The name of the stage

  • base_cls (Ligand) – The base class of the ligand

  • orig_mol2 (str) – The original mol2 file

  • new_mol2 (str) – The new mol2 file

  • charge_source (str) – The source of the charges

  • charge_column (int) – The column of the charges

Methods

add_required(filename)

Add a required file to the stage.

list_files_in_directory(directory)

List all the files in a directory.

append_stage

clean

execute