示例#1
0
    def testRoundtrip(self):
        flow.ExportFCS(path=self.directory, by=['Dox']).export(self.ex)

        tube1 = flow.Tube(file=self.directory / 'Dox_10.0.fcs',
                          conditions={
                              "Dox": 10.0,
                              "Well": "A"
                          })
        tube2 = flow.Tube(file=self.directory / 'Dox_1.0.fcs',
                          conditions={
                              "Dox": 1.0,
                              "Well": "B"
                          })

        ex_rt = flow.ImportOp(conditions={
            "Dox": "float",
            "Well": "category"
        },
                              tubes=[tube1, tube2]).apply()

        self.assertTrue((self.ex.data == ex_rt.data).all().all())

        for channel in self.ex.channels:
            self.assertEqual(self.ex.metadata[channel]['range'],
                             ex_rt.metadata[channel]['range'])
示例#2
0
    def testRoundtripWithBeadCalibration(self):
        self.cwd = os.path.dirname(os.path.abspath(__file__))
        self.ex = flow.ImportOp(conditions={
            'Dox': 'float'
        },
                                tubes=[
                                    flow.Tube(file=self.cwd +
                                              '/data/tasbe/rby.fcs',
                                              conditions={'Dox': 1.0})
                                ]).apply()

        op = flow.BeadCalibrationOp(
            units={"PE-Tx-Red-YG-A": "MEPTR"},
            beads_file=self.cwd + '/data/tasbe/beads.fcs',
            beads=flow.BeadCalibrationOp.BEADS[
                "Spherotech RCP-30-5A Lot AA01-AA04, AB01, AB02, AC01, GAA01-R"]
        )
        op.estimate(self.ex)

        ex2 = op.apply(self.ex)

        flow.ExportFCS(path=self.directory, by=['Dox']).export(ex2)

        tube1 = flow.Tube(file=self.directory / 'Dox_1.0.fcs',
                          conditions={"Dox": 1.0})
        ex_rt = flow.ImportOp(conditions={
            'Dox': 'float'
        }, tubes=[tube1]).apply()

        self.assertNotIn('voltage', ex_rt.metadata['PE-Tx-Red-YG-A'])
示例#3
0
    def testRoundtrip(self):
        flow.ExportFCS(path=self.directory, by=['Dox']).export(self.ex)

        tube1 = flow.Tube(file=self.directory + '/Dox_10.0.fcs',
                          conditions={"Dox": 10.0})
        tube2 = flow.Tube(file=self.directory + '/Dox_1.0.fcs',
                          conditions={"Dox": 1.0})

        ex_rt = flow.ImportOp(conditions={
            "Dox": "float"
        },
                              tubes=[tube1, tube2]).apply()

        self.assertTrue((self.ex.data == ex_rt.data).all().all())