Esempio n. 1
0
    def base_logicle_test(self, original_file, transed_file):
        diff_threshold = 1.0
        fcs, fcs_trans = load_test_data(original_file, transed_file)
        compensate(fcs)
        # Currently applying logicle transform takes a lot of time, and
        # we want to run this script inside CircleCI without timeout.
        # So we put the processing into subprocess and periodically print
        # status.
        run_and_check(lambda: apply_logicle_transform(fcs, ), 300)

        channel_info = fcs.meta['_channels_']
        result = {}
        fail = False
        for channel in channel_info['$PnN']:
            if channel == 'Time':
                continue
            val0 = fcs[channel].values
            val1 = fcs_trans[channel].values
            denom = (val0 + val1) / 2 + 1
            numer = np.abs(val0 - val1)
            diff = 100 * np.mean(numer / denom)
            result[channel] = diff
            if diff > diff_threshold:
                fail = True
        _LG.info(result)
        self.assertTrue(not fail)
Esempio n. 2
0
    def base_logicle_test(self, original_file, transed_file):
        diff_threshold = 1.0
        fcs, fcs_trans = load_test_data(original_file, transed_file)
        compensate(fcs)
        # Currently applying logicle transform takes a lot of time, and
        # we want to run this script inside CircleCI without timeout.
        # So we put the processing into subprocess and periodically print
        # status.
        run_and_check(lambda: apply_logicle_transform(fcs,), 300)

        channel_info = fcs.meta['_channels_']
        result = {}
        fail = False
        for channel in channel_info['$PnN']:
            if channel == 'Time':
                continue
            val0 = fcs[channel].values
            val1 = fcs_trans[channel].values
            denom = (val0 + val1) / 2 + 1
            numer = np.abs(val0 - val1)
            diff = 100 * np.mean(numer/denom)
            result[channel] = diff
            if diff > diff_threshold:
                fail = True
        _LG.info(result)
        self.assertTrue(not fail)
Esempio n. 3
0
def main():
    logging.basicConfig(level=logging.INFO)
    args = parse_command_line_arguments()

    _LG.info('Loading {}'.format(args.input))
    fcs = load_fcs(args.input)

    _LG.info('Applying logicle transform.')
    # Currently applying logicle transform takes a lot of time, and we want to
    # run this script inside CircleCI without timeout. So we put the
    # processing into subprocess and periodically print status.
    run_and_check(lambda: apply_logicle_transform(fcs,), 300)

    _LG.info('Saving the result to {}'.format(args.output))
    fcs.save(args.output)