def filter(fastq, sam, paired = False):
if paired is False:<EOL><INDENT>list = sam_list(sam)<EOL><DEDENT>else:<EOL><INDENT>list = sam_list_paired(sam)<EOL><DEDENT>if paired is False:<EOL><INDENT>filter_fastq(fastq, list)<EOL><DEDENT>else:<EOL><INDENT>filter_fastq_paired(fastq, list)<EOL><DEDENT>
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