Privileged Residues Package

Submodules

privileged_residues.chemical module

class privileged_residues.chemical.FunctionalGroup

Bases: tuple

Store hydrogen bonding information about a functional group as well as information that can be used to position it in three-space.

resName

str – Name of the functional group.

donor

bool – True if the functional group can be a donor in a hydrogen bond.

acceptor

bool – True if the functional group can be an acceptor in a hydrogen bond.

atoms

list of str – List of three atom names that are used to construct a coordinate frame to describe the position of the functional group in three-space.

acceptor

Alias for field number 2

atoms

Alias for field number 3

donor

Alias for field number 1

resName

Alias for field number 0

class privileged_residues.chemical.ResInfo

Bases: tuple

Store functional group information about an amino acid as well as information that can be used to position it in three-space.

grp

str – Name of a functional group.

atoms

list of str – List of three atom names that are used to construct a coordinate frame to describe the position of the functional group of the amino acid in three-space.

atoms

Alias for field number 1

grp

Alias for field number 0

privileged_residues.chemical.acceptor_acceptor_rays(pose, selector)[source]

Get acceptor-acceptor network ray pairs for the residues indicated by the provided residue selector.

Parameters:
  • pose (pyrosetta.pose) – Target structure.
  • selector (pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) – Residue selector to apply to the pose.
Returns:

All of the ray pairs corresponding to possible acceptor-acceptor network interactions in the selected subset of the pose.

Return type:

list of tuple of np.ndarray

privileged_residues.chemical.donor_acceptor_rays(pose, selector)[source]

Get donor-acceptor network ray pairs for the residues indicated by the provided residue selector.

Parameters:
  • pose (pyrosetta.pose) – Target structure.
  • selector (pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) – Residue selector to apply to the pose.
Returns:

All of the ray pairs corresponding to possible donor-acceptor network interactions in the selected subset of the pose.

Return type:

list of tuple of np.ndarray

privileged_residues.chemical.donor_donor_rays(pose, selector)[source]

Get donor-donor network ray pairs for the residues indicated by the provided residue selector.

Parameters:
  • pose (pyrosetta.pose) – Target structure.
  • selector (pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) – Residue selector to apply to the pose.
Returns:

All of the ray pairs corresponding to possible donor-donor network interactions in the selected subset of the pose.

Return type:

list of tuple of np.ndarray

privileged_residues.chemical.sc_bb_rays(pose, selector)[source]

Get sidechain-to-backbone ray pairs for the residues indicated by the provided residue selector.

Parameters:
  • pose (pyrosetta.pose) – Target structure.
  • selector (pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) – Residue selector to apply to the pose.
Returns:

All of the ray pairs corresponding to possible sidechain-to-backbone interactions in the selected subset of the pose.

Return type:

list of tuple of np.ndarray

privileged_residues.chemical.sc_sc_rays(pose, selector)[source]

Get sidechain-to-sidechain ray pairs for the residues indicated by the provided residue selector.

Parameters:
  • pose (pyrosetta.pose) – Target structure.
  • selector (pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) – Residue selector to apply to the pose.
Returns:

All of the ray pairs corresponding to possible sidechain-to-sidechain interactions in the selected subset of the pose.

Return type:

list of tuple of np.ndarray

privileged_residues.chemical.sc_scbb_rays(pose, selector)[source]

Get sidechain-to-sidechain-and-backbone ray pairs for the residues indicated by the provided residue selector.

Parameters:
  • pose (pyrosetta.pose) – Target structure.
  • selector (pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) – Residue selector to apply to the pose.
Returns:

All of the ray pairs corresponding to possible sidechain-to-sidechain-and-backbone interactions in the selected subset of the pose.

Return type:

list of tuple of np.ndarray

privileged_residues.geometry module

privileged_residues.geometry.coords_to_transform(coords)[source]

From a set of coordinates, construct a homogeneous transform.

Parameters:coords (np.ndarray) –
Returns:Homogeneous transform constructed from the input coordinates.
Return type:np.ndarray
privileged_residues.geometry.create_ray(center, base)[source]

Create a ray of unit length from two points in space and return it.

Notes

The ray is constructed such that:

  1. The direction points from base to center and is unit length.
  2. The point at which the ray is centered is at center.
Parameters:
  • center (numpy.ndarray) – A (1, 3) array representing the coordinate at which to center the resulting ray.
  • base (numpy.ndarray) – A (1, 3) array representing the base used to determine the direction of the resulting ray.
Returns:

A (2,4) array representing a ray in space with a point and a unit direction.

Return type:

