Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chi1_selections fails for residues with CG1 #4108

Closed
DanielJamesEvans opened this issue Mar 31, 2023 · 0 comments · Fixed by #4109
Closed

chi1_selections fails for residues with CG1 #4108

DanielJamesEvans opened this issue Mar 31, 2023 · 0 comments · Fixed by #4109

Comments

@DanielJamesEvans
Copy link
Contributor

Expected behavior

I expect the single-residue chi1_selection and the multi-residue chi1_selections (notice the "s") to function identically for a given residue. Both should recognize CG1 as the fourth atom of the dihedral.

Actual behavior

The multi-residue chi1_selections returns None for residues with CG1. But the single-residue chi1_selection is correct, thanks to #3238.

Code to reproduce the behavior

import MDAnalysis as mda
from MDAnalysis.tests.datafiles import PSF, DCD
u = mda.Universe(PSF, DCD)

# This gives the correct result.
print(u.residues[38].chi1_selection())

# This incorrectly returns `None`.
print(u.residues[38:39].chi1_selections())

Current version of MDAnalysis

I'm using version MDAnalysis version 2.3.0. The bug is also present in the source code for 2.5.0-dev0.

DanielJamesEvans pushed a commit to DanielJamesEvans/mdanalysis that referenced this issue Apr 1, 2023
orbeckst pushed a commit that referenced this issue Apr 6, 2023
* Fixes #4108
* recognize additional atom names (CG1 OG OG1 SG ) for chi1_selections() so that it works for 
  amino acids CYS, ILE, SER, THR, VAL instead of returning None (Issue #4108)
* performance improvement: make chi1_selection() faster using np functions instead of select_atoms()
* add tests for new residues
* update AUTHORS
* update CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants