Esempio n. 1
0
    def setUp(self):
        super().setUp()

        plugin = ImportPlugin()
        op = plugin.get_operation()

        from cytoflow import Tube

        self.cwd = os.path.dirname(os.path.abspath(__file__))

        tube = Tube(file=self.cwd + "/../../cytoflow/tests/data/tasbe/rby.fcs")
        op.tubes = [tube]

        wi = WorkflowItem(operation=op,
                          status="waiting",
                          view_error="Not yet plotted")
        self.workflow.workflow.append(wi)

        op.do_estimate = True
        self.workflow.wi_waitfor(wi, 'status', 'valid')
        self.assertTrue(
            self.workflow.remote_eval("self.workflow[0].result is not None"))

        plugin = ThresholdPlugin()
        op = plugin.get_operation()

        op.name = "Morpho"
        op.channel = "FSC-A"
        op.threshold = 100000

        wi = WorkflowItem(operation=op, status='waiting')
        self.workflow.workflow.append(wi)
        self.workflow.selected = wi
        self.workflow.wi_waitfor(wi, 'status', 'valid')
Esempio n. 2
0
    def activated(self):
        # add an import plugin
        plugin = ImportPlugin()
        wi = WorkflowItem(task=self)
        wi.operation = plugin.get_operation()

        self.model.workflow.append(wi)
        self.model.selected = wi

        # if we're debugging, add a few data bits
        if self.debug:
            from cytoflow import Tube

            wi.operation.conditions["Dox"] = "log"

            tube1 = Tube(file="../cytoflow/tests/data/Plate01/CFP_Well_A4.fcs",
                         conditions={"Dox": 0.1})

            tube2 = Tube(file="../cytoflow/tests/data/Plate01/RFP_Well_A3.fcs",
                         conditions={"Dox": 1.0})

            wi.operation.tubes.append(tube1)
            wi.operation.tubes.append(tube2)

            self.add_operation(
                'edu.mit.synbio.cytoflowgui.op_plugins.threshold')
            self.model.selected.operation.channel = "Y2-A"
            self.model.selected.operation.threshold = 2000
            self.model.selected.operation.name = "T"
Esempio n. 3
0
    def activated(self):
        # add an import plugin
        plugin = ImportPlugin()
        wi = WorkflowItem(task = self)
        wi.operation = plugin.get_operation()

        self.model.workflow.append(wi)
        self.model.selected = wi
        
        # if we're debugging, add a few data bits
        if self.debug:
            from cytoflow import Tube
                     
            wi.operation.conditions["Dox"] = "log"
        
            tube1 = Tube(file = "../cytoflow/tests/data/Plate01/CFP_Well_A4.fcs",
                         conditions = {"Dox" : 0.1})
        
            tube2 = Tube(file = "../cytoflow/tests/data/Plate01/RFP_Well_A3.fcs",
                         conditions = {"Dox" : 1.0})
        
            wi.operation.tubes.append(tube1)
            wi.operation.tubes.append(tube2)
                        
            self.add_operation('edu.mit.synbio.cytoflowgui.op_plugins.hlog')
            self.model.selected.operation.channels = ["V2-A", "Y2-A"]
            self.model.selected.operation.name = "H"
              
            self.add_operation('edu.mit.synbio.cytoflowgui.op_plugins.threshold')
            self.model.selected.operation.channel = "Y2-A"
            self.model.selected.operation.threshold = 2000
            self.model.selected.operation.name = "T"        
Esempio n. 4
0
    def on_new(self):
        self.model.workflow = []

        # add an import plugin
        plugin = ImportPlugin()
        wi = WorkflowItem(task=self)
        wi.operation = plugin.get_operation()

        self.model.workflow.append(wi)
        self.model.selected = wi
Esempio n. 5
0
    def on_new(self):
        self.model.workflow = []
        
        # add an import plugin
        plugin = ImportPlugin()
        wi = WorkflowItem(task = self)
        wi.operation = plugin.get_operation()

        self.model.workflow.append(wi)
        self.model.selected = wi
Esempio n. 6
0
    def setUp(self):
        WorkflowTest.setUp(self)
        
        plugin = ImportPlugin()
        op = plugin.get_operation()

        from cytoflow import Tube
             
        self.cwd = os.path.dirname(os.path.abspath(__file__))
     
        tube = Tube(file = self.cwd + "/../../cytoflow/tests/data/tasbe/rby.fcs")
        op.tubes = [tube]
        
        wi = WorkflowItem(operation = op,
                          view_error = "Not yet plotted") 
        self.workflow.workflow.append(wi)
        self.assertTrue(wait_for(wi, 'status', lambda v: v == 'valid', 5))
        self.assertTrue(self.workflow.remote_eval("self.workflow[0].result is not None"))
