Skip to content

Commit

Permalink
chore: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cbouy committed Dec 29, 2024
1 parent 9cb60d2 commit 711e037
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions prolif/interactions/water_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ def _merge_metadata(
for data, role in [
(data_lw, "protein"),
(data_wp, "ligand"),
*it.chain.from_iterable([
[(data_ww, "ligand"), (data_ww, "protein")] for data_ww in data_ww_args
]),
*it.chain.from_iterable(
[
[(data_ww, "ligand"), (data_ww, "protein")]
for data_ww in data_ww_args
]
),
]:
resid = getattr(data, role)
water_indices[str(resid)].update(data.metadata["indices"][role])
Expand All @@ -231,24 +234,28 @@ def _merge_metadata(
set().union(
data_lw.metadata["parent_indices"]["protein"],
data_wp.metadata["parent_indices"]["ligand"],
*it.chain.from_iterable([
*it.chain.from_iterable(
[
data_ww.metadata["parent_indices"]["ligand"],
data_ww.metadata["parent_indices"]["protein"],
[
data_ww.metadata["parent_indices"]["ligand"],
data_ww.metadata["parent_indices"]["protein"],
]
for data_ww in data_ww_args
]
for data_ww in data_ww_args
]),
),
)
),
},
"water_residues": tuple(
dict.fromkeys( # uniquify but keep order
[
data_lw.protein,
*it.chain.from_iterable([
[data_ww.ligand, data_ww.protein]
for data_ww in data_ww_args
]),
*it.chain.from_iterable(
[
[data_ww.ligand, data_ww.protein]
for data_ww in data_ww_args
]
),
data_wp.ligand,
]
)
Expand All @@ -262,10 +269,12 @@ def _merge_metadata(
f"{key}{suffix}": data.metadata[key]
for suffix, data in [
(f"_ligand_{data_lw.protein}", data_lw),
*it.chain.from_iterable([
[(f"_{data_ww.ligand}_{data_ww.protein}", data_ww)]
for data_ww in data_ww_args
]),
*it.chain.from_iterable(
[
[(f"_{data_ww.ligand}_{data_ww.protein}", data_ww)]
for data_ww in data_ww_args
]
),
(f"_{data_wp.ligand}_protein", data_wp),
]
for key in ["distance", "DHA_angle"]
Expand Down

0 comments on commit 711e037

Please sign in to comment.