Skip to content

Commit

Permalink
Merge pull request #241 from OpenFreeEnergy/adding_mol_name_labels_to…
Browse files Browse the repository at this point in the history
…_mapping_vis_only

adding mol name labels from ofe-name to mapping vis
  • Loading branch information
RiesBen authored Nov 22, 2023
2 parents af0d3bd + 532f988 commit 7d10127
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gufe/visualization/mapping_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ def _draw_molecules(
d2d = Draw.rdMolDraw2D.MolDraw2DCairo(
grid_x * 300, grid_y * 300, 300, 300)

# get molecule name labels
labels = [m.GetProp("ofe-name") if(m.HasProp("ofe-name"))
else "" for m in mols]

# squash to 2D
copies = [Chem.Mol(mol) for mol in mols]
for mol in copies:
Expand All @@ -170,6 +174,7 @@ def _draw_molecules(
highlightBonds=bonds_list,
highlightAtomColors=atom_colors,
highlightBondColors=bond_colors,
legends=labels,
)
d2d.FinishDrawing()
return d2d.GetDrawingText()
Expand Down

0 comments on commit 7d10127

Please sign in to comment.