get a list of mapped reads

def sam_list(sam):
	"""
	get a list of mapped reads
	"""
	list = []
	for file in sam:
		for line in file:
			if line.startswith('@') is False:
				line = line.strip().split()
				id, map = line[0], int(line[1])
				if map != 4 and map != 8:
					list.append(id)
	return set(list)