def filter(fastq, sam, paired = False):
	""" 
	filter sequences that are shown to be mapped in the sam file
	reads not in sam file are in *.filtered.fastq
	reads that are in the sam file are in *.matched.fastq
	"""
	if paired is False:
		list = sam_list(sam)
	else:
		list = sam_list_paired(sam)
	if paired is False:
		filter_fastq(fastq, list)
	else:
		filter_fastq_paired(fastq, list)