You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DSSP: multi-chain systems fail with guess_hydrogens=False, and residues after a gap form spurious H-bonds #5505
That the DSSP handles a protein with more than one chain, or gaps (missing residues) as the original DSSP does: the first residue of a chain and the first residue after a break aren't hydrogen bond donors.
Actual behavior
DSSP treats the whole selection as one continuous chain, and exempts only its first residue. This causes two problems:
guess_hydrogens=False rejects every system with more than one chain
guess_hydrogen=True the first residue of each later chain and each residue after a gap still donate hydrogens
Code to reproduce the behavior
importwarningsimportMDAnalysisasmdaimportnumpyasnpfromMDAnalysis.analysis.dsspimportDSSPfromMDAnalysisTests.datafilesimportTPR, XTCwarnings.filterwarnings("ignore")
protein=mda.Universe(TPR, XTC).select_atoms("protein")
protein.unwrap() # the protein is split across the periodic box# 1. two chains: the second chain's N-terminal MET has three hydrogenstwo_chains=mda.Merge(protein, protein)
two_chains.atoms[protein.n_atoms :].translate([100, 0, 0])
try:
DSSP(two_chains, guess_hydrogens=False)
print("1. two chains, guess_hydrogens=False: OK")
exceptValueErrorase:
print(f"1. two chains, guess_hydrogens=False: ValueError: {e}")
# 2. residues 78-80 (indices 77-79) removed: residue 81 follows the gapn=protein.n_residuesintact="".join(DSSP(mda.Merge(protein)).run().results.dssp[0])
keep=np.r_[0:77, 80:n]
gapped="".join(
DSSP(mda.Merge(protein.residues[keep].atoms)).run().results.dssp[0]
)
print("2. intact chain, and with residues 78-80 removed:")
fori, originalin [(1, 1), (77, 80)]:
residue=protein.residues[original]
print(
f" {residue.resname}{residue.resid}: intact {intact[original]!r}, "f"with the gap {gapped[i]!r}"
)
1. two chains, guess_hydrogens=False: ValueError: Residue <Residue MET, 1> contains wrong number of hydrogens: exactly 1 hydrogen is expected for non-PRO residues, and zero hydrogens for PRO residues.
2. intact chain, and with residues 78-80 removed:
ARG 2: intact '-', with the gap 'E'
PHE 81: intact '-', with the gap 'E'
Current version of MDAnalysis
MDAnalysis 2.11.0-dev0 (develop, 6cd1f7e58); also seen with 2.10.0
Activity