예제 #1
0
    def setUp(self):
        self.cwd = os.path.dirname(
            os.path.abspath(__file__)) + "/data/Plate01/"
        tube1 = flow.Tube(file=self.cwd + 'RFP_Well_A3.fcs',
                          conditions={"Dox": 10.0})
        tube2 = flow.Tube(file=self.cwd + 'CFP_Well_A4.fcs',
                          conditions={"Dox": 1.0})
        import_op = flow.ImportOp(conditions={"Dox": "float"},
                                  tubes=[tube1, tube2])
        ex = import_op.apply()

        # this works so much better on transformed data
        logicle = flow.LogicleTransformOp()
        logicle.name = "Logicle transformation"
        logicle.channels = ['V2-A', 'Y2-A', 'B1-A']
        logicle.estimate(ex)
        self.ex = logicle.apply(ex)

        self.gate = flow.Range2DOp(name="Range2D",
                                   xchannel="V2-A",
                                   ychannel="Y2-A",
                                   xlow=0.0,
                                   xhigh=0.4,
                                   ylow=0.4,
                                   yhigh=0.8)
예제 #2
0
    def test_logicle_apply(self):
        """
        Make sure the function applies without segfaulting
        """

        el = flow.LogicleTransformOp()
        el.name = "Logicle"
        el.channels = ['Y2-A']

        el.estimate(self.ex)
        el.apply(self.ex)
예제 #3
0
    def test_logicle_estimate(self):
        """
        Test the parameter estimator against the R implementation
        """

        el = flow.LogicleTransformOp()
        el.name = "Logicle"
        el.channels = ["Y2-A"]

        el.estimate(self.ex)

        # these are the values the R implementation gives
        self.assertAlmostEqual(el.A['Y2-A'], 0.0)
        self.assertAlmostEqual(el.W['Y2-A'], 0.533191950161284)