FACSPy.ml.supervisedGating.sample_cells

FACSPy.ml.supervisedGating.sample_cells#

supervisedGating.sample_cells(sampler)#

Method to sample the cells. For further documentation, refer to the documentation of the GateSampler class

Parameters:

sampler (GateSampler) – The GateSampler instance.

Return type:

None

Examples

>>> adata = fp.create_dataset([...])
>>> gating = fp.ml.supervisedGating(dataset)
>>> gating.run_data_setup(
...     gated_samples = ["1", "2", "3"],
...     layer = "compensated",
...     scaling = "StandardScaler"
... )
>>> gating.setup_classifier("DecisionTreeClassifier")
>>> gating.tune_hyperparameters(
...    method = "HalvingRandomSearchCV",
...    grid = {"max_depth": [10,20,100]}
... )
>>> gating.setup_classifier("DecisionTreeClassifier")
>>> sampler = GateSampler(...)
>>> gating.sample_cells(sampler)
>>> gating.train()
>>> gating.gate_dataset()