Beispiel #1
0
    def test_get_events_as_data_frame_comp(self):
        fcs_file_path = "examples/test_comp_example.fcs"
        comp_file_path = "examples/comp_complete_example.csv"

        sample = Sample(fcs_path_or_data=fcs_file_path,
                        compensation=comp_file_path)

        df = sample.as_dataframe(source='comp')

        self.assertIsInstance(df, pd.DataFrame)
        np.testing.assert_equal(df.values, sample.get_comp_events())
Beispiel #2
0
    def test_load_from_pandas_multi_index(self):
        sample_orig = Sample("examples/data/100715.fcs",
                             cache_original_events=True)
        pnn_orig = sample_orig.pnn_labels
        pns_orig = sample_orig.pns_labels

        df = sample_orig.as_dataframe(source='orig')

        sample_new = Sample(df)
        pnn_new = sample_new.pnn_labels
        pns_new = sample_new.pns_labels

        self.assertListEqual(pnn_orig, pnn_new)
        self.assertListEqual(pns_orig, pns_new)