Receptor Preparation#

exception mockdock.receptor.PDBDownloadError[source]#

Bases: Exception

Raised when a PDB file cannot be downloaded from RCSB.

exception mockdock.receptor.LigandNotFoundError[source]#

Bases: Exception

Raised when the specified ligand resname is not found in the structure.

exception mockdock.receptor.GridPrepError[source]#

Bases: Exception

Raised when mk_prepare_receptor or AutoGrid fails.

mockdock.receptor.extract_protein_and_ligand(pdb_id, ligand_resname, output_dir='.')[source]#

mmCIF-first receptor/ligand extraction: - Download mmCIF (ProDy fetchPDB if possible, else direct RCSB) - Parse with ProDy - Detect ligand instance + correct chains - Write *_protein.pdb and *_ligand.pdb via ProDy selections

Parameters:
Return type:

tuple[Path, Path]

class mockdock.receptor.ReceptorPreparer(autogrid_executable='autogrid4', mk_prepare_receptor_executable='mk_prepare_receptor.py', reduce2_executable='mmtbx.reduce2')[source]#

Bases: object

Parameters:
  • autogrid_executable (str)

  • mk_prepare_receptor_executable (str)

  • reduce2_executable (str)

get_receptor_and_ligand_pdb(pdb_id, output_dir, ligand_resname, protein_pdb_path=None, ligand_pdb_path=None)[source]#

Obtain protein and ligand PDB files.

Parameters:
  • pdb_id (str)

  • output_dir (Path)

  • ligand_resname (str)

  • protein_pdb_path (str | Path | None)

  • ligand_pdb_path (str | Path | None)

Return type:

tuple[Path, Path]

run_reduce2(protein_pdb)[source]#

Run mmtbx.reduce2 to add hydrogens (preferred).

Parameters:

protein_pdb (Path)

Return type:

Path

run_mk_prepare_receptor(receptor_input, ligand_pdb, base_name, output_dir, allow_bad_res=False)[source]#

Run mk_prepare_receptor.py to create PDBQT and GPF.

Parameters:
  • receptor_input (Path)

  • ligand_pdb (Path)

  • base_name (str)

  • output_dir (Path)

  • allow_bad_res (bool)

Return type:

Path

run_autogrid(gpf_path, output_dir)[source]#

Run AutoGrid4.

Parameters:
Return type:

Path

prepare_receptor_and_grid(pdb_id, ligand_resname, output_dir='.', allow_bad_res=False, protein_pdb_path=None, ligand_pdb_path=None)[source]#

Convenience method to run the full preparation pipeline.

Parameters:
Return type:

Path