def dis_to_nearest_gene(region, genes, distance_cutoff=10000):
    """Compute the distance of  a specified region to the nearest gene TSS.

    Parameters
    ----------
    region : GenomicRegion
        GenomicRegion object.
    genes : list
        List of genes on that chromosome.
    distance_cutoff : int
        Maximal distance cutoff.

    Returns
    -------
    int or None
        A signed distance, positive if the region is located at the downstream
        of the nearest gene and vice versa. Or None if the distance is beyond
        the distance cutoff.
    """
    dis_min = distance_cutoff
    target_gene = None
    for gene in genes:
        tmp_dis = region.start - gene.tss
        if abs(tmp_dis) < dis_min:
            dis_min = tmp_dis
            target_gene = gene
    if target_gene is None:
        return None
    else:
        if target_gene.strand == '-':
            # signed value, positive for downstream and negative for upstream
            dis_min = -dis_min
        return dis_min