Hydrogen-bond analysis
This tool provides a fast and practical way to compute hydrogen bonds in structures (if the structures contain hydrogen atoms).
PDBTools.hydrogen_bonds — Functionhydrogen_bonds(atoms, sel, sel1 => sel2, ... ; kargs...)Function to find hydrogen bonds in a set of atoms, or among two sets of atoms. The structure must contain Hydrogen atoms.
Arguments
- atoms: Vector of atoms, or structure component (model, chain, segment, residue) to be analyzed.
and, optionally, the selections or selection pairs for which the hydrogen bonds must be computed:
- sel::String: Selection string, e. g.- "protein".
- sel1 => sel2::Pair{String,String}: Pair of selection strings, e. g.- "resname ARG" => "resname GLU".
The two selections of each pair, if different, must not have overalpping atoms (and error will the thrown). If no selection is provided, the hydrogen bonds of the complete structure will be computed.
Optional keyword arguments
- unitcell::Union{Nothing,AbstractVecOrMat}=nothing: Unit cell for periodic boundary conditions.
- donnor_acceptor_distance::Real=3.5f0: Maximum distance between donnor and acceptor to consider a hydrogen bond.
- angle_cutoff::Real=30: Maximum angle (in degrees) between donnor-hydrogen-acceptor to consider a hydrogen bond.
- electronegative_elements=("N", "O", "F", "S"): Elements considered electronegative for hydrogen bonding.
- d_covalent_bond::Real=1.2f0: Maximum distance between donnor and hydrogen to consider a covalent bond.
- parallel::Bool=false: Whether to use parallel computation.
Returns
- HBonds: A data structure containing the found hydrogen bonds, where each element is a named tuple- (D, H, A, r, ang)where the fields correspond to the donnor, hydrogen and acceptor atoms, the distance between donnor and acceptor atoms, and the angle.
Example
julia> using PDBTools
julia> pdb = read_pdb(PDBTools.test_dir*"/hbonds.pdb", "model 1");
julia> uc = read_unitcell(PDBTools.test_dir*"/hbonds.pdb");
julia> hbs = hydrogen_bonds(pdb, "protein"; unitcell=uc) # Single set of atoms: selection is optional
OrderedCollections.OrderedDict{String, PDBTools.HBonds} with 1 entry:
  "protein => protein" => HBonds(Int32[1, 1, 271, 37, 1020, 237, 56, 76, 1060, 204  …  748, 813, 828, 871, 863, 877, 96…
julia> hbs["protein => protein"] # Summary
HBonds data structure with 63 hydrogen-bonds.
    First hbond: (D-H---A) = (D = 1, H = 2, A = 286, r = 2.6871147f0, ang = 10.643958f0)
    Last hbond: (D-H---A) = (D = 1014, H = 1017, A = 1032, r = 2.5816715f0, ang = 12.714139f0)
    - r is the distance between Donnor and Acceptor atoms (D-A)
    - ang is the angle (degrees) between H-D and A-D.
julia> hbs["protein => protein"][1] # first h-bond
(D = 1, H = 2, A = 286, r = 2.6871147f0, ang = 10.643958f0)
julia> hbs = hydrogen_bonds(pdb, "protein", "protein" => "resname SOL"; unitcell=uc) # Multiple selections
OrderedCollections.OrderedDict{String, PDBTools.HBonds} with 2 entries:
  "protein => protein"     => HBonds(Int32[1, 1, 271, 37, 1020, 237, 56, 76, 1060, 204  …  748, 813, 828, 871, 863, 877…
  "protein => resname SOL" => HBonds(Int32[1406, 1583, 1799, 2027, 789, 3503, 1169, 184, 3914, 4304  …  1224, 38768, 12…
julia> hbs["protein => protein"]
HBonds data structure with 63 hydrogen-bonds.
    First hbond: (D-H---A) = (D = 1, H = 2, A = 286, r = 2.6871147f0, ang = 10.643958f0)
    Last hbond: (D-H---A) = (D = 1014, H = 1017, A = 1032, r = 2.5816715f0, ang = 12.714139f0)
    - r is the distance between Donnor and Acceptor atoms (D-A)
    - ang is the angle (degrees) between H-D and A-D.
julia> hbs["protein => resname SOL"]
HBonds data structure with 138 hydrogen-bonds.
    First hbond: (D-H---A) = (D = 1406, H = 1407, A = 160, r = 2.9361732f0, ang = 6.771988f0)
    Last hbond: (D-H---A) = (D = 41798, H = 41800, A = 395, r = 2.6894214f0, ang = 10.623453f0)
    - r is the distance between Donnor and Acceptor atoms (D-A)
    - ang is the angle (degrees) between H-D and A-D.