Re: [Rdkit-discuss] Problems reading XYZ file

2023-05-03 Thread Gustavo Seabra
Hi Guys,

I'm sorry it took me this long to try it... But I could finally get to it,
and it works well now. Thanks for your help!
--
Gustavo Seabra.


On Tue, Apr 11, 2023 at 3:19 AM Jan Halborg Jensen 
wrote:

> Hi Gustavo
>
> raw_mol = Chem.MolFromXYZFile('acetate.xyz')
> mol = Chem.Mol(raw_mol)
> rdDetermineBonds.DetermineBonds(mol,charge=-1)
>
> Best regards, Jan
>
> On 7 Apr 2023, at 22.57, Gustavo Seabra  wrote:
>
> Hi everyone,
>
> I'm having difficulties using RDKit to read molecules from an XYZ file,
> and I would really appreciate some help.
>
> The problem is that whenever i read a molecule from an XYZ file, I get
> just a disconnected clump of atoms, not a molecule. For example: the
> following code:
>
> import rdkit
> from rdkit import Chem
> from rdkit.Chem import Draw, rdmolfiles
> mol = Chem.MolFromSmiles('COC1=C(O)C[C@@](O)(CO)CC1=O')
> mol = Chem.AddHs(mol)
> mol
>
> 
>
> Chem.AllChem.EmbedMolecule(mol)
> Chem.MolToXYZFile(mol, "rdkit_mol.xyz")
> mol2 = Chem.MolFromXYZFile('rdkit_mol.xyz')
> mol2
> 
> Is there a bug on the XYZ code, or am I missing something?
>
> Thanks!
> --
> Gustavo Seabra.
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Frdkit-discuss&data=05%7C01%7Cjhjensen%40chem.ku.dk%7Ca747765687134eda68a708db37ab1ba1%7Ca3927f91cda14696af898c9f1ceffa91%7C0%7C0%7C638164980266752900%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FKeB%2FR%2FQzRDYIe9zpZfKMqbjNYULOH4VQ5jhfJmxK6I%3D&reserved=0
>
>
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Problems reading XYZ file

2023-04-11 Thread Jan Halborg Jensen
Hi Gustavo

raw_mol = Chem.MolFromXYZFile('acetate.xyz')
mol = Chem.Mol(raw_mol)
rdDetermineBonds.DetermineBonds(mol,charge=-1)

Best regards, Jan

On 7 Apr 2023, at 22.57, Gustavo Seabra 
mailto:gustavo.sea...@gmail.com>> wrote:

Hi everyone,

I'm having difficulties using RDKit to read molecules from an XYZ file, and I 
would really appreciate some help.

The problem is that whenever i read a molecule from an XYZ file, I get just a 
disconnected clump of atoms, not a molecule. For example: the following code:

import rdkit
from rdkit import Chem
from rdkit.Chem import Draw, rdmolfiles
mol = Chem.MolFromSmiles('COC1=C(O)C[C@@](O)(CO)CC1=O')
mol = Chem.AddHs(mol)
mol



Chem.AllChem.EmbedMolecule(mol)
Chem.MolToXYZFile(mol, "rdkit_mol.xyz")
mol2 = Chem.MolFromXYZFile('rdkit_mol.xyz')
mol2

Is there a bug on the XYZ code, or am I missing something?

Thanks!
--
Gustavo Seabra.
___
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


[Rdkit-discuss] Problems reading XYZ file

2023-04-07 Thread Gustavo Seabra
Hi everyone,

I'm having difficulties using RDKit to read molecules from an XYZ file, and
I would really appreciate some help.

The problem is that whenever i read a molecule from an XYZ file, I get just
a disconnected clump of atoms, not a molecule. For example: the following
code:

import rdkit
from rdkit import Chem
from rdkit.Chem import Draw, rdmolfiles
mol = Chem.MolFromSmiles('COC1=C(O)C[C@@](O)(CO)CC1=O')
mol = Chem.AddHs(mol)
mol

[image: image.png]

Chem.AllChem.EmbedMolecule(mol)
Chem.MolToXYZFile(mol, "rdkit_mol.xyz")
mol2 = Chem.MolFromXYZFile('rdkit_mol.xyz')
mol2
[image: image.png]
Is there a bug on the XYZ code, or am I missing something?

Thanks!
--
Gustavo Seabra.
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss