Skip to content

Commit

Permalink
Merge branch 'master' into cif-singleton-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
avirshup authored Oct 12, 2017
2 parents ec49a02 + 5cbeab2 commit 27b2856
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Binary file added moldesign/_tests/data/3b5x.cif.bz2
Binary file not shown.
7 changes: 7 additions & 0 deletions moldesign/_tests/test_pdb_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ def test_single_chain_2p8w():
assert mol.chains['C'].num_residues == 1
assert mol.chains['C'].residues['GNP843'].num_atoms == 32


def test_missing_atoms_3b5x():
mol = mdt.read(get_data_path('3b5x.cif.bz2'))
assert mol.num_chains == 2
assert mol.num_atoms == 1144
assert mol.num_residues == 1144


MISSINGRES_2JAJ = [('A', 'GLY', -4), ('A', 'PRO', -3), ('A', 'LEU', -2), ('A', 'GLY', -1),
('A', 'MET', 0), ('A', 'ALA', 1), ('A', 'GLY', 2), ('A', 'LEU', 3),
Expand Down
5 changes: 2 additions & 3 deletions moldesign/molecules/residue.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,10 @@ def _is_ending_residue(self):
except KeyError:
# If we're here, the residue is missing some atoms. We'll fall back to checking the
# next residues in line
if self.index == len(self.molecule.residues):
if self.index == len(self.molecule.residues) - 1:
return True
else:
print('WARNING: %s is missing expected atoms. Attempting to infer chain end' % \
self)
print('WARNING: %s is missing expected atoms. Attempting to infer chain end' % self)
nextres = self.molecule.residues[self.index + 1]
return not self._same_polymer(nextres)

Expand Down

0 comments on commit 27b2856

Please sign in to comment.