Using circleAtoms highlighting and atom label colouring together #6623
Replies: 3 comments 1 reply
-
Hi,
That isn't possible, AFAIK. However, it is always possible to add extra
shapes to the drawing yourself. I don't have an example in Python, but in
C++ you can do something like:
```
drawer.drawArc(mol->getConformer().getAtomPos(3), 0.3, -72, 54);
drawer.drawArc(mol->getConformer().getAtomPos(0), 0.3, -162, -36);
drawer.drawArc(mol->getConformer().getAtomPos(4), 0.3, 126, 252);
drawer.drawArc(mol->getConformer().getAtomPos(2), 0.3, -18, 108);
```
The arguments are position, radius, start and finish angles. The latter
two would be 0.0 and 360.0 for a full circle. The radius is in the
molecule units, normally "Angstrom" and the angles are in degrees. Angle
0.0 is due east of the origin, as I was taught to do in Maths, with 90.0 at
due north. I think in Python the function is DrawArc.
HTH,
Dave
…On Fri, Aug 11, 2023 at 1:43 PM johncalpine ***@***.***> wrote:
Are there any option in rdkit to use the circleAtoms highlighting and atom
label highlighting together on a single image?
[image: Screenshot 2023-08-11 at 5 56 34 PM]
<https://user-images.githubusercontent.com/57757359/260006541-13fef95f-697b-4de9-906f-3096ee422607.png>
I generated this image with drawing options continuousHighlight = False
and circleAtoms = False. If I turn the circle atoms to True it will
highlight all atoms with circles. Actually in the above image I need the
circle highlight only for the 'I' atom. Remaining part should be coloured
as it is in the above image.
I tried turning circleAtoms to True and set the highlightAtomRadii as 0.4
for 'I' atom, and 0 for all other atoms. It highlighted only the 'I' atom
but the violet colour has gone for the 'O' and 'OH' atoms.
So Are there any option to use these highlights together on a single image?
—
Reply to this email directly, view it on GitHub
<#6623>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGF2FVYKW2CE5U34BXWC3DXUYSGJANCNFSM6AAAAAA3M3ZUEI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
David Cosgrove
Freelance computational chemistry and chemoinformatics developer
http://cozchemix.co.uk
|
Beta Was this translation helpful? Give feedback.
-
Thanks Dave. I tried the workaround provided, threed_atom_point = prepared_mol.GetConformer().GetAtomPosition(0) But its giving me the pre - condition violation error, RuntimeError: Pre-condition Violation Do you have any idea what this error is? |
Beta Was this translation helpful? Give feedback.
-
Thanks Dave. You are right. It worked. |
Beta Was this translation helpful? Give feedback.
-
Are there any option in rdkit to use the circleAtoms highlighting and atom label highlighting together on a single image?
I generated this image with drawing options continuousHighlight = False and circleAtoms = False. If I turn the circle atoms to True it will highlight all atoms with circles. Actually in the above image I need the circle highlight only for the 'I' atom. Remaining part should be coloured as it is in the above image.
I tried turning circleAtoms to True and set the highlightAtomRadii as 0.4 for 'I' atom, and 0 for all other atoms. It highlighted only the 'I' atom but the violet colour has gone for the 'O' and 'OH' atoms.
So Are there any option to use these highlights together on a single image?
Beta Was this translation helpful? Give feedback.
All reactions