Re: [Rdkit-discuss] Problems reading XYZ file
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: Jan H. J. <jhj...@ch...> - 2023-04-11 09:53:50
|
Hi Gustavo raw_mol = Chem.MolFromXYZFile('acetate.xyz<http://acetate.xyz/>') mol = Chem.Mol(raw_mol) rdDetermineBonds.DetermineBonds(mol,charge=-1) Best regards, Jan On 7 Apr 2023, at 22.57, Gustavo Seabra <gus...@gm...<mailto:gus...@gm...>> 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 <image.png> Chem.AllChem.EmbedMolecule(mol) Chem.MolToXYZFile(mol, "rdkit_mol.xyz<http://rdkit_mol.xyz/>") mol2 = Chem.MolFromXYZFile('rdkit_mol.xyz<http://rdkit_mol.xyz/>') mol2 <image.png> Is there a bug on the XYZ code, or am I missing something? Thanks! -- Gustavo Seabra. _______________________________________________ Rdkit-discuss mailing list Rdk...@li...<mailto:Rdk...@li...> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss |