Skip to content

Commit

Permalink
modify tests to use CPDB
Browse files Browse the repository at this point in the history
  • Loading branch information
a-r-j authored Feb 6, 2024
1 parent cc4fff8 commit d45de4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions graphein/protein/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ def save_rgroup_df_to_pdb(
:type gz: bool
"""
ppd = PandasPdb()
df = g.graph["rgroup_df"].copy()

# format charge correctly
df.charge = df.charge.replace("", np.nan)
Expand Down
14 changes: 10 additions & 4 deletions tests/protein/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ def test_save_graph_to_pdb():

# Check for equivalence between saved and existing DFs.
# We drop the line_idx columns as these will be renumbered
#assert_frame_equal(
# a.drop(["line_idx"], axis=1),
# g.graph["pdb_df"].drop(["line_idx", "node_id", "residue_id"], axis=1),
#)
assert_frame_equal(
a.drop(["line_idx"], axis=1),
g.graph["pdb_df"].drop(["line_idx", "node_id", "residue_id"], axis=1),
a, g.graph["pdb_df"].drop(["node_id", "residue_id", axis=1])
)
h = construct_graph(path="/tmp/test_graph.pdb")

Expand All @@ -48,9 +51,12 @@ def test_save_pdb_df_to_pdb():
assert os.path.isfile("/tmp/test_graph.pdb")

# We drop the line_idx columns as these will be renumbered
#assert_frame_equal(
# a.drop(["line_idx"], axis=1),
# g.graph["pdb_df"].drop(["line_idx", "node_id", "residue_id"], axis=1),
#)
assert_frame_equal(
a.drop(["line_idx"], axis=1),
g.graph["pdb_df"].drop(["line_idx", "node_id", "residue_id"], axis=1),
a, g.graph["pdb_df"].drop(["node_id", "residue_id", axis=1])
)

# Now check for raw, unprocessed DF
Expand Down

0 comments on commit d45de4f

Please sign in to comment.