def setUp(self):
        ImportedDataTest.setUp(self)

        self.ex = flow.ChannelStatisticOp(name="Y",
                                          channel="Y2-A",
                                          by=['Well', 'Dox'],
                                          function=flow.geom_mean).apply(
                                              self.ex)

        self.ex = flow.ChannelStatisticOp(name="Y",
                                          channel="Y2-A",
                                          by=['Well', 'Dox'],
                                          function=flow.geom_sd_range).apply(
                                              self.ex)

        self.ex = flow.ChannelStatisticOp(name="V",
                                          channel="V2-A",
                                          by=['Well', 'Dox'],
                                          function=flow.geom_mean).apply(
                                              self.ex)

        self.ex = flow.ChannelStatisticOp(name="V",
                                          channel="V2-A",
                                          by=['Well', 'Dox'],
                                          function=flow.geom_sd_range).apply(
                                              self.ex)

        self.view = flow.Stats2DView(xstatistic=("Y", "geom_mean"),
                                     x_error_statistic=("Y", "geom_sd_range"),
                                     ystatistic=("V", "geom_mean"),
                                     y_error_statistic=("V", "geom_sd_range"),
                                     variable="Dox",
                                     huefacet="Well")
Exemple #2
0
 def testStats2D(self):
     import numpy as np
     flow.Stats2DView(name="Stats2D",
                      by="Dox",
                      xchannel="V2-A",
                      xfunction=np.mean,
                      ychannel="Y2-A",
                      yfunction=np.mean).plot(self.ex)
 def testBadYErrorStatistic(self):
     self.ex = flow.ChannelStatisticOp(name = "V_bad",
                          channel = "V2-A",
                          by = ['Well'],
                          function = flow.geom_sd_range).apply(self.ex)
                                  
     self.view = flow.Stats2DView(xstatistic = ("Y", "geom_mean"),
                                  x_error_statistic = ("Y", "geom_sd_range"),
                                  ystatistic = ("V", "geom_mean"),
                                  y_error_statistic = ("V_bad", "geom_sd_range"),
                                  variable = "Dox",
                                  huefacet = "Well")
     
     self.assertRaises(util.CytoflowViewError, self.view.plot, self.ex)
    def testStats2D(self):
        import numpy as np

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

        ex3 = flow.ChannelStatisticOp(name="StatsY",
                                      by=["Dox"],
                                      channel="Y2-A",
                                      function=np.mean).apply(ex2)

        flow.Stats2DView(xstatistic=("StatsV", "mean"),
                         ystatistic=("StatsY", "mean"),
                         variable="Dox").plot(ex3)
Exemple #5
0
    plt.vlines(x, y_lo, y_hi, color=color, **kwargs)


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.Stats2DView()
    s.variable = "Dox"
    s.xchannel = "V2-A"
    s.xfunction = np.mean
    s.ychannel = "Y2-A"
    s.yfunction = np.mean
    s.huefacet = "Y2-A+"

    plt.ioff()
    s.plot(ex2)
    plt.show()