vmd.atomsel.bonds

atomsel.bonds

For each atom in selection, a list of the indices of atoms to which it is bonded. To set bonds, pass a sequence with length of the number of atoms in the selection, with each entry in the sequence being a list or tuple containing the atom indices to which that atom in the selection is bound

For example, for a water molecule with atoms H-O-H: >>> sel = atomsel(‘water and residue 0’) >>> sel.bonds = [(1), (0,2), (1)]