haddock.clis.restraints.z_surface_restraints module

haddock3-restraints z-surface-restraints subcommand.

Generate both z-restraints and corresponding z-surfaces based on input pdb structure and residue selection.

Usage:
haddock3-restraints z-surface-restraints
--pdb

<path/to/the/structure.pdb>

--residues

<list of coma separated residue index>

--output

<base/path/where/to/output/data>

--spacing

<spacing_between_two_beads>

--x-size

<size_in_x_dim>

--y-size

<size_in_y_dim>

–z-padding <additional_z_padding_between_two_extrema_plans>

e.g: haddock3-restraints z-surface-restraints

–pdb mystructure.pdb –residues 1,2,3 7,8,9 –spacing 20 –x-size 200 –y-size 200 –z-padding 5 –output myZrestaints

haddock.clis.restraints.z_surface_restraints.add_z_surf_restraints_arguments(z_surf_restraints_subcommand)[source]

Add arguments to the z_plan subcommand.

haddock.clis.restraints.z_surface_restraints.bead_plan(spacing: float = 40, x_size: float = 200, y_size: float = 200, z_coord: float = 0, resindex: int = 0) tuple[str, int][source]

Generate a PDB plan made of beads.

Parameters:
  • spacing (float, optional) – Spacing (in Angstrom) between beads in same dimension, by default 40

  • x_size (float, optional) – Width (in Angstrom) of the plan, by default 200

  • y_size (float, optional) – Height (in Angstrom) of the plan, by default 200

  • z_coord (float, optional) – Z-coordinate where to generate the plan, by default 0

  • resindex (int, optional) – From which resiude to start the , by default 0

Returns:

  • plan (str) – The PDB plan made of beads.

  • resindex (int) – Index of the last residue index added.

haddock.clis.restraints.z_surface_restraints.compute_barycenter(resi_coords: list[tuple[float, float, float]]) tuple[float, float, float][source]

Compute center of mass of multiple resiudes coordinates.

Parameters:

resi_coords (list[tuple[float, float, float]]) – List of Calpha coordinates.

Returns:

barycenter (tuple[float, float, float]) – Corrdinates of the center of mass.

haddock.clis.restraints.z_surface_restraints.gen_bead_plans(spacing: float = 40, x_size: float = 200, y_size: float = 200, z_coords: list[float] | None = None) str[source]

Generate multiple bead plans.

Parameters:
  • spacing (float, optional) – Spacing (in Angstrom) between beads in same dimension, by default 40

  • x_size (float, optional) – Width (in Angstrom) of the plan, by default 200

  • y_size (float, optional) – Height (in Angstrom) of the plan, by default 200

  • z_coords (Optional[list[float]], optional) – List of z-coordinates where to generate plans, by default None

Returns:

bead_plans (str) – A PDB file containing multiple plans.

haddock.clis.restraints.z_surface_restraints.gen_z_restraints(res_select: dict[str, list[int]], selection_z: dict[str, float], rest_dist: float = 7.5, segids: list[str] = ['A'], atome_types: list[str] = ['CA']) str[source]

Generate set of z ambiguous restraints according to residue selections.

Parameters:
  • res_select (dict[str, list[int]]) – Dictionary holding the various residues indices for each selection.

  • selection_z (dict[str, float]) – Z coodrinate for each selection.

  • rest_dist (float, optional) – Upper boundary (in Angstrom) of satisfied restraints, by default 7.5

Returns:

all_restraints (str) – A string containing the AIR restraints.

haddock.clis.restraints.z_surface_restraints.gen_z_surface_restraints(pdb: str | Path, residues: list[str] | None = None, output: str | None = None, spacing: float = 40, x_size: float = 200, y_size: float = 200, z_padding: float = 5.0, log_level: str = 'INFO') tuple[str, str]

Generate both z-restraints and z-surface beads from residue selection.

Parameters:
  • pdb (Union[str, Path]) – Path to the PDB file to be parsed.

  • residues (list[str]) – List of strings containing coma separated resids, by default None

  • spacing (float, optional) – Spacing (in Angstrom) between beads in same dimension, by default 40

  • x_size (float, optional) – Width (in Angstrom) of the plan, by default 200

  • y_size (float, optional) – Height (in Angstrom) of the plan, by default 200

Returns:

