Skip to content

chi1_selection() fails for some residues #3238

@orbeckst

Description

@orbeckst

Expected behavior

ag.chi1_selection() should produce a selection for all standard protein residues (except GLY and PRO).

Actual behavior

The following residues return None instead of a valid selection:

  • ALA
  • CYSH
  • GLY
  • ILE
  • SER
  • THR
  • VAL

for the example TPR/XTC. (Others might also be affected.)

The problem is that chi1_selection() checks for CG but these residues can contain CG1, CG2 etc.

Code to reproduce the behavior

import MDAnalysis as mda; from MDAnalysis.tests import datafiles as data
u = mda.Universe(data.TPR, data.XTC)

for resname in sorted(set(u.residues.resnames)):
    res = u.select_atoms(f"resname {resname}").residues
    # get middle one
    r = res[len(res)//2]
    #print(r, r.chi1_selection() is None)
    if r.chi1_selection() is None:
        print(r.resname)

Current version of MDAnalysis

  • Which version are you using? (run python -c "import MDAnalysis as mda; print(mda.__version__)") 1.0.1 (also 1.0.0)
  • Which version of Python (python -V)? 3.8.5
  • Which operating system? macOS 10.15.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions