Skip to content

Commit 1bd0005

Browse files
committed
beh(gate): Remove parent_population_id
1 parent e513984 commit 1bd0005

File tree

6 files changed

+2
-85
lines changed

6 files changed

+2
-85
lines changed

cellengine/resources/gate.py

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Gate:
1717
experiment_id: str = field(on_setattr=readonly)
1818
fcs_file_id: Optional[str]
1919
gid: Optional[str]
20-
parent_population_id: Optional[str]
2120
tailored_per_file: Optional[bool]
2221
type: str
2322
x_channel: str
@@ -44,7 +43,7 @@ def path(self):
4443
def update(self):
4544
"""Save changes to this Gate to CellEngine.
4645
If this gate does not exist, it will be created."""
47-
if not self._id or not is_good_id(self._id):
46+
if not self._id or not is_valid_id(self._id):
4847
gate = self.client.create(self)
4948
else:
5049
gate = self.client.update(self)
@@ -102,8 +101,6 @@ def create(
102101
label: List[float] = [],
103102
gid: str = None,
104103
locked: bool = False,
105-
parent_population_id: str = None,
106-
parent_population: str = None, # TODO
107104
tailored_per_file: bool = False,
108105
fcs_file_id: str = None,
109106
fcs_file: str = None,
@@ -128,13 +125,6 @@ def create(
128125
specified, then a new Group ID will be created. To create a
129126
tailored gate, the gid of the global tailored gate must be specified.
130127
locked (bool): Prevents modification of the gate via the web interface.
131-
parent_population_id (str): ID of the parent population. Use ``None`` for
132-
the "ungated" population. If specified, do not specify
133-
``parent_population``.
134-
parent_population (str): Name of the parent population. An attempt will
135-
be made to find the population by name. If zero or more than
136-
one population exists with the name, an error will be thrown.
137-
If specified, do not specify ``parent_population_id``.
138128
tailored_per_file (bool): Whether or not this gate is tailored per FCS file.
139129
fcs_file_id (str): ID of FCS file, if tailored per file. Use ``None`` for
140130
the global gate in a tailored gate group. If specified, do not
@@ -183,7 +173,6 @@ def create(
183173
experiment_id=experiment_id,
184174
fcs_file_id=fcs_file_id,
185175
gid=gid,
186-
parent_population_id=parent_population_id,
187176
tailored_per_file=tailored_per_file,
188177
type="RectangleGate",
189178
x_channel=x_channel,
@@ -207,8 +196,6 @@ def create(
207196
label: Optional[List[float]] = [],
208197
gid: Optional[str] = None,
209198
locked: Optional[bool] = False,
210-
parent_population_id: Optional[str] = None,
211-
parent_population: Optional[str] = None,
212199
tailored_per_file: Optional[bool] = False,
213200
fcs_file_id: Optional[str] = None,
214201
fcs_file: Optional[str] = None,
@@ -227,13 +214,6 @@ def create(
227214
specified, then a new Group ID will be created. To create a
228215
tailored gate, the gid of the global tailored gate must be specified.
229216
locked (bool): Prevents modification of the gate via the web interface.
230-
parent_population_id (str): ID of the parent population. Use ``None`` for
231-
the "ungated" population. If specified, do not specify
232-
``parent_population``.
233-
parent_population (str): Name of the parent population. An attempt will
234-
be made to find the population by name. If zero or more than
235-
one population exists with the name, an error will be thrown.
236-
If specified, do not specify ``parent_population_id``.
237217
tailored_per_file (bool): Whether or not this gate is tailored per FCS file.
238218
fcs_file_id (str): ID of FCS file, if tailored per file. Use ``None`` for
239219
the global gate in a tailored gate group. If specified, do not
@@ -282,7 +262,6 @@ def create(
282262
experiment_id=experiment_id,
283263
fcs_file_id=fcs_file_id,
284264
gid=gid,
285-
parent_population_id=parent_population_id,
286265
tailored_per_file=tailored_per_file,
287266
type="PolygonGate",
288267
x_channel=x_channel,
@@ -310,8 +289,6 @@ def create(
310289
label: List[float] = [],
311290
gid: str = None,
312291
locked: bool = False,
313-
parent_population_id: str = None,
314-
parent_population: str = None,
315292
tailored_per_file: bool = False,
316293
fcs_file_id: str = None,
317294
fcs_file: str = None,
@@ -337,13 +314,6 @@ def create(
337314
specified.
338315
locked (bool, optional): Prevents modification of the gate via the web
339316
interface.
340-
parent_population_id (Optional[str]): ID of the parent population. Use
341-
``None`` for the "ungated" population. If specified, do not specify
342-
``parent_population``.
343-
parent_population (str, optional): Name of the parent population. An
344-
attempt will be made to find the population by name. If zero or
345-
more than one population exists with the name, an error will be
346-
thrown. If specified, do not specify ``parent_population_id``.
347317
tailored_per_file (bool, optional): Whether or not this gate is
348318
tailored per FCS file. fcs_file_id (str, optional): ID of FCS
349319
file, if tailored per file. Use ``None`` for the global gate in a
@@ -396,7 +366,6 @@ def create(
396366
experiment_id=experiment_id,
397367
fcs_file_id=fcs_file_id,
398368
gid=gid,
399-
parent_population_id=parent_population_id,
400369
tailored_per_file=tailored_per_file,
401370
type="EllipseGate",
402371
x_channel=x_channel,
@@ -421,8 +390,6 @@ def create(
421390
label: List[float] = [],
422391
gid: str = None,
423392
locked: bool = False,
424-
parent_population_id: str = None,
425-
parent_population: str = None,
426393
tailored_per_file: bool = False,
427394
fcs_file_id: str = None,
428395
fcs_file: str = None,
@@ -444,13 +411,6 @@ def create(
444411
specified, then a new Group ID will be created. To create a
445412
tailored gate, the gid of the global tailored gate must be specified.
446413
locked (bool): Prevents modification of the gate via the web interface.
447-
parent_population_id (str): ID of the parent population. Use ``None`` for
448-
the "ungated" population. If specified, do not specify
449-
``parent_population``.
450-
parent_population (str): Name of the parent population. An attempt will
451-
be made to find the population by name. If zero or more than
452-
one population exists with the name, an error will be thrown.
453-
If specified, do not specify ``parent_population_id``.
454414
tailored_per_file (bool): Whether or not this gate is tailored per FCS file.
455415
fcs_file_id (str): ID of FCS file, if tailored per file. Use ``None`` for
456416
the global gate in a tailored gate group. If specified, do not
@@ -498,7 +458,6 @@ def create(
498458
experiment_id=experiment_id,
499459
fcs_file_id=fcs_file_id,
500460
gid=gid,
501-
parent_population_id=parent_population_id,
502461
tailored_per_file=tailored_per_file,
503462
type="RangeGate",
504463
x_channel=x_channel,
@@ -526,8 +485,6 @@ def create(
526485
gid: str = None,
527486
gids: List[str] = None,
528487
locked: bool = False,
529-
parent_population_id: str = None,
530-
parent_population: str = None,
531488
tailored_per_file: bool = False,
532489
fcs_file_id: str = None,
533490
fcs_file: str = None,
@@ -556,13 +513,6 @@ def create(
556513
tailored gate, the gid of the global tailored gate must be specified.
557514
gids (list): Group IDs of each sector, assigned to ``model.gids``.
558515
locked (bool): Prevents modification of the gate via the web interface.
559-
parent_population_id (str): ID of the parent population. Use ``None`` for
560-
the "ungated" population. If specified, do not specify
561-
``parent_population``.
562-
parent_population (str): Name of the parent population. An attempt will
563-
be made to find the population by name. If zero or more than
564-
one population exists with the name, an error will be thrown.
565-
If specified, do not specify ``parent_population_id``.
566516
tailored_per_file (bool): Whether or not this gate is tailored per FCS file.
567517
fcs_file_id (str): ID of FCS file, if tailored per file. Use ``None`` for
568518
the global gate in a tailored gate group. If specified, do not
@@ -637,7 +587,6 @@ def create(
637587
experiment_id=experiment_id,
638588
fcs_file_id=fcs_file_id,
639589
gid=gid,
640-
parent_population_id=parent_population_id,
641590
tailored_per_file=tailored_per_file,
642591
type="QuadrantGate",
643592
x_channel=x_channel,
@@ -662,8 +611,6 @@ def create(
662611
gid: str = None,
663612
gids: List[str] = None,
664613
locked: bool = False,
665-
parent_population_id: str = None,
666-
parent_population: str = None,
667614
tailored_per_file: bool = False,
668615
fcs_file_id: str = None,
669616
fcs_file: str = None,
@@ -691,13 +638,6 @@ def create(
691638
tailored gate, the gid of the global tailored gate must be specified.
692639
gids (list): Group IDs of each sector, assigned to model.gids.
693640
locked (bool): Prevents modification of the gate via the web interface.
694-
parent_population_id (str): ID of the parent population. Use ``None`` for
695-
the "ungated" population. If specified, do not specify
696-
``parent_population``.
697-
parent_population (str): Name of the parent population. An attempt will
698-
be made to find the population by name. If zero or more than
699-
one population exists with the name, an error will be thrown.
700-
If specified, do not specify ``parent_population_id``.
701641
tailored_per_file (bool): Whether or not this gate is tailored per FCS file.
702642
fcs_file_id (str): ID of FCS file, if tailored per file. Use ``None`` for
703643
the global gate in a tailored gate group. If specified, do not
@@ -763,7 +703,6 @@ def create(
763703
experiment_id=experiment_id,
764704
fcs_file_id=fcs_file_id,
765705
gid=gid,
766-
parent_population_id=parent_population_id,
767706
tailored_per_file=tailored_per_file,
768707
type="SplitGate",
769708
x_channel=x_channel,

tests/fixtures/api-gates.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def specific_gate(gate_type):
5050
},
5151
"name": "ellipse-gui",
5252
"names": [],
53-
"parentPopulationId": None,
5453
"tailoredPerFile": False,
5554
"type": "EllipseGate",
5655
"xChannel": "FSC-A",
@@ -79,7 +78,6 @@ def specific_gate(gate_type):
7978
},
8079
"name": "poly_gate",
8180
"names": [],
82-
"parentPopulationId": None,
8381
"tailoredPerFile": False,
8482
"type": "PolygonGate",
8583
"xChannel": "FSC-A",
@@ -112,7 +110,6 @@ def specific_gate(gate_type):
112110
"skewable": False,
113111
},
114112
"names": ["my gate (UR)", "my gate (UL)", "my gate (LL)", "my gate (LR)"],
115-
"parentPopulationId": None,
116113
"tailoredPerFile": False,
117114
"type": "QuadrantGate",
118115
"xChannel": "FSC-A",
@@ -130,7 +127,6 @@ def specific_gate(gate_type):
130127
},
131128
"name": "my gate",
132129
"names": [],
133-
"parentPopulationId": None,
134130
"tailoredPerFile": False,
135131
"type": "RangeGate",
136132
"xChannel": "FSC-A",
@@ -148,7 +144,6 @@ def specific_gate(gate_type):
148144
},
149145
"name": "test_rect_gate",
150146
"names": [],
151-
"parentPopulationId": None,
152147
"tailoredPerFile": False,
153148
"type": "RectangleGate",
154149
"xChannel": "FSC-W",
@@ -166,7 +161,6 @@ def specific_gate(gate_type):
166161
"split": {"x": 160000, "y": 1},
167162
},
168163
"names": ["my gate (L)", "my gate (R)"],
169-
"parentPopulationId": None,
170164
"tailoredPerFile": False,
171165
"type": "SplitGate",
172166
"xChannel": "FSC-A",
@@ -205,7 +199,6 @@ def gates():
205199
"test gate 2 (LL)",
206200
"test gate 2 (LR)",
207201
],
208-
"parentPopulationId": None,
209202
"tailoredPerFile": False,
210203
"type": "QuadrantGate",
211204
"xChannel": "FSC-A",
@@ -233,7 +226,6 @@ def gates():
233226
"skewable": False,
234227
},
235228
"names": ["subtest (UR)", "subtest (UL)", "subtest (LL)", "subtest (LR)"],
236-
"parentPopulationId": None,
237229
"tailoredPerFile": False,
238230
"type": "QuadrantGate",
239231
"xChannel": "FSC-A",
@@ -256,7 +248,6 @@ def gates():
256248
},
257249
"name": "rect",
258250
"names": [],
259-
"parentPopulationId": None,
260251
"tailoredPerFile": False,
261252
"type": "RectangleGate",
262253
"xChannel": "FSC-A",
@@ -293,7 +284,6 @@ def gates():
293284
},
294285
},
295286
"names": ["quad (UR)", "quad (UL)", "quad (LL)", "quad (LR)"],
296-
"parentPopulationId": "5d64abe2ca9df61349ed8e89",
297287
"tailoredPerFile": False,
298288
"type": "QuadrantGate",
299289
"xChannel": "FSC-A",
@@ -311,7 +301,6 @@ def gates():
311301
},
312302
"name": "my gate",
313303
"names": [],
314-
"parentPopulationId": None,
315304
"tailoredPerFile": False,
316305
"type": "RectangleGate",
317306
"xChannel": "FSC-A",
@@ -329,7 +318,6 @@ def gates():
329318
},
330319
"name": "my gate",
331320
"names": [],
332-
"parentPopulationId": None,
333321
"tailoredPerFile": False,
334322
"type": "RectangleGate",
335323
"xChannel": "FSC-A",
@@ -347,7 +335,6 @@ def gates():
347335
},
348336
"name": "my gate",
349337
"names": [],
350-
"parentPopulationId": None,
351338
"tailoredPerFile": False,
352339
"type": "RectangleGate",
353340
"xChannel": "FSC-A",

tests/fixtures/api-statistics.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ def statistics():
1010
"populationId": "2d64abe2ca9df61348ed8z9b",
1111
"population": "Singlets",
1212
"uniquePopulationName": "Singlets",
13-
"parentPopulationId": None,
14-
"parentPopulation": "Ungated",
1513
"channel": "PE-A",
1614
"reagent": "CD3",
1715
"mean": 52040.376758718616,
@@ -24,8 +22,6 @@ def statistics():
2422
"populationId": "2d64abe2ca9df61348ed8z9a",
2523
"population": "Singlets",
2624
"uniquePopulationName": "Singlets",
27-
"parentPopulationId": None,
28-
"parentPopulation": "Ungated",
2925
"channel": "FSC-A",
3026
"mean": 87881.26381655093,
3127
"median": 86734.2890625,

tests/integration/test_integration.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,8 @@ def test_experiment_gates(setup_experiment, client):
202202
Gate.update_gate_family(
203203
experiment._id,
204204
split_gate.gid,
205-
body={"name": "new split gate name", "parentPopulationId": population._id},
205+
body={"name": "new split gate name"},
206206
)
207-
assert experiment.gates[0].parent_population_id == population._id
208207
assert experiment.gates[0].name == "new split gate name"
209208

210209
# DELETE

tests/unit/resources/test_gates.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def gate_tester(instance):
2626
assert hasattr(instance, "y_channel")
2727
assert hasattr(instance, "tailored_per_file")
2828
assert hasattr(instance, "fcs_file_id")
29-
assert hasattr(instance, "parent_population_id")
3029
assert hasattr(instance, "model")
3130

3231

@@ -139,7 +138,6 @@ def bad_gate():
139138
# "gid": "5dc6e4514855ff5d3d041d03",
140139
"xChannel": "FSC-A",
141140
"yChannel": "FSC-W",
142-
"parentPopulationId": None,
143141
"model": {
144142
"polygon": {"vertices": [[1, 4], [2, 5], [3, 6]]},
145143
"label": [2, 5],

tests/unit/resources/test_statistics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,5 @@ def test_should_return_pandas_dataframe(
119119
"populationId",
120120
"population",
121121
"uniquePopulationName",
122-
"parentPopulation",
123-
"parentPopulationId",
124122
]
125123
assert all(prop in stats.columns.to_list() for prop in properties)

0 commit comments

Comments
 (0)