Esempio n. 7
0
    def setUp(self):
        WorkflowTest.setUp(self)
        
        plugin = ImportPlugin()
        op = plugin.get_operation()

        from cytoflow import Tube
        
        op.conditions = {"Dox" : "float", "Well" : "category"}
     
        self.cwd = os.path.dirname(os.path.abspath(__file__))
     
        tube1 = Tube(file = self.cwd + "/../../cytoflow/tests/data/Plate01/CFP_Well_A4.fcs",
                     conditions = {"Dox" : 0.0, "Well" : 'A'})
     
        tube2 = Tube(file = self.cwd + "/../../cytoflow/tests/data/Plate01/RFP_Well_A3.fcs",
                     conditions = {"Dox" : 10.0, "Well" : 'A'})

        tube3 = Tube(file = self.cwd + "/../../cytoflow/tests/data/Plate01/YFP_Well_A7.fcs",
                     conditions = {"Dox" : 100.0, "Well" : 'A'})
         
        tube4 = Tube(file = self.cwd + "/../../cytoflow/tests/data/Plate01/CFP_Well_B4.fcs",
                     conditions = {"Dox" : 0.0, "Well" : 'B'})
     
        tube5 = Tube(file = self.cwd + "/../../cytoflow/tests/data/Plate01/RFP_Well_A6.fcs",
                     conditions = {"Dox" : 10.0, "Well" : 'B'})

        tube6 = Tube(file = self.cwd + "/../../cytoflow/tests/data/Plate01/YFP_Well_C7.fcs",
                     conditions = {"Dox" : 100.0, "Well" : 'B'})
     
        op.tubes = [tube1, tube2, tube3, tube4, tube5, tube6]
        
        wi = WorkflowItem(operation = op,
                          view_error = "Not yet plotted") 
        self.workflow.workflow.append(wi)
        self.assertTrue(wait_for(wi, 'status', lambda v: v == 'valid', 5))
        self.assertTrue(self.workflow.remote_eval("self.workflow[0].result is not None"))
Esempio n. 8
0
    def setUp(self):
        super().setUp()

        import_plugin = ImportPlugin()
        import_op = import_plugin.get_operation()

        from cytoflow import Tube

        import_op.conditions = {
            "Dox": "float",
            "IP": "float",
            "Well": "category"
        }

        self.cwd = os.path.dirname(os.path.abspath(__file__))

        tube1 = Tube(file=self.cwd +
                     "/../../cytoflow/tests/data/Plate01/CFP_Well_A4.fcs",
                     conditions={
                         "Dox": 1.0,
                         "IP": 1.0,
                         "Well": 'A'
                     })

        tube2 = Tube(file=self.cwd +
                     "/../../cytoflow/tests/data/Plate01/RFP_Well_A3.fcs",
                     conditions={
                         "Dox": 1.0,
                         "IP": 10.0,
                         "Well": 'B'
                     })

        tube3 = Tube(file=self.cwd +
                     "/../../cytoflow/tests/data/Plate01/YFP_Well_A7.fcs",
                     conditions={
                         "Dox": 10.0,
                         "IP": 1.0,
                         "Well": 'A'
                     })

        tube4 = Tube(file=self.cwd +
                     "/../../cytoflow/tests/data/Plate01/CFP_Well_B4.fcs",
                     conditions={
                         "Dox": 10.0,
                         "IP": 10.0,
                         "Well": 'B'
                     })

        tube5 = Tube(file=self.cwd +
                     "/../../cytoflow/tests/data/Plate01/RFP_Well_A6.fcs",
                     conditions={
                         "Dox": 100.0,
                         "IP": 1.0,
                         "Well": 'A'
                     })

        tube6 = Tube(file=self.cwd +
                     "/../../cytoflow/tests/data/Plate01/YFP_Well_C7.fcs",
                     conditions={
                         "Dox": 100.0,
                         "IP": 100.0,
                         "Well": 'B'
                     })

        import_op.tubes = [tube1, tube2, tube3, tube4, tube5, tube6]

        wi = WorkflowItem(operation=import_op,
                          status="waiting",
                          view_error="Not yet plotted")
        self.workflow.workflow.append(wi)

        import_op.do_estimate = True
        self.workflow.wi_waitfor(wi, 'status', 'valid')
        self.assertTrue(
            self.workflow.remote_eval("self.workflow[0].result is not None"))

        stats_plugin = ChannelStatisticPlugin()

        stats_op_1 = stats_plugin.get_operation()
        stats_op_1.name = "MeanByDoxIP"
        stats_op_1.channel = "Y2-A"
        stats_op_1.statistic_name = "Geom.Mean"
        stats_op_1.by = ['Dox', 'IP']
        stats_op_1.subset_list.append(
            CategorySubset(name="Well", values=['A', 'B']))
        stats_op_1.subset_list.append(
            RangeSubset(name="Dox", values=[1.0, 10.0, 100.0]))
        stats_op_1.subset_list.append(
            RangeSubset(name="IP", values=[1.0, 10.0]))

        stats_wi_1 = WorkflowItem(operation=stats_op_1,
                                  status="waiting",
                                  view_error="Not yet plotted")
        self.workflow.workflow.append(stats_wi_1)
        self.workflow.wi_waitfor(stats_wi_1, 'status', 'valid')

        stats_op_2 = stats_plugin.get_operation()
        stats_op_2.name = "SDByDoxIP"
        stats_op_2.channel = "Y2-A"
        stats_op_2.statistic_name = "Geom.SD"
        stats_op_2.by = ['Dox', 'IP']
        stats_op_2.subset_list.append(
            CategorySubset(name="Well", values=['A', 'B']))
        stats_op_2.subset_list.append(
            RangeSubset(name="Dox", values=[1.0, 10.0, 100.0]))
        stats_op_2.subset_list.append(
            RangeSubset(name="IP", values=[1.0, 10.0]))

        stats_wi_2 = WorkflowItem(operation=stats_op_2,
                                  status="waiting",
                                  view_error="Not yet plotted")
        self.workflow.workflow.append(stats_wi_2)
        self.workflow.selected = stats_wi_2
        self.workflow.wi_waitfor(stats_wi_2, 'status', 'valid')