cytoflow.operations.i_operation#

i_operation contains just one class:

IOperation – an traits.has_traits.Interface that all operation classes must implement.

class cytoflow.operations.i_operation.IOperation[source]#

Bases: Interface

The basic interface for an operation on cytometry data.

id#

a unique identifier for this class. prefix: cytoflow.operations

Type:

Str

friendly_id#

The operation’s human-readable id (like Threshold or K-means). Used for UI implementations.

Type:

Str

name#

The name of this IOperation instance (like Debris_Filter). Useful for UI implementations; sometimes used for naming gates’ metadata

Type:

Str

estimate(experiment, subset=None)[source]#

Estimate this operation’s parameters from some data.

For operations that are data-driven (for example, a mixture model), estimate the operation’s parameters from an experiment.

Parameters:
  • experiment (Experiment) – the Experiment to use in the estimation.

  • subset (Str (optional)) – a string passed to pandas.DataFrame.query to select the subset of data on which to run the parameter estimation.

Raises:

CytoflowOpException – If the operation can’t be be completed because of bad op parameters.

apply(experiment)[source]#

Apply an operation to an experiment.

Parameters:

experiment (Experiment) – the Experiment to apply this op to

Returns:

the old Experiment with this operation applied

Return type:

Experiment

Raises:

CytoflowOpException – If the operation can’t be be completed because of bad op parameters.

default_view(**kwargs)[source]#

Many operations have a “default” view. This can either be a diagnostic for the operation’s estimate method, an interactive for setting gates, etc. Frequently it makes sense to link the properties of the view to the properties of the IOperation; sometimes, default_view is the only way to get the view (ie, it’s not useful when it doesn’t reference an IOperation instance.)

Parameters:

**kwargs (Dict) – The keyword args passed to the view’s constructor

Returns:

the IView instance

Return type:

IView