diff --git a/modules/atom/test/input/nonalttest.cif b/modules/atom/test/input/nonalttest.cif new file mode 100644 index 0000000000..b623182e8f --- /dev/null +++ b/modules/atom/test/input/nonalttest.cif @@ -0,0 +1,28 @@ +loop_ +_atom_site.group_PDB +_atom_site.id +_atom_site.type_symbol +_atom_site.label_atom_id +_atom_site.label_alt_id +_atom_site.label_comp_id +_atom_site.label_asym_id +_atom_site.label_entity_id +_atom_site.label_seq_id +_atom_site.pdbx_PDB_ins_code +_atom_site.Cartn_x +_atom_site.Cartn_y +_atom_site.Cartn_z +_atom_site.occupancy +_atom_site.B_iso_or_equiv +_atom_site.pdbx_formal_charge +_atom_site.auth_seq_id +_atom_site.auth_comp_id +_atom_site.auth_asym_id +_atom_site.auth_atom_id +_atom_site.pdbx_PDB_model_num +ATOM 1 C CA . ALA A 1 1 ? 953.312 704.510 700.259 1.00 84.31 ? 1 ALA A CA 1 +ATOM 2 C CA A GLN A 1 2 ? 862.521 620.909 612.377 1.00 10.00 ? 2 GLN A CA 1 +ATOM 3 C CA B GLN A 1 3 ? 862.521 620.909 612.377 1.00 10.00 ? 3 GLN A CA 1 +ATOM 4 C CA AA ALA A 1 4 ? 953.312 704.510 700.259 1.00 84.31 ? 4 ALA A CA 1 +ATOM 5 C CA . GLN A 1 5 ? 862.521 620.909 612.377 1.00 10.00 ? 5 GLN A CA 1 +ATOM 6 C CA . GLN A 1 6 ? 862.521 620.909 612.377 1.00 10.00 ? 6 GLN A CA 1 diff --git a/modules/atom/test/test_mmcif.py b/modules/atom/test/test_mmcif.py index 9626607ecc..13ed99fbf8 100644 --- a/modules/atom/test/test_mmcif.py +++ b/modules/atom/test/test_mmcif.py @@ -175,6 +175,21 @@ def test_multiple_ligands_no_auth(self): for x in residues], ['LYS', 'CA', '7ZTVU', '7ZTVU']) + def test_non_alt_selector(self): + """Check NonAlternativePDBSelector when reading mmCIF files""" + m = IMP.Model() + + mp = IMP.atom.read_mmcif(self.get_input_file_name('nonalttest.cif'), m, + IMP.atom.NonAlternativePDBSelector()) + residues = IMP.atom.get_by_type(mp, IMP.atom.RESIDUE_TYPE) + # Residue #3 should be rejected because its alt_loc is "B" (only + # blank or "A" alt_loc should be accepted) + # Residue #4 should be rejected because alt_loc is "AA". Previous + # versions of IMP would pass this because it would be truncated to + # one character, "A". + self.assertEqual([IMP.atom.Residue(x).get_index() for x in residues], + [1, 2, 5, 6]) + def test_chain_selector(self): """Check reading single chain from an mmCIF file""" m = IMP.Model()