Skip to content

Commit

Permalink
Update test_atomselections.py
Browse files Browse the repository at this point in the history
Added tests for sugar selection
  • Loading branch information
talagayev authored Nov 15, 2024
1 parent 70b70be commit a56a95f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions testsuite/MDAnalysisTests/core/test_atomselections.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
PDB_helix,
PDB_elements,
PDB_charges,
GLYCAM,
SUGAR_PDB,
)
from MDAnalysisTests import make_Universe

Expand Down Expand Up @@ -1522,3 +1524,21 @@ def test_formal_charge_selection(sel, size, name):

assert len(ag) == size
assert ag.atoms[0].name == name


def test_sugar_glycam_selection():
u = mda.Universe(GLYCAM)

ag_token = u.select_atoms("sugar")
ag_ref = u.select_atoms("resname ROH or resname 3RA or resname 0MB")

assert ag_token == ag_ref


def test_sugar_pdb_selection():
u = mda.Universe(SUGAR_PDB)

ag_token = u.select_atoms("sugar")
ag_ref = u.select_atoms("resname NAG or resname BMA or resname MAN")

assert ag_token == ag_ref

0 comments on commit a56a95f

Please sign in to comment.