diff --git a/code/gen_structure_graph.py b/code/gen_structure_graph.py index d37c3dd..f63f87d 100644 --- a/code/gen_structure_graph.py +++ b/code/gen_structure_graph.py @@ -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):