From 7289187734ff75704f0c8712e832c78c69a0b816 Mon Sep 17 00:00:00 2001 From: Brady Johnston Date: Tue, 20 Oct 2026 15:39:34 +0100 Subject: [PATCH 1/6] improve constructing DSSP --- package/CHANGELOG | 4 + package/MDAnalysis/analysis/dssp/dssp.py | 79 ++++++++++--------- .../MDAnalysisTests/analysis/test_dssp.py | 40 ++++++++++ 3 files changed, 84 insertions(+), 39 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index ed3d37a7fd..9f7286d5b3 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -126,6 +126,10 @@ Fixes DSSP by porting upstream PyDSSP 0.9.1 fix (Issue #4913) Enhancements + * DSSP finds the hydrogens of all residues with one selection instead of + one per residue, so constructing DSSP is 30-50x faster, and fills in + hydrogen positions without a loop over residues for + ``guess_hydrogens=False`` (PR #XXXX) * Add reading single-frame files from mmCIF, also known as PDBx format, using crystallographic library `gemmi` as a backend (Issue #2367 and extension of #4303, also solves #5089, PR #4712). diff --git a/package/MDAnalysis/analysis/dssp/dssp.py b/package/MDAnalysis/analysis/dssp/dssp.py index ea39d78caa..db10851a46 100644 --- a/package/MDAnalysis/analysis/dssp/dssp.py +++ b/package/MDAnalysis/analysis/dssp/dssp.py @@ -145,7 +145,6 @@ """ import warnings -from typing import Optional, Union import numpy as np @@ -312,7 +311,7 @@ def get_supported_backends(cls): def __init__( self, - atoms: Union[Universe, AtomGroup], + atoms: Universe | AtomGroup, guess_hydrogens: bool = True, *, heavyatom_names: tuple[str] = ("N", "CA", "C", "O O1 OT1"), @@ -326,7 +325,7 @@ def __init__( super().__init__(ag.universe.trajectory) # define necessary selections - self._heavy_atoms: dict[str, "AtomGroup"] = { + self._heavy_atoms: dict[str, AtomGroup] = { t: ag.atoms[ np.isin( ag.names, t.split() @@ -335,7 +334,7 @@ def __init__( ] for t in heavyatom_names } - self._donor_mask: Optional[np.ndarray] = ag.residues.resnames != "PRO" + self._donor_mask: np.ndarray | None = ag.residues.resnames != "PRO" self._box = self._trajectory.ts.dimensions if self._box is not None and np.allclose( self._box, [1, 1, 1, 90, 90, 90] @@ -345,38 +344,40 @@ def __init__( "Box dimensions are (1, 1, 1, 90, 90, 90), not using " "periodic boundary conditions in DSSP calculations" ) - self._hydrogens: list["AtomGroup"] = [ - res.atoms.select_atoms(f"name {hydrogen_name}") - for res in ag.residues + # hydrogens of each residue (among all of its atoms, not only those in + # ag), found with one selection: residue positions in ag.residues + # (sorted by resindex), then the number per residue and the first one + # of each residue that has any, in atom order + residues = ag.residues + hydrogens = residues.atoms.select_atoms(f"name {hydrogen_name}") + h_residue = np.searchsorted(residues.resindices, hydrogens.resindices) + n_hydrogens = np.bincount(h_residue, minlength=len(residues)) + self._has_hydrogen: np.ndarray = n_hydrogens > 0 + self._first_hydrogens: AtomGroup = hydrogens[ + np.unique(h_residue, return_index=True)[1] ] - # can't do it the other way because I need missing values to exist - # so that I could fill them in later if not self._guess_hydrogens: - # zip() assumes that _heavy_atoms and _hydrogens is ordered in the - # same way. This is true as long as the original AtomGroup ag is - # sorted. With the hard-coded protein selection for ag this is always - # true but if the code on L277 ever changes, make sure to sort first! - for calpha, hydrogen in zip( - self._heavy_atoms["CA"][1:], self._hydrogens[1:] - ): - if (calpha.resname != "PRO" and len(hydrogen) != 1) or ( - calpha.resname == "PRO" and hydrogen - ): - raise ValueError( - ( - f"Residue {calpha.residue} contains wrong number of hydrogens: " - "exactly 1 hydrogen is expected for non-PRO residues, and " - "zero hydrogens for PRO residues." - ) - ) + # pairs the k-th CA atom with the k-th residue. This assumes that + # both are ordered in the same way, which holds as long as ag is + # sorted (it is, from the hard-coded protein selection above) + calphas = self._heavy_atoms["CA"] + n = min(len(calphas), len(residues)) + is_pro = calphas.resnames[1:n] == "PRO" + counts = n_hydrogens[1:n] + wrong = np.flatnonzero(np.where(is_pro, counts != 0, counts != 1)) + if wrong.size: + residue = calphas[wrong[0] + 1].residue + raise ValueError( + f"Residue {residue} contains wrong number of hydrogens: " + "exactly 1 hydrogen is expected for non-PRO residues, and " + "zero hydrogens for PRO residues." + ) positions = [group.positions for group in self._heavy_atoms.values()] - if len(set(map(lambda arr: arr.shape[0], positions))) != 1: + if len({arr.shape[0] for arr in positions}) != 1: raise ValueError( - ( - "Universe contains unequal numbers of (N,CA,C,O) atoms ('name' field)." - " Please select appropriate AtomGroup manually." - ) + "Universe contains unequal numbers of (N,CA,C,O) atoms ('name' field)." + " Please select appropriate AtomGroup manually." ) if len(ag.residues) < 6: @@ -413,14 +414,14 @@ def _get_coords(self) -> np.ndarray: coords.swapaxes(0, 1) ) - h_coords = np.array( - [ - group.positions[0] if group else guessed_h_coords[idx] - for idx, group in enumerate(self._hydrogens) - ] - ) - h_coords = np.expand_dims(h_coords, axis=0) - coords = np.vstack([coords, h_coords]) + # the first hydrogen of each residue that has one; a residue + # without one takes the guessed hydrogen of the same index + has = self._has_hydrogen + h_coords = np.empty((len(has), 3), dtype=coords.dtype) + h_coords[has] = self._first_hydrogens.positions + missing = np.flatnonzero(~has) + h_coords[missing] = guessed_h_coords[missing] + coords = np.vstack([coords, h_coords[np.newaxis]]) coords = coords.swapaxes(0, 1) return coords diff --git a/testsuite/MDAnalysisTests/analysis/test_dssp.py b/testsuite/MDAnalysisTests/analysis/test_dssp.py index b01b79168e..caac372a67 100644 --- a/testsuite/MDAnalysisTests/analysis/test_dssp.py +++ b/testsuite/MDAnalysisTests/analysis/test_dssp.py @@ -6,6 +6,7 @@ import numpy as np import pytest from MDAnalysis.analysis.dssp import DSSP, assign, translate +from MDAnalysis.analysis.dssp.pydssp_numpy import _get_hydrogen_atom_position from MDAnalysisTests.datafiles import DSSP as DSSP_FOLDER from MDAnalysisTests.datafiles import TPR, XTC @@ -171,3 +172,42 @@ def test_insufficient_residues_raises_error(client_DSSP): dssp = DSSP(res6) result = dssp.run(**client_DSSP, stop=1) assert result.results.dssp.shape[1] == 6 + + +def _hydrogens_per_residue(ag, hydrogen_name): + """hydrogens selected one residue at a time (the selection DSSP made + before it was vectorised): the reference for the selection now""" + return [ + res.atoms.select_atoms(f"name {hydrogen_name}") + for res in ag.select_atoms("protein").residues + ] + + +@pytest.mark.parametrize( + "hydrogen_name", ["H HN HT1 HT2 HT3", "H HN H1", "H*"] +) +@pytest.mark.parametrize("selection", ["all", "protein and not name H HN"]) +def test_hydrogens_match_per_residue_selection(hydrogen_name, selection): + # without H and HN in the selection, the hydrogens are still looked up + # among all atoms of each residue + ag = mda.Universe(TPR, XTC).select_atoms(selection) + dssp = DSSP(ag, hydrogen_name=hydrogen_name) + expected = _hydrogens_per_residue(ag, hydrogen_name) + np.testing.assert_equal(dssp._has_hydrogen, [bool(h) for h in expected]) + np.testing.assert_equal( + dssp._first_hydrogens.ix, [h.ix[0] for h in expected if h] + ) + + +def test_coords_with_hydrogens_match_per_residue_lookup(): + # residues without a hydrogen (here the N-terminal MET, whose hydrogens + # are H1-H3, and prolines) take the guessed hydrogen of the same index + u = mda.Universe(TPR, XTC) + coords = DSSP(u, guess_hydrogens=False)._get_coords() + guessed = _get_hydrogen_atom_position(coords[:, :4]) + hydrogens = _hydrogens_per_residue(u.atoms, "H HN HT1 HT2 HT3") + assert not all(hydrogens) + expected = [ + h.positions[0] if h else guessed[k] for k, h in enumerate(hydrogens) + ] + np.testing.assert_equal(coords[:, 4], expected) From e4a8c13d235ed854167a25e8417c37b6be94788b Mon Sep 17 00:00:00 2001 From: Brady Johnston Date: Tue, 20 Oct 2026 16:22:22 +0100 Subject: [PATCH 2/6] fix for chain starts issue --- package/CHANGELOG | 5 ++ package/MDAnalysis/analysis/dssp/dssp.py | 63 ++++++++++++++----- .../MDAnalysisTests/analysis/test_dssp.py | 60 +++++++++++++++++- 3 files changed, 111 insertions(+), 17 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 9f7286d5b3..6e4ec68f2c 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -40,6 +40,11 @@ Deprecations * 2.11.0 Fixes + * DSSP treats residues that start a chain (the first residue, and any + residue more than 2.5 Å from the C atom of the residue before it: another + chain or a gap) as DSSP does: they are no hydrogen bond donors and are + not checked for a single hydrogen with ``guess_hydrogens=False``, which + rejected every system with more than one chain (Issue #XXXX, PR #XXXX) * Fixed PBC handling in triclinic boxes in `_triclinic_pbc()` (used by `distances.apply_PBC()`) and `lib.nsgrid.NSGrid` (used by `capped_distance` and `self_capped_distance`): diff --git a/package/MDAnalysis/analysis/dssp/dssp.py b/package/MDAnalysis/analysis/dssp/dssp.py index db10851a46..0ec59a1658 100644 --- a/package/MDAnalysis/analysis/dssp/dssp.py +++ b/package/MDAnalysis/analysis/dssp/dssp.py @@ -151,6 +151,7 @@ from MDAnalysis import AtomGroup, Universe from ...due import Doi, due +from ...lib.distances import calc_bonds from ..base import AnalysisBase, ResultsGroup due.cite( @@ -162,6 +163,10 @@ del Doi +#: Longest C-N distance (in Å) between consecutive residues that still counts +#: as a peptide bond; a longer one starts a new chain (the value used by DSSP) +MAX_PEPTIDE_BOND_LENGTH = 2.5 + try: # pragma: no cover from pydssp.pydssp_numpy import ( @@ -221,7 +226,7 @@ class DSSP(AnalysisBase): atom makes, and a N-H bond length of 1.01 A. If ``guess_hydrogens`` is False, hydrogen atom positions on N atoms will be parsed from the trajectory, except for the "hydrogen" atom - positions on PRO residues, and an N-terminal residue. + positions on PRO residues, and the first residue of each chain. heavyatom_names : tuple[str], default ("N", "CA", "C", "O O1 OT1") selection names that will be used to select "N", "CA", "C" and "O" atom coordinates for the secondary structure determination. The last @@ -297,6 +302,15 @@ class DSSP(AnalysisBase): Change treatment of proline and follow pydssp 0.9.1 (prolines are now explicitly forbidden to participate in the hydrogen bond network). Previous version could yield wrong assignment of prolines. + + .. versionchanged:: 2.11.0 + Residues that start a chain (the first residue, and every residue whose + N atom is more than 2.5 Å from the C atom of the residue before it, the + start of another chain or a gap) are no hydrogen bond donors, as in + DSSP, and are not checked for a single hydrogen with + ``guess_hydrogens=False``. Before, systems with more than one chain + failed that check, and the hydrogen guessed for a residue after a gap + could form spurious hydrogen bonds. """ _analysis_algorithm_is_parallelizable = True @@ -334,7 +348,6 @@ def __init__( ] for t in heavyatom_names } - self._donor_mask: np.ndarray | None = ag.residues.resnames != "PRO" self._box = self._trajectory.ts.dimensions if self._box is not None and np.allclose( self._box, [1, 1, 1, 90, 90, 90] @@ -344,6 +357,30 @@ def __init__( "Box dimensions are (1, 1, 1, 90, 90, 90), not using " "periodic boundary conditions in DSSP calculations" ) + + positions = [group.positions for group in self._heavy_atoms.values()] + if len({arr.shape[0] for arr in positions}) != 1: + raise ValueError( + "Universe contains unequal numbers of (N,CA,C,O) atoms ('name' field)." + " Please select appropriate AtomGroup manually." + ) + + # chain starts: the first residue, and every residue whose N is not + # bonded to the C of the residue before it (the start of another + # chain, or a gap), judged on the current frame. As in DSSP, they do + # not donate hydrogen bonds: they have no peptide bond from which to + # guess the position of their hydrogen + n_positions, c_positions = positions[0], positions[2] + peptide_bonds = calc_bonds( + c_positions[:-1], n_positions[1:], box=self._box + ) + self._chain_start: np.ndarray = np.concatenate( + [[True], peptide_bonds > MAX_PEPTIDE_BOND_LENGTH] + ) + self._donor_mask: np.ndarray | None = ( + ag.residues.resnames != "PRO" + ) & ~self._chain_start + # hydrogens of each residue (among all of its atoms, not only those in # ag), found with one selection: residue positions in ag.residues # (sorted by resindex), then the number per residue and the first one @@ -359,27 +396,25 @@ def __init__( if not self._guess_hydrogens: # pairs the k-th CA atom with the k-th residue. This assumes that # both are ordered in the same way, which holds as long as ag is - # sorted (it is, from the hard-coded protein selection above) + # sorted (it is, from the hard-coded protein selection above). + # Chain starts are not checked: they do not donate hydrogen bonds, + # and N-terminal residues have several hydrogens on N. calphas = self._heavy_atoms["CA"] n = min(len(calphas), len(residues)) - is_pro = calphas.resnames[1:n] == "PRO" - counts = n_hydrogens[1:n] - wrong = np.flatnonzero(np.where(is_pro, counts != 0, counts != 1)) + is_pro = calphas.resnames[:n] == "PRO" + counts = n_hydrogens[:n] + wrong = np.flatnonzero( + np.where(is_pro, counts != 0, counts != 1) + & ~self._chain_start[:n] + ) if wrong.size: - residue = calphas[wrong[0] + 1].residue + residue = calphas[wrong[0]].residue raise ValueError( f"Residue {residue} contains wrong number of hydrogens: " "exactly 1 hydrogen is expected for non-PRO residues, and " "zero hydrogens for PRO residues." ) - positions = [group.positions for group in self._heavy_atoms.values()] - if len({arr.shape[0] for arr in positions}) != 1: - raise ValueError( - "Universe contains unequal numbers of (N,CA,C,O) atoms ('name' field)." - " Please select appropriate AtomGroup manually." - ) - if len(ag.residues) < 6: raise ValueError( "DSSP requires at least 6 residues for secondary structure analysis, " diff --git a/testsuite/MDAnalysisTests/analysis/test_dssp.py b/testsuite/MDAnalysisTests/analysis/test_dssp.py index caac372a67..48ffc09fa6 100644 --- a/testsuite/MDAnalysisTests/analysis/test_dssp.py +++ b/testsuite/MDAnalysisTests/analysis/test_dssp.py @@ -6,7 +6,11 @@ import numpy as np import pytest from MDAnalysis.analysis.dssp import DSSP, assign, translate -from MDAnalysis.analysis.dssp.pydssp_numpy import _get_hydrogen_atom_position +from MDAnalysis.analysis.dssp.pydssp_numpy import ( + _get_hydrogen_atom_position, + get_hbond_map, +) +from MDAnalysis.coordinates.memory import MemoryReader from MDAnalysisTests.datafiles import DSSP as DSSP_FOLDER from MDAnalysisTests.datafiles import TPR, XTC @@ -63,9 +67,11 @@ def test_donor_mask_proline_indices(): resnames = u.select_atoms("protein").residues.resnames is_pro = resnames == "PRO" - # donor_mask should be False at proline positions and True at non-proline positions + # donor_mask should be False at proline positions and True at non-proline + # positions, except the first residue (a chain start) assert np.all(~dssp._donor_mask[is_pro]) - assert np.all(dssp._donor_mask[~is_pro]) + assert np.all(dssp._donor_mask[1:][~is_pro[1:]]) + assert not dssp._donor_mask[0] def test_donor_mask_none(): @@ -211,3 +217,51 @@ def test_coords_with_hydrogens_match_per_residue_lookup(): h.positions[0] if h else guessed[k] for k, h in enumerate(hydrogens) ] np.testing.assert_equal(coords[:, 4], expected) + + +def _protein_copies(copies, gap=100.0): + """``copies`` of the TPR/XTC protein as one system without a box, each + shifted by ``gap`` A along x, with all frames of the trajectory (made + whole: the protein is split across the box)""" + protein = mda.Universe(TPR, XTC).select_atoms("protein") + u = mda.Merge(*[protein] * copies) + frames = np.array([protein.unwrap() for _ in protein.universe.trajectory]) + coords = np.concatenate([frames] * copies, axis=1) + coords[:, :, 0] += np.repeat(np.arange(copies) * gap, protein.n_atoms) + u.load_new(coords.astype(np.float32), format=MemoryReader) + return u + + +@pytest.mark.parametrize("guess_hydrogens", [True, False]) +def test_multiple_chains(guess_hydrogens, client_DSSP): + # the N-terminal residue of the second chain (MET, with hydrogens H1-H3) + # used to fail the check of one hydrogen per residue + single = DSSP(_protein_copies(1), guess_hydrogens=guess_hydrogens) + double = DSSP(_protein_copies(2), guess_hydrogens=guess_hydrogens) + n_residues = len(single._chain_start) + np.testing.assert_equal( + np.flatnonzero(double._chain_start), [0, n_residues] + ) + expected = single.run(**client_DSSP).results.dssp + result = double.run(**client_DSSP).results.dssp + np.testing.assert_equal(result[:, :n_residues], expected) + np.testing.assert_equal(result[:, n_residues:], expected) + + +@pytest.mark.parametrize("guess_hydrogens", [True, False]) +def test_chain_breaks_do_not_donate(guess_hydrogens): + # residues after a gap have no peptide bond to the residue before them, + # so they start a chain and are no hydrogen-bond donors + protein = mda.Universe(TPR, XTC).select_atoms("protein") + after_gaps = [30, 80, 133] + keep = np.setdiff1d( + np.arange(protein.n_residues), + np.concatenate([np.arange(r - 3, r) for r in after_gaps]), + ) + dssp = DSSP(protein.residues[keep].atoms, guess_hydrogens=guess_hydrogens) + starts = [0] + [int(np.flatnonzero(keep == r)[0]) for r in after_gaps] + np.testing.assert_equal(np.flatnonzero(dssp._chain_start), starts) + assert not dssp._donor_mask[starts].any() + hbond_map = get_hbond_map(dssp._get_coords(), donor_mask=dssp._donor_mask) + # rows: donor residues (NH) + assert not hbond_map[starts].any() From 59b50f0e0c8723ccfb56f4154524d98d1af2b567 Mon Sep 17 00:00:00 2001 From: Brady Johnston Date: Tue, 20 Oct 2026 17:27:01 +0100 Subject: [PATCH 3/6] comments --- package/MDAnalysis/analysis/dssp/dssp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/MDAnalysis/analysis/dssp/dssp.py b/package/MDAnalysis/analysis/dssp/dssp.py index 0ec59a1658..fd56255761 100644 --- a/package/MDAnalysis/analysis/dssp/dssp.py +++ b/package/MDAnalysis/analysis/dssp/dssp.py @@ -163,8 +163,8 @@ del Doi -#: Longest C-N distance (in Å) between consecutive residues that still counts -#: as a peptide bond; a longer one starts a new chain (the value used by DSSP) +# Longest C-N distance (in Å) between consecutive residues that still counts +# as a peptide bond; a longer one starts a new chain (the value used by DSSP) MAX_PEPTIDE_BOND_LENGTH = 2.5 From c4a4c9c8c8ba435885ec8fbc3d189d09b4efc804 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sun, 29 Nov 2026 02:19:06 -0700 Subject: [PATCH 4/6] moved CHANGELOG entry to 2.12.0 --- package/CHANGELOG | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 6e4ec68f2c..108f6d0199 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -14,11 +14,16 @@ The rules for this file: ------------------------------------------------------------------------------- -??/??/?? IAlibay, sumitsaraswat362 +??/??/?? IAlibay, sumitsaraswat362, BradyAJohnston * 2.12.0 Fixes + * DSSP treats residues that start a chain (the first residue, and any + residue more than 2.5 Å from the C atom of the residue before it: another + chain or a gap) as DSSP does: they are no hydrogen bond donors and are + not checked for a single hydrogen with ``guess_hydrogens=False``, which + rejected every system with more than one chain (Issue #5505, PR #5506) Enhancements * InterRDF and InterRDF_s now expose computed average box volume and densities @@ -40,11 +45,6 @@ Deprecations * 2.11.0 Fixes - * DSSP treats residues that start a chain (the first residue, and any - residue more than 2.5 Å from the C atom of the residue before it: another - chain or a gap) as DSSP does: they are no hydrogen bond donors and are - not checked for a single hydrogen with ``guess_hydrogens=False``, which - rejected every system with more than one chain (Issue #XXXX, PR #XXXX) * Fixed PBC handling in triclinic boxes in `_triclinic_pbc()` (used by `distances.apply_PBC()`) and `lib.nsgrid.NSGrid` (used by `capped_distance` and `self_capped_distance`): From f3de35d96cb20cbfb7fcd5e169f7a37b35389b17 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sun, 29 Nov 2026 02:27:54 -0700 Subject: [PATCH 5/6] Update CHANGELOG: remove spurious entry from lower PR in stack --- package/CHANGELOG | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 108f6d0199..d6d25c847d 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -131,10 +131,6 @@ Fixes DSSP by porting upstream PyDSSP 0.9.1 fix (Issue #4913) Enhancements - * DSSP finds the hydrogens of all residues with one selection instead of - one per residue, so constructing DSSP is 30-50x faster, and fills in - hydrogen positions without a loop over residues for - ``guess_hydrogens=False`` (PR #XXXX) * Add reading single-frame files from mmCIF, also known as PDBx format, using crystallographic library `gemmi` as a backend (Issue #2367 and extension of #4303, also solves #5089, PR #4712). From 3ce6c82d01d16762b37f9180f8fe595fc817bb78 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sun, 29 Nov 2026 02:30:42 -0700 Subject: [PATCH 6/6] Update package/MDAnalysis/analysis/dssp/dssp.py --- package/MDAnalysis/analysis/dssp/dssp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/MDAnalysis/analysis/dssp/dssp.py b/package/MDAnalysis/analysis/dssp/dssp.py index fd56255761..34d7f8949a 100644 --- a/package/MDAnalysis/analysis/dssp/dssp.py +++ b/package/MDAnalysis/analysis/dssp/dssp.py @@ -303,7 +303,7 @@ class DSSP(AnalysisBase): forbidden to participate in the hydrogen bond network). Previous version could yield wrong assignment of prolines. - .. versionchanged:: 2.11.0 + .. versionchanged:: 2.12.0 Residues that start a chain (the first residue, and every residue whose N atom is more than 2.5 Å from the C atom of the residue before it, the start of another chain or a gap) are no hydrogen bond donors, as in