@@ -21,7 +21,7 @@ def __init__(self, results_dict, sample_id):
2121 @staticmethod
2222 def _get_pd_result_dict (res_dict , gate_name ):
2323 return {
24- 'sample ' : res_dict ['sample' ],
24+ 'sample_id ' : res_dict ['sample' ],
2525 'gate_path' : res_dict ['gate_path' ],
2626 'parent' : res_dict ['parent' ],
2727 'gate_name' : gate_name ,
@@ -60,7 +60,7 @@ def _process_results(self):
6060 df = pd .DataFrame (
6161 pd_list ,
6262 columns = [
63- 'sample ' ,
63+ 'sample_id ' ,
6464 'gate_path' ,
6565 'gate_name' ,
6666 'gate_type' ,
@@ -73,10 +73,10 @@ def _process_results(self):
7373 )
7474 df ['level' ] = df .gate_path .map (lambda x : len (x ) - 1 )
7575
76- self .report = df .sort_values (['sample ' , 'level' , 'gate_name' ])
76+ self .report = df .sort_values (['sample_id ' , 'level' , 'gate_name' ])
7777
7878 def _filter_gate_report (self , gate_name , gate_path = None ):
79- results = self .report [(self .report ['sample ' ] == self .sample_id ) & (self .report ['gate_name' ] == gate_name )]
79+ results = self .report [(self .report ['sample_id ' ] == self .sample_id ) & (self .report ['gate_name' ] == gate_name )]
8080
8181 if gate_path is not None :
8282 results = results [results .gate_path == gate_path ]
@@ -87,7 +87,7 @@ def _filter_gate_report(self, gate_name, gate_path=None):
8787
8888 def get_gate_membership (self , gate_name , gate_path = None ):
8989 """
90- Retrieve a boolean array indicating gate membership for the events in the GatingResults sample .
90+ Retrieve a boolean array indicating gate membership for the Sample events in the GatingResults.
9191 Note, the same gate ID may be found in multiple gate paths, i.e. the gate ID can be ambiguous.
9292 In this case, specify the full gate path to retrieve gate indices.
9393
@@ -106,7 +106,7 @@ def get_gate_membership(self, gate_name, gate_path=None):
106106 gate_path = gate_paths [0 ]
107107
108108 # need to check for quadrant gates, as they need to be handled differently
109- gate_data = self .report [(self .report ['sample ' ] == self .sample_id ) & (self .report .gate_name == gate_name )]
109+ gate_data = self .report [(self .report ['sample_id ' ] == self .sample_id ) & (self .report .gate_name == gate_name )]
110110 quad_parent_values = set (gate_data .quadrant_parent .to_list ())
111111
112112 if len (quad_parent_values ) == 1 and None in quad_parent_values :
0 commit comments