Ejemplo n.º 1
0
 def test_read_text_segment(self):
     with TmpDir() as dir_:
         filename = os.path.join(dir_, self.name)
         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)
         seg = Fcs.read_text_segment(filename)
         assert seg.pnn == self.channels
         assert seg.pns == self.long_channels
Ejemplo n.º 2
0
    def test_write_text_segment(self):
        with TmpDir() as dir_:
            filename = os.path.join(dir_, "export.fcs")
            fcs = Fcs(self.data, self.long_channels, self.channels)
            fcs.export(filename)

            fseg = TextSegment(
                self.data.shape[0],
                self.long_channels,
                ["w", "x", "y", "z"],
                self.data.max(axis=0),
                text_start=256,
            )

            Fcs.write_text_segment(filename, fseg)
            tseg = Fcs.read_text_segment(filename)
            assert tseg.pns == ["w", "x", "y", "z"]
Ejemplo n.º 3
0
    def test_read_text_segment(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:
                seg = Fcs.read_text_segment(fp)
            assert seg.pnn == self.channels
            assert seg.pns == self.long_channels