Esempio n. 1
0
 def conf2xyz(conf: Chem.Conformer,
              outputname,
              atom_list: list,
              comment_line=''):
     natoms = conf.GetNumAtoms()
     s = "{}\n{}\n".format(natoms, comment_line)
     for i in range(natoms):
         position = conf.GetAtomPosition(i)
         symbol = atom_list[i]
         s += "{}\t{:.6} {:.6} {:.6}\n".format(symbol, position.x,
                                               position.y, position.z)
     with open(outputname, 'w') as f:
         f.write(s)
Esempio n. 2
0
def atom_coords(atom: Chem.Atom, conf: Chem.Conformer) -> List[float]:
    """Returns the x, y, and z coordinates of an atom in a molecule conformer.
    """
    p = conf.GetAtomPosition(atom.GetIdx())
    fts = [p.x, p.y, p.z]
    return fts