qp.cluster.spheres

Extract active site coordination sphere clusters

Usage:

>>> from qp.cluster import spheres

>>> spheres.extract_clusters(
...     "path/to/PDB.pdb",
...     "path/to/out/dir/",
...     center_residues=["FE", "FE2"], # List of resnames of the residues to use as the cluster center
...     sphere_count=2,              # Number of spheres to extract
...     ligands=["AKG"]       # PDB IDs of additional ligands
... )

Extracting clusters leaves open valences in the outermost sphere. Capping may be performed by specifying capping in spheres.extract_clusters:

    1. No capping. (Default)

    1. Cap with hydrogens.

    1. Cap with ACE/NME groups.

Functions

box_outlier_thres

Compute the threshold for the boxplot outlier detection method

build_heavy

Cap with ACE/NME, building based on the upstream or downstream residue

build_hydrogen

Cap with hydrogen, building based on the upstream or downstream residue

calc_dist

Calculate the Euclidean distance between two points

cap_chains

Cap chain breaks for a set of extracted residues

check_NC

Check if a nitrogen / carbon atom in the first sphere is coordinated.

check_atom_valence

Check whether a backbone atom already has sufficient bonded neighbors.

check_disulfide

Detect whether a cysteine residue is involved in a disulfide bond.

complete_oligomer

Ensure that partially included oligomeric ligands are fully added.

compute_charge

Computes the total charge of coordinating AAs

count_residues

Counts the frequency of coordinating residues

extract_clusters

Extract active site coordination spheres using Voronoi tessellation.

fill_dummy

Fill dummy atoms in a point cloud

format_plot

General plotting parameters for the Kulik Lab.

get_center_residues

Find all center residues in a model and optionally merge nearby ones.

get_grid

Compute the grid's parameter for a given 1D point list

get_grid_coord_idx

Compute a point's position in a 1D grid

get_next_neighbors

Iteratively determines spheres around a given starting atom

get_normalized_vector

Return the unit vector pointing from atom1 to atom2.

make_res_key

Format a residue as a 'RESNAME_CHAINID' string key (e.g., 'FE_A199').

merge_centers

Recursively merge center residues that are within a distance cutoff.

plot_voronoi_2d

Plot a 2D Voronoi diagram from the atomic coordinates, excluding unbounded vertices and filtering by x and y thresholds.

prune_atoms

Prune residues from the cluster to meet the max atom count constraint.

residue_in_ligands

Check whether a residue matches any key in the ligand charge dictionary.

scale_hydrogen

Replaces an atom with hydrogen, rescaling the original bond length

visualize_dummy

Write dummy atom positions to an XYZ file for debugging.

voronoi

Compute the Voronoi tessellation of a protein structure.

write_pdbs

Write coordination sphere to PDB file.

Classes

CenterResidue