def residue_depth(residue, surface):
 atom_list = residue.get_unpacked_list()
 length = len(atom_list)
 d = 0
 for atom in atom_list:
  coord = atom.get_coord()
  d = (d + min_dist(coord, surface))
 return (d / length)

def residue_depth ( residue , surface ) : atom_list = residue . get_unpacked_list ( ) length = len ( atom_list ) d = 0 for atom in atom_list : coord = atom . get_coord ( ) d = ( d + min_dist ( coord , surface ) ) return ( d / length )
return average distance to surface for all atoms in a residue .