Skip to main content

Module transform

Module transform 

Source
Expand description

Coordinate transformation utilities.

Provides functions for extracting, filtering, and aligning coordinates:

  • Backbone/CA extraction
  • Atom filtering
  • Kabsch alignment

Structs§

NamedResidueAtomSearch
Spatial data for per-residue atom proximity lookups that also carry atom names.
ResidueAtomSearch
Spatial data needed for per-residue atom proximity lookups.

Constants§

PROTEIN_RESIDUES
Standard amino acid residue names

Functions§

align_coords_bytes
Align coordinate bytes to match reference CA positions.
align_to_reference
Align COORDS to match reference CA positions using Kabsch algorithm.
backbone_only
Filter COORDS to only backbone atoms (N, CA, C, O).
build_ca_position_map
Build a map of (chain_id, res_num) -> CA position for efficient lookup.
centroid
Compute centroid of a point set.
extract_backbone_chains
Extract backbone chains from COORDS data.
extract_ca_from_chains
Extract CA positions from backbone chains (every 2nd element in N-CA-C pattern).
extract_ca_positions
Extract CA positions from COORDS data.
filter_atoms
Filter atoms by predicate on atom name.
filter_residues
Filter atoms by predicate on residue name.
get_atom_by_name
Get position of a specific atom by residue number, chain ID, and atom name.
get_atom_position
Get atom position by index.
get_backbone_atoms_from_chains
Get all backbone atom positions (N, CA, C) for a residue by index. Returns None if residue_idx is out of bounds.
get_ca_for_residue
Get CA position for a specific residue by residue number and chain ID.
get_ca_position_from_chains
Get a single CA position by residue index from backbone chains. Returns None if residue_idx is out of bounds.
get_closest_atom_for_residue
Get the closest atom (backbone or sidechain) to a reference point for a residue.
get_closest_atom_with_name
Find the closest atom to a reference point within a residue, returning both position and atom name.
get_closest_backbone_atom
Get the closest backbone atom position to a reference point for a residue.
heavy_atoms_only
Filter COORDS to only heavy atoms (exclude hydrogens).
interpolate_coords
Linear interpolation between two Coords instances.
interpolate_coords_collapse
Interpolate Coords with a collapse/expand effect through a collapse point.
kabsch_alignment
Kabsch algorithm: find optimal rotation and translation to align target to reference.
kabsch_alignment_with_scale
Kabsch-Umeyama algorithm: find optimal rotation, translation, AND scale.
protein_only
Filter COORDS to only protein residues (remove water, ligands, etc.).
set_atom_position
Set atom position by index.
transform_coords
Apply transformation to all atoms in COORDS.
transform_coords_with_scale
Apply transformation with scale to all atoms in COORDS.