numpy.ndarray

privileged_residues.geometry.rays_to_transform(first, second)[source]

From two rays, construct a homogeneous transform.

Parameters:
  • first (np.ndarray) –
  • second (np.ndarray) –
Returns:

Homogeneous transform constructed from the input rays.

Return type:

np.ndarray

privileged_residues.postproc module

privileged_residues.postproc.filter_clash_minimize(pose, hits, clash_cutoff=35.0, rmsd_cutoff=0.5, sfx=None, mmap=None, limit=0)[source]

Filter match output for clashes, then minimize the remaining structures against the target pose.

Parameters:
  • pose (pyrosetta.Pose) – Target structure.
  • hits (np.ndarray) – Set of functional group matches against positions in the target.
  • clash_cutoff (float) – Maximum tolerated increase in score terms during clash checking.
  • sfx (pyrosetta.rosetta.core.scoring.ScoreFunction, optional) – Scorefunction to use during minimization. If left as None, a default scorefunction is constructed.
  • mmap (pyrosetta.rosetta.protocols.minimization_packing.MinMover, optional) – Movemap to use during minimization. If left as None, a default movemap is constructed.
Yields:

pyrosetta.Pose – Next target structure and matched functional group, minimized and in complex.

privileged_residues.privileged_residues module

class privileged_residues.privileged_residues.PrivilegedResidues(path='/home/onalant/dump/2018-05-07_datatables/database.h5')[source]

Bases: object

match(ray1, ray2, group)[source]

Construct all of the matched structures for a given ray pair and group.

Notes

The following are the available search groups.

Bidentates:
  • “sc_sc”
  • “sc_scbb”
  • “sc_bb”
Networks:
  • “acceptor_acceptor”
  • “acceptor_donor”
  • “donor_acceptor”
  • “donor_donor”
Parameters:
  • ray1 (np.ndarray) –
  • ray2 (np.ndarray) – Rays used to search in the underlying database.
  • group (str) – Dataset to search in.
Yields:

pyrosetta.Pose – Functional group as placed by transform from table.

search(pose, groups, selector)[source]

Search for privileged interactions in a pose.

Parameters:
  • pose (pyrosetta.Pose) – Target structure.
  • groups (list of str) – Datasets or groups to search for matches in.
  • selector (pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) – Residue selector to apply to the pose.
Yields:

tuple of np.uint64 and pyrosetta.Pose – Target ray pair hash and output pose.

privileged_residues.table module

class privileged_residues.table.GenericTable(dbpath)[source]

Bases: object

Indexed key-value store implementation.

Best used on large datasets that do not fit into memory.

fetch(key, findgroup='')[source]
Parameters:
  • key (np.uint64) – A hash value.
  • findgroup (str, optional) – A named group to search for hashes in. Defaults to “”, which searches in all named groups.
Returns:

Concatenated list of matches for a hash and group query.

Return type:

np.ndarray

privileged_residues.util module

privileged_residues.util.models_from_pdb(fname)[source]

Get models from a PDB as individual poses.

Parameters:fname (str) – Path to a PDB.
Yields:pyrosetta.Pose – The next model in the PDB.
privileged_residues.util.numpy_to_rif(r)[source]

Convert from NumPy ray representation to RIF ray representation.

Parameters:r (np.ndarray) – Input NumPy ray.
Returns:
Return type:rif.geom.Ray

Module contents

class privileged_residues.PrivilegedResidues(path='/home/onalant/dump/2018-05-07_datatables/database.h5')[source]

Bases: object

match(ray1, ray2, group)[source]

Construct all of the matched structures for a given ray pair and group.

Notes

The following are the available search groups.

Bidentates:
  • “sc_sc”
  • “sc_scbb”
  • “sc_bb”
Networks:
  • “acceptor_acceptor”
  • “acceptor_donor”
  • “donor_acceptor”
  • “donor_donor”
Parameters:
  • ray1 (np.ndarray) –
  • ray2 (np.ndarray) – Rays used to search in the underlying database.
  • group (str) – Dataset to search in.
Yields:

pyrosetta.Pose – Functional group as placed by transform from table.

search(pose, groups, selector)[source]

Search for privileged interactions in a pose.

Parameters:
  • pose (pyrosetta.Pose) – Target structure.
  • groups (list of str) – Datasets or groups to search for matches in.
  • selector (pyrosetta.rosetta.core.select.residue_selector.ResidueSelector) – Residue selector to apply to the pose.
Yields:

tuple of np.uint64 and pyrosetta.Pose – Target ray pair hash and output pose.