tuple[Union[str, Path], Union[str, Path]] – Paths to the Z_restraints.tbl and Z_surface.pdb

haddock.clis.restraints.z_surface_restraints.get_z_coords(select_coords: dict[str, list[tuple[float, float, float]]], padding: float = 5.0) dict[str, float][source]

Generate z-coordinates from selection of residues.

Here the idea is to find the most distant points between selections, and project it on a Z axis to be able to later orient the protein.

Parameters:
  • selection_coords (dict[str, list[tuple[float, float, float]]]) – Dictionary holding the various Calpha coordinates for each selection.

  • padding (float, optional) – Extra padding (in Angstrom) of z-coordinate, by default 10

Returns:

selection_z (dict[str, float]) – Z coodrinate for each selection.

haddock.clis.restraints.z_surface_restraints.load_selected_resiudes_coords(pdb_fpath: str | Path, selections: dict[str, list[int]]) tuple[dict[str, list[tuple[float, float, float]]], list[str], list[str]][source]

Load coordinates of selected residues.

Parameters:
  • pdb_fpath (Union[str, Path]) – Path to the PDB file to be parsed.

  • selections (dict[str, list[int]]) – Dictionary holding the various residues indices for each selection.

Returns:

selection_coords (dict[str, list[tuple[float, float, float]]]) – Dictionary holding the various Calpha coordinates for each selection.

haddock.clis.restraints.z_surface_restraints.load_selections(residues_lists: list[str]) dict[str, list[int]][source]

Split and cast residues from an initial string to list.

Parameters:

residues_lists (list[str]) – List of strings containing coma separated resiudes indices.

Returns:

selections (dict[str, list[int]]) – Dictionary of resiudes indices.

haddock.clis.restraints.z_surface_restraints.main(pdb: str | Path, residues: list[str] | None = None, output: str | None = None, spacing: float = 40, x_size: float = 200, y_size: float = 200, z_padding: float = 5.0, log_level: str = 'INFO') tuple[str, str][source]

Generate both z-restraints and z-surface beads from residue selection.

Parameters:
  • pdb (Union[str, Path]) – Path to the PDB file to be parsed.

  • residues (list[str]) – List of strings containing coma separated resids, by default None

  • spacing (float, optional) – Spacing (in Angstrom) between beads in same dimension, by default 40

  • x_size (float, optional) – Width (in Angstrom) of the plan, by default 200

  • y_size (float, optional) – Height (in Angstrom) of the plan, by default 200

Returns:

tuple[Union[str, Path], Union[str, Path]] – Paths to the Z_restraints.tbl and Z_surface.pdb

haddock.clis.restraints.z_surface_restraints.output_data(restraints: str, plans: str, output: str | Path | None = None) tuple[str, str][source]

Write output files.

Parameters:
  • restraints (str) – String containing the ambiguous restraints.

  • plans (str) – String containing shape beads coordinates as PDB file.

  • output (Optional[Union[str, Path]], optional) – Base output path, by default None

Returns:

  • restraints_fpath (str) – Path to the generated AIRs.

  • beadplans_fpath (str) – Path to the generated PDB file containing beads.

haddock.clis.restraints.z_surface_restraints.setup_logging(log_level: str = 'INFO') None[source]

Set log level and format.

haddock.clis.restraints.z_surface_restraints.shape_bead(x: float, y: float, z: float, resindex: int, chain: str = 'S', atindex: int = 1, bfactor: float = 1.0) str[source]

Generate a PDB shape bead.

Parameters:
  • x (float) – x coordinate of the bead

  • y (float) – y coordinate of the bead

  • z (float) – z coordinate of the bead

  • resindex (int) – Residue index

  • chain (str, optional) – Chain id, by default “S”

  • atindex (int, optional) – Atome index, by default 1

  • bfactor (float, optional) – B-factor of the bead, by default 1.00

Returns:

bead (str) – A valid PDB shape bead.

haddock.clis.restraints.z_surface_restraints.step_coords(_size: float, _spacing: float) Generator[float, None, None][source]

Generate set of evenly spaced coordinates between of defined size.

Parameters:
  • size (float) – Size (in Angstrom) to be sampled

  • spacing (float) – Spacing between each coordinate

Returns:

Generator[float, None, None] – 1D coodinate of current position.