Make sure interesting_groups specify existing metadata and that
    the interesting_group is not all of the same for all of the samples

def _check_for_degenerate_interesting_groups(items):
    """ Make sure interesting_groups specify existing metadata and that
    the interesting_group is not all of the same for all of the samples
    """
    igkey = ("algorithm", "bcbiornaseq", "interesting_groups")
    interesting_groups = tz.get_in(igkey, items[0], [])
    if isinstance(interesting_groups, str):
        interesting_groups = [interesting_groups]
    for group in interesting_groups:
        values = [tz.get_in(("metadata", group), x, None) for x in items]
        if all(x is None for x in values):
            raise ValueError("group %s is labelled as an interesting group, "
                             "but does not appear in the metadata." % group)
        if len(list(tz.unique(values))) == 1:
            raise ValueError("group %s is marked as an interesting group, "
                             "but all samples have the same value." % group)