import re


def tile_filter(sequence_id, filter_list):
	""" Takes a sequence identifier - first line of the four lines for each
		sequence in a FASTQ file (begins with a @) - and a list of tiles to be
		removed, and returns and returns True if the tile is in the list
		and False if the tile is not in the list.  Assumes Casava 1.8 and later
		format, where the tile is the fifth item (the 6th index)
		in the identifier.
		"""

	parsed = re.split('[ :]+', sequence_id)
	if parsed[4] in filter_list:
		return True
	else:
		return False