Чтобы получить углы от молекулы, она должна иметь как минимум 2D-координаты, rdkit не имеет возможности построить молекулу из файла XYZ, но может читать строки SMILES.
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdMolTransforms
# Read molecule from smiles string
mol = Chem.MolFromSmiles('N1CCNCC1')
# Get all bonds in the molecule
bonds = [(x.GetBeginAtomIdx(), x.GetEndAtomIdx()) for x in mol.GetBonds()]
# [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 0)]
# Compute 2D coordinates
AllChem.Compute2DCoords(mol)
conf = mol.GetConformer()
# Get a torsion angle between atoms 0, 1 & 2
rdMolTransforms.GetAngleDeg(conf, 0, 1, 2)
# 119.99999999999999
# Get a dihedral angle between atoms 0, 1, 2 & 3
rdMolTransforms.GetDihedralDeg(c, 0, 1, 2, 3)
# -0.0 (obviously 0 as the molecule has no 3D coordinates)
При необходимости вы можете генерировать трехмерные координаты для молекулы, или вы можете читать молекулы с трехмерными координатами, используя файл SDF или аналогичный. Программное обеспечение openbabel может конвертировать XYZ в SDF