4.1. ligandparam.stages.initialize

4.1.1. StageInitialize module

This module provides the StageInitialize class for initializing a ligand from a PDB file and generating a mol2 file.

class ligandparam.stages.initialize.StageInitialize(stage_name: str, main_input: Path | str, cwd: Path | str, *args, **kwargs)[source]

Bases: AbstractStage

Initialize the ligand from a PDB file and generate a mol2 file.

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

  • main_input (Union[Path, str]) – Path to the input PDB file.

  • cwd (Union[Path, str]) – Current working directory.

  • out_mol2 (str) – Path to the output mol2 file.

  • net_charge (float, optional) – Net charge for the molecule (default: 0.0).

  • atom_type (str, optional) – Atom type (default: ‘gaff2’).

  • charge_model (str, optional) – Charge model to use (‘bcc’ or ‘abcg2’, default: ‘bcc’).

  • sqm (bool, optional) – Whether to run secondary SQM calculation (default: False).

  • molname (str, optional) – Molecule name for additional arguments.

  • ek (any, optional) – Additional argument for Antechamber.

in_pdb

Path to the input PDB file.

Type:

Path

out_mol2

Path to the output mol2 file.

Type:

Path

net_charge

Net charge for the molecule.

Type:

float

atom_type

Atom type.

Type:

str

charge_model

Charge model to use.

Type:

str

secondary

Whether to run secondary SQM calculation.

Type:

bool

additional_args

Additional arguments for Antechamber.

Type:

dict

Methods

add_required(filename)

Add a required file to the stage.

append_stage(stage)

Append a stage to the current stage.

clean()

Clean up the stage.

execute([dry_run, nproc, mem])

Execute the initialization stage to generate a mol2 file from a PDB file.

list_files_in_directory(directory)

List all the files in a directory.

Initialize the StageInitialize class.

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

  • main_input (Union[Path, str]) – Path to the input PDB file.

  • cwd (Union[Path, str]) – Current working directory.

  • *args – Additional positional arguments.

  • **kwargs – Additional keyword arguments.

Methods

add_required(filename)

Add a required file to the stage.

append_stage(stage)

Append a stage to the current stage.

clean()

Clean up the stage.

execute([dry_run, nproc, mem])

Execute the initialization stage to generate a mol2 file from a PDB file.

list_files_in_directory(directory)

List all the files in a directory.

execute(dry_run=False, nproc: int | None = None, mem: int | None = None) Any[source]

Execute the initialization stage to generate a mol2 file from a PDB file.

Parameters:
  • dry_run (bool, optional) – If True, the stage will not be executed, but the function will print the commands that would be run.

  • nproc (int, optional) – Number of processors to use.

  • mem (int, optional) – Amount of memory to use (in GB).

Return type:

None

Raises:

ValueError – If the input file type is not supported.