Skip to content

Commit

Permalink
ensure chain IDs are always str
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashopf committed Sep 26, 2024
1 parent 595472a commit 522903b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion evcouplings/compare/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,12 @@ def __init__(self, filehandle, keep_full_data=False):
# decode information into dataframe with BioPython helper method
self.atom_table = pd.DataFrame({
name: _decode(data[source_column]) for source_column, name in ATOM_TARGET_COLS.items()
})
}).assign(
# make sure chain identifiers are strings, in some pathologic cases, these are int rather than str
# (e.g. entry 6swy)
auth_asym_id=lambda df: df.auth_asym_id.astype(str),
label_asym_id=lambda df: df.label_asym_id.astype(str),
)

# decode information into dataframe with BioPython helper method; note this section may not be
# present if no helices exist in the structure
Expand Down

0 comments on commit 522903b

Please sign in to comment.