def checkTagGroupsPandas(design_table, ref_group=None):
    '''compute groups and pairs from tag data table.'''

    conds, pairs, factors = identifyVariablesPandas(design_table)
    groups = list(set(conds))

    # Relevel the groups so that the reference comes first
    # how to do this in python?
    # if ref_group is not None:
    #    R('''groups <- relevel(groups, ref = "%s")''' % ref_group)

    # check this works, will need to make factors from normal df
    # TS adapted from JJ code for DESeq2 -
    # check whether there are additional factors in design file...
    if factors:
        E.warn("There are additional factors in design file that are ignored"
               " by groupTagData: ", factors)
    else:
        pass

    # Test if replicates exist - at least one group must have multiple samples
    max_per_group = max([conds.count(x) for x in groups])

    has_replicates = 2 >= max_per_group

    # Test if pairs exist:
    npairs = len(set(pairs))
    has_pairs = npairs == 2

    # ..if so, at least two samples are required per pair
    if has_pairs:
        min_per_pair = min([pairs.count(x) for x in set(pairs)])
        has_pairs = min_per_pair >= 2

    return groups, pairs, conds, factors, has_replicates, has_pairs
dataset/ETHPy150Open CGATOxford/cgat/CGAT/Expression.py/checkTagGroupsPandas/swapped operands of `>=`