Skip to content

Commit

Permalink
Merge pull request #312 from debbiemarkslab/fix_auth_id_type
Browse files Browse the repository at this point in the history
ensure chain IDs are always str
  • Loading branch information
thomashopf authored Sep 26, 2024
2 parents 595472a + 522903b commit 188db86
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 188db86

Please sign in to comment.