General utilities

posebench.utils.utils.find_ligand_files(ligand_file_dir: Path, extension: str = 'sdf') list[Path][source]

Find all ligand files in the specified directory.

Parameters:
  • ligand_file_dir – The directory containing the ligand files.

  • extension – The file extension of the ligand files.

Returns:

A list of Path objects representing the ligand files.

posebench.utils.utils.find_protein_files(protein_file_dir: Path, extension: str = 'pdb') list[Path][source]

Find all protein files in the specified directory.

Parameters:
  • protein_file_dir – The directory containing the protein files.

  • extension – The file extension of the protein files.

Returns:

A list of Path objects representing the protein files.

posebench.utils.utils.run_command_with_timeout(command: str, timeout: int) int[source]

Run a command with a specified timeout in seconds.

Parameters:
  • command – The command to run.

  • timeout – The timeout for the command.

Returns:

The return code of the command.