def ceiling_cpm(cpm, ceiling = 1000):
    """Sets CPM to have ceiling

    Args:
        cpm (float): CPM of isoform
        ceiling (int, optional): Maximum. Defaults to 1000.

    Returns:
        float: new cpm constrained to ceiling
    """
    # gtf top score is 1000
    if cpm > ceiling:
        return ceiling
    else:
        return cpm