def reads_per_bin(bam_reader, chromosome, bin):
    """
    Number of reads per bin
    :param bam_reader: an instance of pysam.AlignmentFile
    :param chromosome: chromosome name
    :param bin: Bin namedtuple
    :return: integer
    """
    try:
        reads = bam_reader.count(chromosome, bin.start, bin.end)
    except ValueError:
        reads = 0
    return reads
