Exact, Paolo. That is what I was looking for and now I understand what was
going on: All atoms had coordinates but the hydrogens didn't. To add those,
I was embedding the whole thing from scratch, and that was shuffling the
coordinates of all atoms.

Thanks,

Giammy



On Thu, 13 Jan 2022 at 13:25, Paolo Tosco <paolo.tosco.m...@gmail.com>
wrote:

> Hi Gianmarco,
>
> you can add hydrogens with coordinates keeping the current heavy atom
> coordinates with
>
> rdkit_mol = rdkit.Chem.AddHs(rdkit_mol, addCoords=True)
>
> so you may avoid having to call EmbedMolecule, which will compute a whole
> set of new coordinates for your molecule.
>
> I hope I interpreted your needs correctly!
>
> Cheers,
> p.
>
>
> On Thu, Jan 13, 2022 at 2:05 PM Gianmarco Ghiandoni <ghiandon...@gmail.com>
> wrote:
>
>> Hi all,
>>
>> Quick question: I have noticed that when I read a compound from
>> an SDF/Mol file where all coordinates are already defined, the embedding
>> process changes the conformation of the RDKit mol object, hence coordinates
>> are not preserved:
>>
>> import rdkit
>> cdk2_path = os.path.join(data_path, "cdk2_validation")
>> rdkit_mol = rdkit.Chem.MolFromMolFile(os.path.join(cdk2_path, "26Z.sdf"))
>> rdkit_mol = rdkit.Chem.AddHs(rdkit_mol)
>> rdkit.Chem.AllChem.EmbedMolecule(rdkit_mol)
>>
>> What is the best practice for reading a molecule with coordinates without
>> shuffling them? (e.g. for a ligand from the PDB).
>>
>> Thanks,
>> --
>> *Gianmarco*
>> _______________________________________________
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>

-- 
*Gianmarco*
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to