def runMockAnalysis(outfile,
                    outfile_prefix,
                    ref_group=None,
                    ref_regex=None,
                    pseudo_counts=0):
    '''run a mock analysis on a count table.

    compute fold enrichment values, but do not normalize or
    perform any test.
    '''

    groups, pairs, has_replicates, has_pairs = groupTagData(ref_group,
                                                            ref_regex)

    all_results = []
    for combination in itertools.combinations(groups, 2):
        control, treatment = combination

        R('''control_counts = rowSums( countsTable[groups == '%s'] )''' %
          control)
        R('''treatment_counts = rowSums( countsTable[groups == '%s'] )''' %
          treatment)

        # add pseudocounts to enable analysis of regions
        # that are absent/present
        if pseudo_counts:
            R('''control_counts = control_counts + %f''' % pseudo_counts)
            R('''treatment_counts = treatment_counts + %f''' % pseudo_counts)

        R('''fc = treatment_counts / control_counts''')

        results = []

        for identifier, treatment_count, control_count, foldchange in \
                zip(R('''rownames( countsTable)'''),
                    R('''treatment_counts'''),
                    R('''control_counts'''),
                    R('''fc''')):
            try:
                log2fold = math.log(foldchange)
            except ValueError:
                log2fold = "Inf"

            results.append(GeneExpressionResult._make((
                identifier,
                treatment,
                treatment_count,
                0,
                control,
                control_count,
                0,
                1,
                1,
                log2fold,
                foldchange,
                log2fold,
                "0",
                "OK")))

        all_results.extend(results)

    writeExpressionResults(outfile, all_results)
dataset/ETHPy150Open CGATOxford/cgat/CGAT/Expression.py/runMockAnalysis/original