Skip to content

Commit

Permalink
Fix bug in parsing pdb files
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanaba committed Aug 11, 2021
1 parent ce6bf9b commit 929dc05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ABlooper/ABlooper.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ def __extract_BB_coords(self):
i += 1
if cut[2] in self.__atoms:
j = self.__atoms.index(cut[2])
coors[i, j] = np.float_(cut[6:9])
# Using split for corrds doesn't always work. Following Biopython approach:
x = float(line[30:38])
y = float(line[38:46])
z = float(line[46:54])
coors[i, j] = np.array([x,y,z])

# If missed CB (GLY) then add CA instead
coors[:, 3] = np.where(np.all(coors[:, 3] != coors[:, 3], axis=-1, keepdims=True), coors[:, 0], coors[:, 3])
Expand Down

0 comments on commit 929dc05

Please sign in to comment.