def get_n_per_bin(fasta, chromosome, bin):
    """
    Get number of N bases in a region
    :param fasta: an instance of pyfaidx.Fasta
    :param chromosome: chromosome name
    :param bin: Bin namedtuple
    :return: integer
    """
    return fasta[chromosome][bin.start:bin.end].seq.upper().count('N')
