[Rdkit-discuss] PostDoc position in my group

2022-08-11 Thread Czodrowski, Prof. Dr. Paul
Dear RDKitters,

if I may so, I would like to post something off-topic to this fantastic list.

We currently have one vacancy for a (of course, RDKit-heavy!) PostDoc position 
in my group:
https://stellenboerse.uni-mainz.de/HPv3.Jobs/jgu/stellenangebot/25442/PostDoc-m-w-d?lang=en-US

Best regards,
Paul
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Using DrawAttachmentLine for bidentate ligands

2022-08-11 Thread Paolo Tosco
Hi Geoff,

you can indeed use DrawWavyLine() coupled to some basic 2D geometry as in
the example below:

from rdkit import Chem
from rdkit.Geometry import Point3D, Point2D
from rdkit.Chem.Draw import rdDepictor, rdMolDraw2D
from IPython.display import SVG

mol = Chem.MolFromSmiles("C12=CC=CC=[N]1->[*]<-[N]3=C2C=CC=C3")

rdDepictor.Compute2DCoords(mol)
0

dative_bonds = [b for b in mol.GetBonds() if b.GetBondType() ==
Chem.BondType.DATIVE]

def draw_attachment_line(mol, drawer, bond, wavy_color=(0.0, 0.0, 0.0),
n_segments=12, offset=0.07, wavy_len=0.8):
bi = bond.GetBeginAtomIdx()
ei = bond.GetEndAtomIdx()
bc = mol.GetConformer().GetAtomPosition(bi)
ec = mol.GetConformer().GetAtomPosition(ei)
bv = bc - ec
bv.Normalize()
midpoint = (bc + ec) * 0.5
ba = midpoint + Point3D(bv.y, -bv.x, 0.0) * (wavy_len * 0.5)
ea = midpoint + Point3D(-bv.y, bv.x, 0.0) * (wavy_len * 0.5)
drawer.DrawWavyLine(Point2D(ba.x, ba.y), Point2D(ea.x, ea.y),
wavy_color, wavy_color, n_segments, offset)

drawer = rdMolDraw2D.MolDraw2DSVG(500, 300)
drawer.DrawMolecule(mol)
for bond in dative_bonds:
draw_attachment_line(mol, drawer, bond)
drawer.FinishDrawing()
SVG(drawer.GetDrawingText())
[image: image.png]

You can tweak the default offset of waves, the number of waves and the
length of the wavy bond through the relevant parameters in
draw_attachment_line().

Cheers,
p.

On Wed, Aug 10, 2022 at 5:22 PM Geoffrey Hutchison <
geoff.hutchi...@gmail.com> wrote:

> I've been using RDKit for depicting sets of ligands from SMILES, which has
> been great.
>
> I'd like to add some bidentate and tridentate ligands. Let's stick to
> bipyridine at first (see image)
>
>
> I have the appropriate SMILES, leaving * as part of a 5 atom ring
> involving the nitrogen atoms (and sanitize = False)
> C12=CC=CC=[N]1[*][N]3=C2C=CC=C3
>
> The resulting depiction is great .. except I'd like to add the attachment
> "squiggles" across the N-* bonds.
>
> I see there are DrawAttachmentLine and DrawWavyLine methods, but I'd need
> to get the positions of the N and * atoms.
>
> What's the best way to do that and / or automate adding wavy lines across
> arbitrary bonds?
>
> Thanks,
> -Geoff
>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Using DrawAttachmentLine for bidentate ligands

2022-08-11 Thread David Cosgrove
Hi Geoff,
The drawer has the GetDrawCoords() method.  There are 2 overloads, one
takes a Point2D, the other an atom index, and both return the coordinates
in the drawers reference frame.  Assuming you're working in Python.  In
C++, they're getDrawCoords().
https://www.rdkit.org/docs/source/rdkit.Chem.Draw.rdMolDraw2D.html

Dave


On Wed, Aug 10, 2022 at 4:22 PM Geoffrey Hutchison <
geoff.hutchi...@gmail.com> wrote:

> I've been using RDKit for depicting sets of ligands from SMILES, which has
> been great.
>
> I'd like to add some bidentate and tridentate ligands. Let's stick to
> bipyridine at first (see image)
>
>
> I have the appropriate SMILES, leaving * as part of a 5 atom ring
> involving the nitrogen atoms (and sanitize = False)
> C12=CC=CC=[N]1[*][N]3=C2C=CC=C3
>
> The resulting depiction is great .. except I'd like to add the attachment
> "squiggles" across the N-* bonds.
>
> I see there are DrawAttachmentLine and DrawWavyLine methods, but I'd need
> to get the positions of the N and * atoms.
>
> What's the best way to do that and / or automate adding wavy lines across
> arbitrary bonds?
>
> Thanks,
> -Geoff
>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>


-- 
David Cosgrove
Freelance computational chemistry and chemoinformatics developer
http://cozchemix.co.uk
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss