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:
AbstractStageThis 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
- class ligandparam.stages.charge.StageUpdateCharge(name, base_cls=None, orig_mol2=None, new_mol2=None, charge_source='multistate', charge_column=None)[source]
Bases:
AbstractStageThis 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