Beispiel #1
0
    def test_fully_custom_transform():
        sample1 = Sample(fcs_path_or_data=data1_fcs_path)
        sample2 = Sample(fcs_path_or_data=data1_fcs_path)

        custom_xforms = {
            'FL1-H': xform_biex1,
            'FL2-H': xform_biex1,
            'FL3-H': xform_biex2,
            'FL2-A': xform_biex1,
            'FL4-H': xform_biex1
        }

        sample1.apply_transform(xform_biex1)
        sample2.apply_transform(custom_xforms)

        fl2_idx = sample1.get_channel_index('FL2-H')
        fl3_idx = sample1.get_channel_index('FL3-H')

        s1_fl2 = sample1.get_channel_events(fl2_idx, source='xform')
        s2_fl2 = sample2.get_channel_events(fl2_idx, source='xform')
        s1_fl3 = sample1.get_channel_events(fl3_idx, source='xform')
        s2_fl3 = sample2.get_channel_events(fl3_idx, source='xform')

        np.testing.assert_equal(s1_fl2, s2_fl2)
        np.testing.assert_raises(AssertionError, np.testing.assert_equal,
                                 s1_fl3, s2_fl3)
Beispiel #2
0
    def test_get_channel_events_subsample(self):
        sample = Sample(data1_fcs_path, subsample=500)

        data_idx_6 = sample.get_channel_events(6, source='raw', subsample=True)

        self.assertEqual(len(data_idx_6), 500)