def test_poly2_gate(): gml_path = 'examples/gate_ref/gml/gml_poly2_gate.xml' res_path = 'examples/gate_ref/truth/Results_Polygon2.txt' s = Session() group_name = 'gml' s.add_sample_group(group_name, gating_strategy=gml_path) s.add_samples(data1_sample) s.assign_sample(data1_sample.original_filename, group_name) s.analyze_samples(sample_group=group_name) truth = pd.read_csv(res_path, header=None, squeeze=True, dtype='bool').values result = s.get_gate_indices(group_name, data1_sample.original_filename, 'Polygon2') np.testing.assert_array_equal(truth, result)
def test_get_ambiguous_gate_objects(self): wsp_path = "examples/8_color_data_set/8_color_ICS.wsp" fcs_path = "examples/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_id = '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_indices(sample_grp, sample_id, gate_id, gate_path=gate_path) self.assertIsInstance(gate_indices, np.ndarray) self.assertEqual(np.sum(gate_indices), 21)