posebutcher.butcher
Module Contents
Classes
POSE BUTCHER |
|
Built-in mutable sequence. |
Functions
|
|
|
|
|
Attributes
- posebutcher.butcher.logger
- class posebutcher.butcher.PoseButcher(protein: str | pathlib.Path, fragments: str | pathlib.Path | None = None, pockets: dict[str, dict] | None = None, pocket_clip: bool = True, pocket_clip_protein: bool = True, pocket_clip_hull: bool = True, pocket_chains: None | list[str] = None)
POSE BUTCHER
“A good butcher always trims the fat”
PoseButcher is a tool for categorising and segmenting virtual hits with reference to experimental protein structures and (fragment) hits.
Ligand atoms are tagged with categories:
GOOD:
fragment space: within the fragment bolus
pocket X: in a specified catalytic/allosteric pocket X
BAD:
protein clash: Clashing with the protein
solvent space: Heading out of the protein/crystal
Usage
Create the butcher (see PoseButcher.__init__):
from posebutcher import PoseButcher butcher = PoseButcher(protein, hits, pockets)
Chop up a posed virtual hit (rdkit.ROMol with a conformer):
result = butcher.chop(mol)
Tag a compound based on its pocket occupancy and clashes:
tags = butcher.tag(mol)
(Coming soon) Trim a parts of a compound that clash with a protein or leave the crystal
mol = butcher.trim(mol)
(Coming soon) Explore the expansion opportunities from a given atom in a virtual hit
result = butcher.explore(mol, index, direction)
(Coming soon) Score how well a virtual hit recapitulates shape and colour of the fragment bolus
score: float = butcher.score(mol)
- property protein
- property pockets
- property fragment_atomgroup
- property fragment_mesh
- property protein_mesh
- property pocket_meshes
- property pockets
- property protein_hull
- property dict
- classmethod from_directory(path)
- chop(pose: rdkit.Chem.rdchem.Mol | molparse.AtomGroup, base: str | rdkit.Chem.rdchem.Mol | None = None, draw: str | None | bool = '2d', fragments: bool = False, count: bool = False, pockets_only: bool = False, indices: bool = False) dict[str, tuple]
For each atom [1] in the provided molecule evaluates if it is:
in the fragment bolus [2]: (‘GOOD’, ‘fragment space’)
in a defined pocket X: (‘GOOD’, ‘pocket’, X)
clashing with the protein: (‘BAD’, ‘protein clash’)
leaving the protein: (‘BAD’, ‘solvent space’)
[1] if a base is provided atoms in the MCS between [pose,base] are ignored [2] only if the fragments argument is truthy
- Draw must be one of:
‘2d’ rdkit 2d drawing
‘3d’ open3d render
Returns labelled atom indices: e.g.
- {
0: (‘GOOD’, ‘fragment space’), 1: (‘GOOD’, ‘pocket’, ‘X’), 2: (‘BAD’, ‘solvent space’), 3: (‘BAD’, ‘protein clash’), …
}
- tag(pose: rdkit.Chem.rdchem.Mol | molparse.AtomGroup, base: str | rdkit.Chem.rdchem.Mol | None = None, draw: str | None | bool = False, pockets_only: bool = False) set
Return a set of string tags signifying which pockets and optionally any protein/solvent clashes are relevant to this ligand.
If pockets_only is truthy, protein/solvent clashes are not tagged.
See the docstring for PoseButcher.chop() to see information about the other arguments.
- explore(pose: rdkit.Chem.rdchem.Mol | molparse.AtomGroup, origin: int | list | None = None, direction: list | None = None, draw: str | bool | None = '3d', return_arrow_mesh: bool = False, color_by_distance: bool = False, samples: bool = False, sample_angle_max: float = 10, sample_angle_step: float = 2, sample_choose_best: bool = True, warnings: bool = True) dict | list[dict]
Explore an expansion vector(s).
pose: rdkit.Chem.Mol or molparse.AtomGroup of the ligand
origin: index of the atom from which to expand or None to try all atoms
direction: direction of the expansion (optional)
draw: Currently only ‘3d’ and None/False are supported.
return_arrow_mesh: Return open3d TriangleMesh objects for the arrow(s)
color_by_distance: Color vectors by their length rather than their destination
samples: Perform additional samples around the (guessed) direction
sample_angle_max: Maximal angle of additional samples
sample_angle_step: Angle distance between additional samples
sample_choose_best: Return the best sample vector only
warnings: Set False to silence warnings
- cavity(pose: rdkit.Chem.rdchem.Mol | molparse.AtomGroup, origin: int | None = None, direction: list | None = None, cone_half_angle: float = 10, sample_angle_max: float | None = None, sample_angle_step: float = 5, align_to_sampled: bool = True, draw: str | bool | None = '3d')
- trim()
- score()
- render(hull='hide', **kwargs)
- write(subdir, generate_meshes=True)
- _parse_protein(protein)
- _parse_fragments(fragments)
- _parse_pockets()
- _spherical_pocket_from_atoms(name, atoms, center=None, radius='mean', shift=None)
- _clip_pockets(protein=True, pockets=True, hull=False, pocket_bisector=False)
- _get_protein_atom(query: str)
Query must be a string containing three white-space separated substrings:
residue name
residue number
atom name
chain name (optional)
e.g. “TYR 90 CD2” or “TYR 90 CD2 A”
- _new_pocket(name, mesh, material=None, **kwargs)
- _classify_atom(atom, fragments=True, pockets_only=False)
- _classify_position(position, fragments=True, clash_radius=0.0, pockets_only=False)
- _classify_vector(origin, direction, fragments=False, warnings=True)
- _cast_ray(origin, direction, skip_pockets)
- _build_fragment_bolus(fragment_df)
- _render_meshes(protein=True, pockets=True, fragments=True, hull=False, wireframe=False, extra=None)
- _output_to_color_pairs(output)
- _num_heavy_atoms_from_distance(distance)
- _guess_vector_direction(orig_index, group, warnings=True)
- summarise_output(output)
- posebutcher.butcher.output_to_label(output, index, indices: bool = False)
- posebutcher.butcher.circular_samples(theta_max, theta_step)
- posebutcher.butcher.create_arrow_mesh(orig_atom, orig_index, origin, color_by_distance, result)
- posebutcher.butcher.PROTEIN_COLOR = (0.8392156862745098, 0.15294117647058825, 0.1568627450980392)
- posebutcher.butcher.SOLVENT_COLOR = (0.12156862745098039, 0.4666666666666667, 0.7058823529411765)
- posebutcher.butcher.FRAGMENT_COLOR = (1.0, 0.4980392156862745, 0.054901960784313725)
- posebutcher.butcher.BASE_COLOR = (0.4980392156862745, 0.4980392156862745, 0.4980392156862745)
- class posebutcher.butcher.CyclicList
Bases:
list
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
- __getitem__(index)
Return self[index].
- posebutcher.butcher.POCKET_COLORS
- posebutcher.butcher.CC_DIST = 1.54
- posebutcher.butcher.C_VDW_RADIUS = 1.7