def dagchainer_id_to_int(id):
    """Accepts DAGchainer ids such as "cl1" and returns an integer."""
    if not id.startswith('cl'):
        raise ValueError(f'Invalid ID {id}.')
    id_val = id[2:]
    if not id_val.isnumeric():
        raise ValueError(f'Non-numeric ID value in {id}.')
    return int(id_val)
