def load_data(sample: fk.Sample): channels = range(SKIP, len(sample.channels)) channel_data = [] for channel in channels: channel_data.append( np.array(sample.get_channel_data(channel, source="raw"))) return np.array(channel_data).T
def test_get_channel_data_comp(): fcs_file_path = "examples/test_comp_example.fcs" comp_file_path = Path("examples/comp_complete_example.csv") sample = Sample(fcs_path_or_data=fcs_file_path, compensation=comp_file_path) data_idx_6 = sample.get_channel_data(6, source='comp') np.testing.assert_equal(sample._comp_events[:, 6], data_idx_6)
def test_get_channel_data_xform(): fcs_file_path = "examples/test_comp_example.fcs" comp_file_path = Path("examples/comp_complete_example.csv") sample = Sample(fcs_path_or_data=fcs_file_path, compensation=comp_file_path) sample.apply_transform(xform_logicle) data_idx_6 = sample.get_channel_data(6, source='xform') np.testing.assert_equal(sample._transformed_events[:, 6], data_idx_6)
def load_time(sample: fk.Sample): """ Assuming the time is channel 0 """ return np.array(sample.get_channel_data(0, source="raw"))