Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 16, 2024
1 parent b244c37 commit c8d591c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions graphein/protein/edges/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def add_disulfide_interactions(


def add_hydrogen_bond_interactions(
G: nx.Graph, rgroup_df: Optional[pd.DataFrame] = None
G: nx.Graph, rgroup_df: Optional[pd.DataFrame] = None
):
rgroup_df = G.graph["raw_pdb_df"]
HBOND_ATOMS = [
Expand Down Expand Up @@ -405,19 +405,20 @@ def add_hydrogen_bond_interactions(
for r1, r2 in get_edges_by_bond_type(G, "hbond"):
# print(G.nodes.data())
condition1 = (
G.nodes[r1]["atom_type"] in ACCEPTORS_ATOM
and G.nodes[r2]["atom_type"] in DONORS_ATOM
G.nodes[r1]["atom_type"] in ACCEPTORS_ATOM
and G.nodes[r2]["atom_type"] in DONORS_ATOM
)
condition2 = (
G.nodes[r2]["atom_type"] in ACCEPTORS_ATOM
and G.nodes[r1]["atom_type"] in DONORS_ATOM
G.nodes[r2]["atom_type"] in ACCEPTORS_ATOM
and G.nodes[r1]["atom_type"] in DONORS_ATOM
)
is_ionic = condition1 or condition2
if not is_ionic:
G.edges[r1, r2]["kind"].remove("hbond")
if len(G.edges[r1, r2]["kind"]) == 0:
G.remove_edge(r1, r2)


def add_ionic_interactions(
G: nx.Graph, rgroup_df: Optional[pd.DataFrame] = None
):
Expand Down

0 comments on commit c8d591c

Please sign in to comment.