Skip to content
This repository
Browse code

MMCIFParser: store models as ints.

  • Loading branch information...
commit c0d60c68c77b7309e9ce18e0030e98686f6f23bc 1 parent a9eb35a
Lenna Peterson lennax authored

Showing 2 changed files with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +1 1  Bio/PDB/MMCIFParser.py
  2. +4 4 Tests/test_MMCIF.py
2  Bio/PDB/MMCIFParser.py
@@ -34,7 +34,7 @@ def _build_structure(self, structure_id):
34 34 b_factor_list=mmcif_dict["_atom_site.B_iso_or_equiv"]
35 35 occupancy_list=mmcif_dict["_atom_site.occupancy"]
36 36 fieldname_list=mmcif_dict["_atom_site.group_PDB"]
37   - model_list = mmcif_dict["_atom_site.pdbx_PDB_model_num"]
  37 + model_list = [int(n) for n in mmcif_dict["_atom_site.pdbx_PDB_model_num"]]
38 38 try:
39 39 aniso_u11=mmcif_dict["_atom_site.aniso_U[1][1]"]
40 40 aniso_u12=mmcif_dict["_atom_site.aniso_U[1][2]"]
8 Tests/test_MMCIF.py
@@ -47,7 +47,7 @@ def test_parser(self):
47 47 for ppbuild in [PPBuilder(), CaPPBuilder()]:
48 48 #==========================================================
49 49 #First try allowing non-standard amino acids,
50   - polypeptides = ppbuild.build_peptides(structure['1'], False)
  50 + polypeptides = ppbuild.build_peptides(structure[1], False)
51 51 self.assertEqual(len(polypeptides), 1)
52 52 pp = polypeptides[0]
53 53 # Check the start and end positions
@@ -64,7 +64,7 @@ def test_parser(self):
64 64 #Now try strict version with only standard amino acids
65 65 #Should ignore MSE 151 at start, and then break the chain
66 66 #at MSE 185, and MSE 214,215
67   - polypeptides = ppbuild.build_peptides(structure['1'], True)
  67 + polypeptides = ppbuild.build_peptides(structure[1], True)
68 68 self.assertEqual(len(polypeptides), 3)
69 69 #First fragment
70 70 pp = polypeptides[0]
@@ -99,7 +99,7 @@ def testModels(self):
99 99 for ppbuild in [PPBuilder(), CaPPBuilder()]:
100 100 #==========================================================
101 101 #First try allowing non-standard amino acids,
102   - polypeptides = ppbuild.build_peptides(structure['1'], False)
  102 + polypeptides = ppbuild.build_peptides(structure[1], False)
103 103 self.assertEqual(len(polypeptides), 1)
104 104 pp = polypeptides[0]
105 105 # Check the start and end positions
@@ -114,7 +114,7 @@ def testModels(self):
114 114 str(s))
115 115 #==========================================================
116 116 #Now try strict version with only standard amino acids
117   - polypeptides = ppbuild.build_peptides(structure['1'], True)
  117 + polypeptides = ppbuild.build_peptides(structure[1], True)
118 118 self.assertEqual(len(polypeptides), 1)
119 119 pp = polypeptides[0]
120 120 # Check the start and end positions

0 comments on commit c0d60c6

Please sign in to comment.
Something went wrong with that request. Please try again.