Esempio n. 1
0
    def testStats1D(self):
        import numpy as np

        ex2 = flow.ChannelStatisticOp(name="Stats1D",
                                      by=["Dox"],
                                      channel="V2-A",
                                      function=np.mean).apply(self.ex)

        flow.Stats1DView(statistic=("Stats1D", "mean"),
                         variable="Dox").plot(ex2)

        flow.Stats1DView(statistic=("Stats1D", "mean"),
                         variable="Dox",
                         variable_scale="log",
                         scale="logicle").plot(ex2)
Esempio n. 2
0
    def testBadErrorStat(self):
        self.ex = flow.ChannelStatisticOp(name="ByDox_BAD",
                                          channel="Y2-A",
                                          by=['Dox'],
                                          function=flow.geom_sd_range).apply(
                                              self.ex)

        self.view = flow.Stats1DView(statistic=("ByDox", "geom_mean"),
                                     error_statistic=("ByDox_BAD",
                                                      "geom_sd_range"),
                                     variable="Dox",
                                     huefacet="T")

        self.assertRaises(util.CytoflowViewError, self.view.plot, self.ex)
Esempio n. 3
0
 def setUp(self):
     ImportedDataTest.setUp(self)
     self.ex = flow.ThresholdOp(name = "T",
                                channel = "Y2-A",
                                threshold = 500).apply(self.ex)
                                
     self.ex = flow.ChannelStatisticOp(name = "ByDox",
                          channel = "Y2-A",
                          by = ['T', 'Dox'],
                          function = flow.geom_mean).apply(self.ex)
                          
     self.ex = flow.ChannelStatisticOp(name = "ByDox",
                          channel = "Y2-A",
                          by = ['T', 'Dox'],
                          function = flow.geom_sd_range).apply(self.ex)
                                  
     self.view = flow.Stats1DView(statistic = ("ByDox", "geom_mean"),
                                  error_statistic = ("ByDox", "geom_sd_range"),
                                  variable = "Dox",
                                  huefacet = "T")
Esempio n. 4
0
util.expand_method_parameters(Stats1DView, Stats1DView.plot)
    

if __name__ == '__main__':
    import cytoflow as flow
    
    tube1 = flow.Tube(file = '../../cytoflow/tests/data/Plate01/RFP_Well_A3.fcs',
                      conditions = {"Dox" : 10.0})
    
    tube2 = flow.Tube(file = '../../cytoflow/tests/data/Plate01/CFP_Well_A4.fcs',
                      conditions = {"Dox" : 1.0})                      

    ex = flow.ImportOp(conditions = {"Dox" : "float"}, tubes = [tube1, tube2])
    
    thresh = flow.ThresholdOp()
    thresh.name = "Y2-A+"
    thresh.channel = 'Y2-A'
    thresh.threshold = 2005.0

    ex2 = thresh.apply(ex)
    
    s = flow.Stats1DView()
    s.by = "Dox"
    s.ychannel = "Y2-A"
    s.yfunction = np.mean
    s.huefacet = "Y2-A+"
    
    plt.ioff()
    s.plot(ex2)
    plt.show()
Esempio n. 5
0
 def testStats1D(self):
     import numpy as np
     flow.Stats1DView(name="Stats1D",
                      by="Dox",
                      ychannel="V2-A",
                      yfunction=np.mean).plot(self.ex)