H-bond detection#
Hydrogen bond detection (Baker–Hubbard).
Rust (
phenoms_hbond_rs): fast batched geometry when the extension is built; falls back to MDTraj otherwise.Polars (required): per-bond occupancy summaries in
hbond_occupancy_table()and any export path that uses it (Rust does not call Polars; detection stays in Rust).Backbone mode (default): donor/acceptor filtered to backbone-relevant N–O pairs.
All-bonds mode: include all donor/acceptor atom classes supported by topology.
- phenoms.hbond.label_hbond(hbond, trajectory)[source]#
Label a hydrogen bond as ‘residue1 – residue2’ only if it is N–O (backbone-relevant). Returns None otherwise.
- phenoms.hbond.process_frame(frame, trajectory)[source]#
Run Baker–Hubbard on one frame and label N–O bonds (MDTraj path).
- phenoms.hbond.label_hbond_all(hbond, trajectory)[source]#
Label any detected H-bond as ‘DONORRES:ATOM – ACCEPTORRES:ATOM’.
- phenoms.hbond.process_frame_all(frame, trajectory)[source]#
Run Baker-Hubbard on one frame and keep all detected donor/acceptor types.
- phenoms.hbond.process_frames(trajectory, sub_frames=None, n_jobs=1, use_rust=True)[source]#
Process all (or sub_frames) frames; return N–O H-bonds only. Uses Rust when available and topology has bonds; otherwise MDTraj (parallel).
The Rust path uses the same geometric criteria as MDTraj Baker–Hubbard: r(H···A) < 0.25 nm and ∠D–H–A > 120° (angle at H). Use
use_rust=Falseonly for debugging or if the extension is not built.
- phenoms.hbond.process_frames_all(trajectory, sub_frames=None, n_jobs=1, use_rust=True)[source]#
Process all (or sub_frames) frames; return all detected H-bonds (not backbone-only). Uses Rust when available and topology has bonds; otherwise MDTraj (parallel).