Skip to content

Commit

Permalink
Fix for newer versions of BioPandas
Browse files Browse the repository at this point in the history
  • Loading branch information
samgelman committed Jan 5, 2024
1 parent df4e2ff commit 92d26ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/gen_structure_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def cbeta_distance_matrix(pdb_fn, start=0, end=None):
# loop through each residue and find the coordinates of cbeta
for i, (residue_number, values) in enumerate(grouped):

# later versions of biopandas are returning the residue_number
# as a tuple, so convert it to a single integer
if isinstance(residue_number, tuple) and len(residue_number) == 1:
residue_number = residue_number[0]

# skip residues not in the range
end_index = (len(grouped) if end is None else end)
if i not in range(start, end_index):
Expand Down

0 comments on commit 92d26ba

Please sign in to comment.