def get_residues_fromsel(selection):
	"""
	From a selection of atoms from ProDy
	Returns a set containing unique "residues names"
	(formatted as PDB: RESNAME CHAIN RESNUM)
	"""
	list_residues = []
	for i in range(0, len(selection)):
		list_residues.append(("{0:<3s} {1}{2:>4d}".format(selection.getResnames()[i], selection.getChids()[i],
			selection.getResnums()[i])))
	uniq = set(list_residues)

	return uniq