Ejemplo n.º 1
0
    def test_matrix_transform_logicle_range8c_gate():
        gml_path = 'examples/data/gate_ref/gml/gml_matrix_transform_logicle_range8c_gate.xml'
        res_path = 'examples/data/gate_ref/truth/Results_ScaleRange8c.txt'

        s = Session()
        group_name = 'gml'
        s.add_sample_group(group_name, gating_strategy=gml_path)
        s.add_samples(data1_sample)
        s.assign_samples(data1_sample.original_filename, group_name)
        s.analyze_samples(group_name=group_name)

        truth = pd.read_csv(res_path, header=None, squeeze=True,
                            dtype='bool').values
        result = s.get_gate_membership(group_name,
                                       data1_sample.original_filename,
                                       'ScaleRange8c')

        np.testing.assert_array_equal(truth, result)
Ejemplo n.º 2
0
    def test_parent_quadrant_rect_gate():
        gml_path = 'examples/data/gate_ref/gml/gml_parent_quadrant_rect_gate.xml'
        res_path = 'examples/data/gate_ref/truth/Results_ParQuadRect.txt'

        s = Session()
        group_name = 'gml'
        s.add_sample_group(group_name, gating_strategy=gml_path)
        s.add_samples(data1_sample)
        s.assign_samples(data1_sample.original_filename, group_name)
        s.analyze_samples(group_name=group_name)

        truth = pd.read_csv(res_path, header=None, squeeze=True,
                            dtype='bool').values
        result = s.get_gate_membership(group_name,
                                       data1_sample.original_filename,
                                       'ParRectangle1')

        np.testing.assert_array_equal(truth, result)
Ejemplo n.º 3
0
    def test_get_ambiguous_gate_objects(self):
        wsp_path = "examples/data/8_color_data_set/8_color_ICS.wsp"
        fcs_path = "examples/data/8_color_data_set/fcs_files/101_DEN084Y5_15_E01_008_clean.fcs"
        sample_id = '101_DEN084Y5_15_E01_008_clean.fcs'
        sample_grp = 'DEN'
        gate_name = 'TNFa+'
        gate_path = ('root', 'Time', 'Singlets', 'aAmine-', 'CD3+', 'CD4+')

        fks = Session(fcs_samples=fcs_path)
        fks.import_flowjo_workspace(wsp_path, ignore_missing_files=True)

        fks.analyze_samples(sample_grp)
        gate_indices = fks.get_gate_membership(sample_grp,
                                               sample_id,
                                               gate_name,
                                               gate_path=gate_path)

        self.assertIsInstance(gate_indices, np.ndarray)
        self.assertEqual(np.sum(gate_indices), 21)