def check_min_reads(samfile, chrom, tx_st, tx_end, cutoff):
    """
	make sure the gene has minimum reads coverage. if cutoff = 10, each gene must have
	10 *different* reads.
	"""
    tmp = False
    read_count = set()
    try:
        alignedReads = samfile.fetch(chrom, tx_st, tx_end)
        for aligned_read in alignedReads:
            if aligned_read.is_qcfail:
                continue
            if aligned_read.is_unmapped:
                continue
            if aligned_read.is_secondary:
                continue
            read_start = aligned_read.pos
            if read_start < tx_st:
                continue
            if read_start >= tx_end:
                continue
            read_count.add(read_start)
            if len(read_count) > cutoff:
                tmp = True
                break
        return tmp
    except:
        return False
