Hey everyone I need some help formatting coordinates for atoms in a molecule and I'm coding with Python. What I am needing is along the lines of:
(atom) x y z coordinates
For every atom in the molecule. So far my code is:
for molecule in mol_list:
molecule = Chem.AddHs(molecule)
print(molecule.GetNumAtoms())
AllChem.EmbedMolecule(molecule)
AllChem.UFFOptimizeMolecule(molecule)
molecule.GetConformer()
print()
for atom in molecule.GetAtoms():
# positions = molecule.GetConformer().GetAtomPosition(0)
positions = molecule.GetConformer().GetPositions()
print(atom.GetSymbol(), positions)
print()
But this gives me the output of:
(Atom) x y z coordinates for every atom
This repeats so that every atom in the molecule has the entire molecule's x, y, and z coordinates. mol_list
in the for
loop is a list of strings that I converted to the object: rdkit.Chem.rdchem.Mol
. I've tried the geometry.xyz
function in Chemml
, but ran into issues with the Molecule object. Also, I've tried using the RdKit
function getAtomPos()
with no luck. Any help with this would be awesome!