-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
status: backlogThings we will work on, but not right nowThings we will work on, but not right now
Description
Setting the image size in pixels to a larger number (e.g. for a scientific poster) makes the molecule depiction thin and small
structure_heatmap_shap(explanation, width=2000, height=2000)
instead of the default 600x600 pixels.
Adding the last three lines to the drawer option seems to fix the problem for this particular case.
drawer = Draw.MolDraw2DCairo(width, height)
# Coloring atoms of element 0 to 100 black
drawer.drawOptions().updateAtomPalette({i: (0, 0, 0, 1) for i in range(100)})
draw_opt = drawer.drawOptions()
draw_opt.padding = 0.2
draw_opt.bondLineWidth = 7
draw_opt.minFontSize= 65
draw_opt.additionalAtomLabelPadding = 0.1
However, this is not an automated way to scale bond line width and font size with pixel size. I see three options here:
- There is a way to automatically scale bond line width and font size in RDKit. A more recent blog post
- Scale the parameters with some transformation that we determine empirically.
minFontSize
seems to scale quadratically with pixels but bondLineWidth isn't. - Let the user decide and make the drawOptions a parameter to
structure_heatmap_shap
.
Metadata
Metadata
Assignees
Labels
status: backlogThings we will work on, but not right nowThings we will work on, but not right now