Re: [Rdkit-discuss] Keeping 3D coordinates from sdf file

2020-08-24 Thread Puck van Gerwen
Hi Paolo, That works perfectly, thanks a lot! Best regards Puck On Fri, 21 Aug 2020 at 23:49, Paolo Tosco wrote: > Hi Puck, > > here's a gist that shows how to do an unconstrained minimization (first > example, all atoms move) and one where all heavy atoms are fixed to their > initial position

Re: [Rdkit-discuss] Keeping 3D coordinates from sdf file

2020-08-21 Thread Paolo Tosco
Hi Puck, here's a gist that shows how to do an unconstrained minimization (first example, all atoms move) and one where all heavy atoms are fixed to their initial position (second example, only hydrogens move). https://gist.github.com/ptosco/eeaf8ce92f19b10702f58e45e393366a Cheers, p. On Fri, A

Re: [Rdkit-discuss] Keeping 3D coordinates from sdf file

2020-08-21 Thread Sunhwan Jo
You can use “addCoords=True” in your addHs call. http://rdkit.org/docs/source/rdkit.Chem.rdmolops.html#rdkit.Chem.rdmolops.AddHs Sunhwan > On Aug 21, 2020, at 6:11 AM, Puck van Gerwen wrote: > > Hi Paolo, >

Re: [Rdkit-discuss] Keeping 3D coordinates from sdf file

2020-08-21 Thread Puck van Gerwen
Hi Paolo, That works, thank you. I have a related question - after reading in molecules with their coordinates, I remove hydrogens to make them implicit. I later want to add the hydrogens back on and only optimise these, leaving the heavy atoms alone. I tried to do this with an ethyne molecule whe

Re: [Rdkit-discuss] Keeping 3D coordinates from sdf file

2020-08-20 Thread Paolo Tosco
Hi Puck, When you read a SDF file using a SDMolSupplier RDKit will retain 3D coordinates. You can access them from the mol Conformer (a molecule can have multiple Conforrmers; one is generated for you when you read a set of coordinates): mol.GetConformer().GetAtomPosition(atom_idx) If you wis

[Rdkit-discuss] Keeping 3D coordinates from sdf file

2020-08-20 Thread Puck van Gerwen
Dear rdkit, I am wondering whether after reading a molecule from an sdf file, it is possible to keep the original 3d coordinates that were in that sdf file? I will modify the molecules (fragment bonds and saturate with hydrogen) but as much as possible I want to keep the original coordinates. For