Пример #1
0
 def test_count(self):
     with TmpDir() as dir_:
         filename = os.path.join(dir_, self.name)
         df = DataFrame(self.data, columns=self.channels)
         df.to_fcs(filename)
         fcs = Fcs.from_file(filename)
         assert fcs.count == len(self.data)
Пример #2
0
 def test_data(self):
     with TmpDir() as dir_:
         filename = os.path.join(dir_, self.name)
         df = DataFrame(self.data, columns=self.channels)
         df.to_fcs(filename)
         fcs = Fcs.from_file(filename)
         assert np.array_equal(fcs.values, self.data)
Пример #3
0
    def test_from_fcs(self):
        with TmpDir() as dir_:
            filename = os.path.join(dir_, "test.fcs")
            cols = pd.MultiIndex.from_tuples(
                list(zip(self.channels, self.long_channels)),
                names=["short", "long"],
            )
            df = DataFrame(self.data, columns=cols)
            df.to_fcs(filename)

            self.s3.upload_file(filename, self.bucket_name, "test.fcs")
            parse_func = create_open_func(S3ReadBuffer, bucket=self.bucket_name)

            with parse_func("test.fcs") as fp:
                fcs = Fcs.from_file(fp)
                assert fcs.short_channels == self.channels
                assert fcs.long_channels == self.long_channels
                assert fcs.count == len(self.data)
                assert np.array_equal(fcs.values, self.data)